Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMTSOBS

GMTSOBS.m

Go to the documentation of this file.
  1. GMTSOBS ; SLC/KER - HS Object - Show ; 01/06/2003
  1. ;;2.7;Health Summary;**58,89**;Oct 20, 1995;Build 61
  1. ;
  1. ; External References
  1. ; DBIA 10103 $$FMADD^XLFDT
  1. ; DBIA 10103 $$NOW^XLFDT
  1. ; DBIA 10103 $$FMTE^XLFDT
  1. ; DBIA 10104 $$UP^XLFSTR
  1. ; DBIA 2056 $$GET1^DIQ (file #200)
  1. ; DBIA 10060 ^VA(200, (read w/fileman)
  1. ; DBIA 10086 ^%ZIS
  1. ; DBIA 10086 HOME^%ZIS
  1. ; DBIA 10089 ^%ZISC
  1. ; DBIA 10088 ENDR^%ZISS
  1. ; DBIA 10063 ^%ZTLOAD
  1. ;
  1. Q
  1. DEF(X,GMTSARY) ; Extract Object Definition/Example
  1. N GMTSEXT S GMTSEXT="" D SO($G(X)) Q
  1. SO(X) ; Show Object
  1. N GMTSNAM,GMTSLBL,GMTSTYP,GMTSHST,GMTSPER,GMTSNOD,GMTSPLB,GMTSNODA
  1. N GMTSLBB,GMTSRDT,GMTSCON,GMTSRHD,GMTSCHD,GMTSUND,GMTSLIM,GMTSBLK
  1. N GMTSDEC,GMTSOWN,GMTSCRE,GMTSMOD,GMTSUNT,GMTSLEN,GMTSTIM,GMTSI
  1. N GMTSO,GMTSL,GMTSDTM,GMTSDED,GMTSDCH,GMTSDCN,GMTSTIM,GMTSWIN,TXT S U="^"
  1. S GMTSO=$G(^GMT(142.5,+($G(X)),0))
  1. S GMTSNAM=$P(GMTSO,U,1) Q:'$L(GMTSNAM)
  1. S GMTSLBL=$P(GMTSO,U,2) S:'$L(GMTSLBL) GMTSLBL="UNSPECIFIED"
  1. S (GMTSHST,GMTSTYP)=+($P(GMTSO,U,3)) Q:+GMTSTYP=0
  1. S GMTSTYP=$P($G(^GMT(142,+GMTSTYP,0)),"^",1) Q:'$L(GMTSTYP)
  1. S GMTSPER=$P(GMTSO,U,4)
  1. S GMTSLEN=+GMTSPER
  1. S GMTSUNT=$E(GMTSPER,$L(GMTSPER))
  1. S:+GMTSUNT>0 GMTSUNT="D"
  1. ;
  1. S GMTSNOD=+($P(GMTSO,U,5))
  1. S GMTSHDR=+($P(GMTSO,U,6))
  1. S GMTSPLB=+($P(GMTSO,U,7))
  1. S GMTSLBB=+($P(GMTSO,U,8))
  1. S GMTSRDT=+($P(GMTSO,U,9))
  1. S GMTSCON=+($P(GMTSO,U,10))
  1. S GMTSRHD=+($P(GMTSO,U,11))
  1. S GMTSCHD=+($P(GMTSO,U,12))
  1. S GMTSUND=+($P(GMTSO,U,13))
  1. S GMTSLIM=+($P(GMTSO,U,14))
  1. S GMTSBLK=+($P(GMTSO,U,15))
  1. S GMTSDEC=+($P(GMTSO,U,16))
  1. S GMTSOWN=+($P(GMTSO,U,17)),GMTSOWN=$$GET1^DIQ(200,(+GMTSOWN_","),.01)
  1. S GMTSCRE=+($P(GMTSO,U,18)),GMTSCRE=$TR($$FMTE^XLFDT(GMTSCRE,"5ZM"),"@"," ")
  1. S GMTSMOD=+($P(GMTSO,U,19)),GMTSMOD=$TR($$FMTE^XLFDT(GMTSMOD,"5ZM"),"@"," ")
  1. S GMTSNODA=$G(^GMT(142.5,+$G(X),2))
  1. S (GMTSTIM,GMTSPER)=$P(GMTSO,"^",4),GMTSTIM=$S($E(GMTSTIM,$L(GMTSTIM))="Y":" year",$E(GMTSTIM,$L(GMTSTIM))="M":" month",$E(GMTSTIM,$L(GMTSTIM))="W":" week",1:" day")
  1. S:+GMTSPER>1 GMTSTIM=GMTSTIM_"s" S GMTSTIM=+GMTSPER_GMTSTIM
  1. I $L(GMTSPER) D
  1. . N GMTSPX1,GMTSPX2,GMTSLEN,GMTSUNT,GMTSDIF
  1. . S GMTSPX1=$$NOW^XLFDT,GMTSUNT=$E(GMTSPER,$L(GMTSPER)),GMTSLEN=+GMTSPER
  1. . I +GMTSLEN=0!($L(GMTSUNT)'=1)!("DWMY"'[GMTSUNT) S GMTSPER="" Q
  1. . S:GMTSUNT="D" GMTSDIF=GMTSLEN S:GMTSUNT="W" GMTSDIF=GMTSLEN*7
  1. . S:GMTSUNT="M" GMTSDIF=GMTSLEN*30.4 S:GMTSUNT="Y" GMTSDIF=GMTSLEN*365.25
  1. . S GMTSDIF=$P(GMTSDIF,".",1),GMTSPX2=$$FMADD^XLFDT(GMTSPX1,-(GMTSDIF))
  1. . S GMTSPX1=$$UP^XLFSTR($$FMTE^XLFDT(GMTSPX1,"ZD"))
  1. . S GMTSPX2=$$UP^XLFSTR($$FMTE^XLFDT(GMTSPX2,"ZD"))
  1. . S GMTSWIN=GMTSPER_" ("_GMTSPX2_" - "_GMTSPX1_")"
  1. S:'$L(GMTSPER) GMTSPER="UNSPECIFIED"
  1. S:$L($G(GMTSTIM))&('$L($G(GMTSWIN))) GMTSWIN=$G(GMTSTIM)
  1. W:$L($G(GMTSHDR(1))) !,GMTSHDR(1)
  1. W:$L($G(GMTSHDR(2))) !,GMTSHDR(2)
  1. ;
  1. S TXT=" OBJECT NAME: "_$G(GMTSNAM)
  1. D D(TXT)
  1. S TXT=" HEALTH SUMMARY TYPE: "_$G(GMTSTYP)
  1. D D(TXT)
  1. ;
  1. S TXT=" REPORT PERIOD: "_$G(GMTSPER),TXT=TXT_$J(" ",(41-$L(TXT)))_"PRINT REPORT DATE/TIME: "_$S(+GMTSHDR>0&(+GMTSRDT>0):"YES",+GMTSHDR'>0:"YES",1:"NO")
  1. D D(TXT)
  1. ;
  1. S TXT=" LABEL: "_$G(GMTSLBL),TXT=TXT_$J(" ",(41-$L(TXT)))_"PRINT CONFIDENTIALITY BANNER: "_$S(+GMTSHDR>0&(+GMTSCON>0):"YES",+GMTSHDR'>0:"YES",1:"NO")
  1. D D(TXT)
  1. ;
  1. S TXT=" PRINT LABEL: "_$S(+GMTSPLB>0:"YES",1:"NO"),TXT=TXT_$J(" ",(41-$L(TXT)))_"PRINT REPORT HEADER: "_$S(+GMTSHDR>0&(+GMTSRHD>0):"YES",+GMTSHDR'>0:"YES",1:"NO")
  1. D D(TXT)
  1. ;
  1. S TXT=" BLANK LINE AFTER LABEL: "_$S(+GMTSLBB>0:"YES",1:"NO"),TXT=TXT_$J(" ",(41-$L(TXT)))_"PRINT COMPONENT HEADER: "_$S(+GMTSHDR>0&(+GMTSCHD>0):"YES",+GMTSHDR'>0:"YES",1:"NO")
  1. D D(TXT)
  1. ;
  1. S TXT=" SUPPRESS COMPONENTS W/O DATA: "_$S(+GMTSNOD>0:"YES",1:"NO")
  1. S TXT=TXT_$J(" ",(41-$L(TXT)))_" PRINT TIME-OCCURRENCE LIMITS: "_$S(+GMTSHDR>0&(+GMTSLIM>0):"YES",+GMTSHDR'>0:"YES",1:"NO")
  1. D D(TXT)
  1. ;
  1. S TXT=" SUPPRESS HEADER: "_$S(+GMTSHDR>0:"YES",1:"NO")
  1. S TXT=TXT_$J(" ",(41-$L(TXT)))_" UNDERLINE COMPONENT HEADER: "_$S(+GMTSHDR>0&(+GMTSUND>0):"YES",1:"NO")
  1. D D(TXT)
  1. ;
  1. S TXT=" SUPPRESS DECEASED INFORMATION: "_$S(+GMTSHDR>0&(+GMTSDEC>0):"NO",1:"YES")
  1. S TXT=TXT_$J(" ",(41-$L(TXT)))_" BLANK LINE AFTER HEADER: "_$S(+GMTSHDR>0&(+GMTSBLK>0):"YES",+GMTSHDR'>0:"YES",1:"NO")
  1. D D(TXT)
  1. ;
  1. S TXT=" OVERWRITE NO DATA AVAILABLE MESSAGE: "_GMTSNODA
  1. D D(TXT)
  1. S TXT=" CREATOR: "_GMTSOWN
  1. S TXT=TXT_$J(" ",(41-$L(TXT)))_"CREATED: "_GMTSCRE
  1. D D(TXT)
  1. ;
  1. S TXT="",TXT=TXT_$J(" ",(41-$L(TXT)))_"LAST MODIFIED: "_GMTSMOD
  1. D D(TXT)
  1. ;
  1. Q:$D(GMTSABRR)
  1. ;
  1. S TXT=" EXAMPLE:" D E(TXT)
  1. S GMTSDTM=$$NOW^XLFDT,GMTSDED=$$FMADD^XLFDT(GMTSDTM,-2000)
  1. S GMTSDED=$TR($$FMTE^XLFDT($P(GMTSDED,".",1),"2ZM"),"@"," ")
  1. S GMTSDTM=$TR($$FMTE^XLFDT(GMTSDTM,"2ZM"),"@"," ")
  1. S GMTSDCH=$$DCH(+($G(GMTSHST))),GMTSDCN=$P(GMTSDCH,"^",2),GMTSDCH=$P(GMTSDCH,"^",1)
  1. S:'$L(GMTSDCH) GMTSDCH="PN - Progress Notes" S GMTSTIM=$$TIM($G(GMTSPER))
  1. D:+GMTSHDR>0 SP^GMTSOBS2
  1. D:+GMTSHDR'>0 HS^GMTSOBS2
  1. Q
  1. DCH(X) ; Default Component Header
  1. N GMTSABR,GMTSDHD,GMTSDCH,GMTSDCN,GMTSTYP S GMTSTYP=+($G(X)),GMTSABR=$O(^GMT(142,+GMTSTYP,1,0))
  1. S GMTSABR=$G(^GMT(142,+GMTSTYP,1,+GMTSABR,0)),GMTSABR=+($P(GMTSABR,"^",2))
  1. S GMTSDCN=$P($G(^GMT(142.1,+GMTSABR,0)),"^",1),GMTSDHD=$P($G(^GMT(142.1,+GMTSABR,0)),"^",9),GMTSABR=$P($G(^GMT(142.1,+GMTSABR,0)),"^",4)
  1. S GMTSDCH=$S($L(GMTSABR)&($L(GMTSDHD)):(GMTSABR_" - "_GMTSDHD),1:"PN - Progress Notes")
  1. S X=GMTSDCH_"^"_GMTSDCN Q X
  1. TIM(X) ; Time
  1. N GMTSTIM,GMTSPER S (GMTSTIM,GMTSPER)=$G(X) S:'$L(GMTSTIM) (GMTSTIM,GMTSPER)="3M"
  1. S GMTSTIM=$S($E(GMTSTIM,$L(GMTSTIM))="Y":" year",$E(GMTSTIM,$L(GMTSTIM))="M":" month",$E(GMTSTIM,$L(GMTSTIM))="W":" week",1:" day")
  1. S:+GMTSPER>1 GMTSTIM=GMTSTIM_"s" S GMTSTIM=+GMTSPER_GMTSTIM
  1. S X=GMTSTIM Q X
  1. Q
  1. DEV ; Device
  1. I +($G(DFN))=0!('$D(^TMP("GMTSOBJ",$J,DFN))) K ^TMP("GMTSOBJ",$J,DFN) Q
  1. I $D(CAP) D NODEV K ^TMP("GMTSOBJ",$J,DFN) Q
  1. N ZTRTN,%ZIS,IOP,POP S %ZIS="PQ" D ^%ZIS Q:POP I $D(IO("Q")) D QUE Q
  1. NOQUE ; Print without Queuing
  1. N ZTRTN S ZTRTN="DSP^GMTSOBS"
  1. I $D(IOST),$D(IOF) W:IOST["C-"&('$D(GMTSNOI)) @IOF
  1. D @ZTRTN,^%ZISC K ^TMP("GMTSOBJ",$J,DFN) Q
  1. QUE ; Queued Print
  1. N %,ZTDESC,ZTDTH,ZTIO,ZTSAVE,ZTSK,ZTRTN S ZTRTN="DSP^GMTSOBS" K IO("Q"),ZTSAVE
  1. S ZTSAVE("^TMP(""GMTSOBJ"","_$J_","_DFN_",")="" S ZTSAVE("DFN")=""
  1. S:$D(GMTSHDR) ZTSAVE("GMTSHDR")=""
  1. S ZTDESC="Display Health Summary Object" S ZTIO=ION,ZTDTH=$H
  1. D ^%ZTLOAD I '$D(ZTSK) W !!,"Request Cancelled",! H 3 W:$D(IOF) @IOF
  1. I $D(ZTSK) W !!,"Request Queued",! H 3 W:$D(IOF) @IOF
  1. K ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE D ^%ZISC Q
  1. Q
  1. NODEV ; Print without Device Selection
  1. W !! N ZTRTN,POP,IOP,%ZIS,IOSL S IOSL=99999999999
  1. S ZTRTN="DSP^GMTSOBS" D @ZTRTN,^%ZISC K ^TMP("GMTSOBJ",$J,DFN)
  1. Q
  1. DSP ; Print Health Summary Type
  1. Q:+($G(DFN))=0 N GMTST,GMTSI,GMTSC,GMTSP,GMTSL,GMTSEXIT,GMTSCR,GMTSPL D HOME^%ZIS
  1. S GMTSPL=3,GMTSEXIT=0,GMTSP=$G(IOST),GMTSL=+($G(IOSL)) S:+GMTSL=0 GMTSL=24
  1. D ATTR W !!,$G(BOLD),"<----------------------------- Break in Document ---------------------------->",$G(NORM) S GMTSPL=GMTSPL+1
  1. W !,$G(BOLD),"<---------------------------- Beginning of Object --------------------------->",$G(NORM) S GMTSPL=GMTSPL+1 D KATTR
  1. S GMTSI=0 F S GMTSI=$O(^TMP("GMTSOBJ",$J,DFN,GMTSI)) Q:+GMTSI=0 D
  1. . W !,$G(^TMP("GMTSOBJ",$J,DFN,GMTSI,0)) S GMTSPL=+GMTSPL+1 D CONT
  1. K ^TMP("GMTSOBJ",$J,DFN)
  1. D ATTR W !,$G(BOLD),"<------------------------------ End of Object ------------------------------->",$G(NORM) S GMTSPL=+GMTSPL+1
  1. W !,$G(BOLD),"<----------------------------- Document Resumes ----------------------------->",$G(NORM) D KATTR S GMTSPL=+GMTSPL+1 S:+GMTSL>0 IOSL=GMTSL
  1. S GMTSPL=GMTSL D CONT W:GMTSP["P-"&($D(IOF)) @IOF
  1. Q
  1. D(X) ; Display
  1. I '$D(GMTSEXT) W !,$G(X) Q
  1. N GMTSC S GMTSC=$G(GMTSARY("D",0))+1,GMTSARY("D",+GMTSC)=$G(X),GMTSARY("D",0)=GMTSC
  1. Q
  1. E(X) ; Example
  1. I '$D(GMTSEXT) W !,$G(X) Q
  1. N GMTSC S GMTSC=$G(GMTSARY("E",0))+1,GMTSARY("E",+GMTSC)=$G(X),GMTSARY("E",0)=GMTSC
  1. Q
  1. CONT ; Press <Return> to Continue
  1. I GMTSP["P-" W:$L($G(IOF))&($D(IOF)) @IOF Q
  1. Q:(GMTSP["C-"!(GMTSP=""))&(GMTSPL'>(GMTSL-4)) S GMTSPL=0 Q:GMTSEXIT
  1. N GMTSCR S GMTSPL=0 W !!," Press <Return> to Continue "
  1. R GMTSCR:660 I '$T!(GMTSCR["^") S GMTSCR="^",GMTSEXIT=1
  1. W:GMTSP'["P-"&($D(IOF)) @IOF Q
  1. Q
  1. ATTR ; Set Screen Attributes
  1. N X,IOINHI,IOINORM S X="IOINHI;IOINORM" D ENDR^%ZISS S BOLD=$G(IOINHI),NORM=$G(IOINORM)
  1. Q
  1. KATTR ; Kill Screen Attributes
  1. K NORM,BOLD Q