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

GMTSUP.m

Go to the documentation of this file.
  1. GMTSUP ; SLC/KER - Utilities for Paging HS ; 01/06/2003
  1. ;;2.7;Health Summary;**2,7,21,27,28,30,35,47,56,58,85**;Oct 20, 1995;Build 24
  1. ;
  1. ; External References
  1. ; DBIA 10026 ^DIR
  1. ; DBIA 82 EN^XQORM
  1. ;
  1. CKP ; Check page position, pause and prompt
  1. Q:$D(GMTSQIT) S GMTSNPG=0
  1. K:$L($G(GMTSOBJ("LABEL"))) GMTSOBJ("REPORT HEADER")
  1. I $G(GMTSWRIT)=1 D BREAK S GMTSWRIT=0
  1. I +($$HF^GMTSU) D BREAK:(GMTSEGN'=$G(GMTSLCMP)) Q
  1. Q:+$G(GMTSLPG)'>0&($Y'>(IOSL-GMTSLO))
  1. I $E(IOST,1)="C" S:'$D(GMTSTOF) GMTSTOF=1 D CKP1
  1. I '$D(GMTSQIT) W @IOF D HEADER,BREAK S GMTSNPG=1,GMTSTOF=GMTSEGN
  1. I $D(GMTSQIT),(GMTSQIT]""),($D(GMTSTYP)) W @IOF D HEADER S GMTSTOF=GMTSEGN
  1. Q
  1. CKP1 ; Help Display of Optional Components for Navigation
  1. N DA,I,J,K,L,X,XQORM,Y,GMTSY,TYP,DIC
  1. I $S('$D(GMTSTYP):1,$D(GMTOPT):1,1:0) N DIR S DIR(0)="E" D ^DIR K DIR S:$D(DUOUT)!(GMTSLPG) GMTSQIT="" Q
  1. S TYP=GMTSTYP
  1. S DIC=142,DIC(0)="MZF",X="GMTS HS ADHOC OPTION" S Y=$$TYPE^GMTSULT
  1. S GMTSTYP=+Y K DIC,X,Y
  1. S XQORM=GMTSTYP_";GMT(142,",XQORM(0)="1AF\+",XQORM("A")="Press <RET> to continue, ^ to exit, or select component: "
  1. S XQORM("??")="D HELP^GMTSUP1" I GMTSLPG,'$D(GMTSOBJ) W:'$D(GMTSOBJE) "* END * "
  1. S XQORM("S")="I $D(^GMT(142,DA(1),1,DA,0)),($P(^GMT(142.1,$P(^GMT(142,DA(1),1,DA,0),U,2),0),U,6)'=""T"")"
  1. D EN^XQORM W ! D @$S(Y=1:"BRNCH",1:"EVAL")
  1. I $D(GMTSY),(GMTSY=0) K GMTSY G CKP1
  1. S GMTSTYP=TYP
  1. Q
  1. BREAK ; Writes the Component Header
  1. ;
  1. ; If the variable GMTSOBJ exist, then the
  1. ; Component Headers are suppressed with the
  1. ; following exceptions:
  1. ;
  1. ; If GMTSOBJ("COMPONENT HEADER") exist,
  1. ; then the Component Header will NOT be
  1. ; suppressed
  1. ;
  1. ; If GMTSOBJ("BLANK LINE") exist, a blank
  1. ; line will be written after the Component
  1. ; Header
  1. ;
  1. N GMTSM,GMTSF S GMTSM=$$MUL,GMTSF=$$FST
  1. I +GMTSM=0,$D(GMTSOBJ),'$D(GMTSOBJ("COMPONENT HEADER")),'$D(GMTSOBJ("BLANK LINE")) Q
  1. N GMTS,GMTSUL,GMTSL S:'$D(GMTSLCMP) GMTSLCMP=0
  1. S GMTSUL="",GMTSNPG=1,GMTS=$$CHDR,GMTSL=+($L($G(GMTS))),$P(GMTSUL,"-",+GMTSL)="-"
  1. I $Y'>(IOSL-GMTSLO)!(+($$HF^GMTSU)) D
  1. . I $D(GMTSOBJ) D Q
  1. . . S GMTSLCMP=GMTSEGN
  1. . . I +($G(GMTSM))>0!($D(GMTSOBJ("COMPONENT HEADER"))) D
  1. . . . W:+GMTSF=0 ! W !,GMTS W:$D(GMTSOBJ("UNDERLINE")) !,GMTSUL
  1. . . . W ! W:$D(GMTSOBJ("BLANK LINE")) !
  1. . W !,GMTS,!
  1. . W:$Y'>(IOSL-GMTSLO) ?34,$S(GMTSEGN=GMTSLCMP:"(continued)",1:""),!
  1. . S GMTSLCMP=GMTSEGN
  1. Q
  1. OLDB ;
  1. S:'$D(GMTSLCMP) GMTSLCMP=0
  1. S GMTS="",GMTSNPG=1
  1. S $P(GMTS,"-",79-$L(GMTSEGH_GMTSEGL)/2)=""
  1. S GMTS=GMTS_" "_GMTSEGH_GMTSEGL_" "_GMTS
  1. I $Y'>(IOSL-GMTSLO)!(+($$HF^GMTSU)) D
  1. . W !,GMTS,!
  1. . W:$Y'>(IOSL-GMTSLO) ?34,$S(GMTSEGN=GMTSLCMP:"(continued)",1:""),!
  1. . S GMTSLCMP=GMTSEGN
  1. Q
  1. ;
  1. ; If the variable GMTSOBJ exist, then the
  1. ; Report Headers are suppressed with the
  1. ; following exceptions:
  1. ;
  1. ; If GMTSOBJ("DATE LINE") exist, then the
  1. ; Location/Report Date line will NOT be
  1. ; suppressed.
  1. ;
  1. ; If GMTSOBJ("CONFIDENTIAL") exist, then
  1. ; the Confidential Header Name line will
  1. ; NOT be suppressed.
  1. ;
  1. ; If GMTSOBJ("REPORT HEADER") exist, then
  1. ; the Report Header containing the patient's
  1. ; name, SSAN, ward and DOB will NOT be
  1. ; suppressed.
  1. ;
  1. ; If the variable GMTSOBJ("LABEL") contains
  1. ; text, and the variable GMTSOBJ("USE LABEL")
  1. ; exist, then this text will be printed before
  1. ; the object text.
  1. ;
  1. ; If GMTSOBJ("REPORT DECEASED") exist, then
  1. ; the optional line that displays for Deceased
  1. ; patients will NOT be suppressed.
  1. ;
  1. ; Header Lines:
  1. N GMTSVDT,DATA S DATA="" I +$G(GMTSPXD1)&+$G(GMTSPXD2) D
  1. . Q:$G(GMTSOBJ) S:'$D(GMTSOBJE) DATA="Printed for data " S:$D(GMTSOBJE) DATA="Include data "
  1. . I GMTSPXD1=GMTSPXD2 S DATA=DATA_"on "_GMTSPXD1 Q
  1. . S DATA=DATA_"from "_GMTSPXD2_" to "_GMTSPXD1
  1. I $D(GMTSCDT(0)),'$D(GMTSOBJ) S GMTSVDT=GMTSCDT(0) S:GMTSDTM'["Printed:" GMTSDTM="Printed: "_GMTSDTM
  1. ; Location and Date of Report
  1. I '$D(GMTSOBJ)!($D(GMTSOBJ("DATE LINE"))) D
  1. . N GMTSLOC S GMTSLOC=$S('$D(GMTSOBJ("DATE LINE")):$P($G(GMTSSC),U,2),1:"")
  1. . W !,$S($L(GMTSLOC):"Location: "_GMTSLOC_" ",1:"")
  1. . W $S($D(GMTSVDT):GMTSVDT,1:"")
  1. . W:'$D(GMTSOBJ("DATE LINE")) DATA,?(79-$L(GMTSDTM)),GMTSDTM
  1. . W:$D(GMTSOBJ("DATE LINE")) DATA,?(74-$L(GMTSDTM)),GMTSDTM
  1. ; Confidential Header Name
  1. S:'$D(GMTSPG) GMTSPG=0
  1. S GMTSPG=GMTSPG+1,GMTSHDR=" CONFIDENTIAL "_GMTSTITL_" SUMMARY "
  1. S GMTSHDR=GMTSHDR_$S($E(IOST,1)="C":"",1:" pg. "_GMTSPG)
  1. S GMTS="" S:'$D(GMTSOBJ) $P(GMTS,"*",(77-$L(GMTSHDR))\2)="*"
  1. S:$D(GMTSOBJ) $P(GMTS,"*",(72-$L(GMTSHDR))\2)="*"
  1. S GMTSHDR=GMTS_" "_GMTSHDR_" "_GMTS
  1. I '$D(GMTSOBJ)!($D(GMTSOBJ("CONFIDENTIAL"))) W !,GMTSHDR,"*"
  1. ; Name, SSAN, Ward, DOB
  1. I '$D(GMTSLFG) D
  1. .I $G(GMTSTITL)'["AD HOC",($G(GMTSTITL)'["PDX"),($G(HSTAG)="") D EN^GMTSHCPR ;GMTS,85 restrict ssn/dob on HS Type hard copies
  1. . I $G(GMTSPHDR("TWO")) D
  1. . . I $D(GMTSOBJ),'$D(GMTSOBJ("REPORT HEADER")),$L($G(GMTSOBJ("LABEL"))) D LABEL
  1. . . I $D(GMTSOBJ),'$D(GMTSOBJ("REPORT HEADER")) Q
  1. . . W !,GMTSPHDR("NMSSN"),?GMTSPHDR("DOBS"),GMTSPHDR("DOB")
  1. . . W !,?GMTSPHDR("WARDRBS"),GMTSPHDR("WARDRB")
  1. . E D
  1. . . I $D(GMTSOBJ),'$D(GMTSOBJ("REPORT HEADER")),$L($G(GMTSOBJ("LABEL"))) D LABEL
  1. . . I $D(GMTSOBJ),'$D(GMTSOBJ("REPORT HEADER")) Q
  1. . . W !,GMTSPHDR("NMSSN"),?GMTSPHDR("WARDRBS")
  1. . . W GMTSPHDR("WARDRB"),?GMTSPHDR("DOBS"),GMTSPHDR("DOB")
  1. ; Deceased
  1. ;
  1. I '$D(GMTSOBJ)!($D(GMTSOBJ("DECEASED"))) D
  1. . W:+$G(VADM(6)) !,?26,"** DECEASED "_$P(VADM(6),U,2)_" **"
  1. W:'$D(GMTSOBJ) !
  1. Q
  1. BRNCH ; Checks abbreviation to branch to a different component
  1. N GMTINX,LIM,CREC,SBS
  1. I Y,("+-"[X) S:X="-" GMTSEGN=GMTSTOF-1 S (GMTSY,GMTSQIT)=1,GMTSLPG=0 Q
  1. I X="^^" S DIROUT=1,GMTSQIT="" Q
  1. I Y,(X?1"^^".E) Q
  1. S GMTINX=$S($D(^GMT(142,GMTSTYP,1,+Y(1),0)):$P(^(0),U,2),1:"")
  1. I 'GMTINX S GMTSY=0 Q
  1. I '$D(GMTSEGI(GMTINX)) N GMI,GMJ,GMTSDFLT S GMI=1,GMJ=GMTSEGC,GMTSDFLT=1 D LOAD^GMTSADH S GMTSEGC=GMTSEGC+1
  1. I '$D(GMTSEGI(GMTINX)) S GMTINX="",GMTSY=0 Q
  1. S LIM=$P(Y(1),U,4) I LIM'["=" G NOLIM
  1. S CREC=^GMT(142.1,GMTINX,0),SBS=GMTSEGI(GMTINX) D CMPLIM^GMTSADH2
  1. I $D(DIROUT) S GMTSQIT="" Q
  1. NOLIM ; No limits
  1. S GMTSEGN=GMTSEGI(GMTINX)-1,(GMTSY,GMTSQIT)=1,GMTSLPG=0
  1. Q
  1. ;
  1. EVAL ; Evaluate input to determine quit or continue
  1. Q:'$D(X)
  1. S:$D(GMTSEXIT) GMTSEXIT=$G(X)
  1. S:$D(DTOUT) DIROUT=1 I $S(X="^^":1,GMTSLPG:1,$D(DIROUT):1,X="^":1,1:0) S GMTSQIT=""
  1. I +$G(GMPSAP),(X="^") S GMDUOUT=1
  1. Q
  1. MUL(X) ; Multiple Components in Type
  1. N GMTSF,GMTSL S GMTSF=$O(GMTSEG(0)),GMTSL=$O(GMTSEG(" "),-1)
  1. Q:+GMTSF=+GMTSL 0 Q 1
  1. FST(X) ; First Component in Type
  1. N GMTSF,GMTSL S GMTSF=$O(GMTSEG(0)),GMTSL=+($G(GMTSEGN))
  1. Q:+GMTSF=+GMTSL 1 Q 0
  1. CHDR(X) ; Component Header
  1. N GMTSN,GMTSH,GMTSL,GMTS S GMTSN=$$CNAM,GMTSH=$G(GMTSEGH)
  1. S GMTSL=$G(GMTSEGL),GMTS="",$P(GMTS,"-",79-$L(GMTSH_GMTSL)/2)=""
  1. S X=GMTS_" "_GMTSH_GMTSL_" "_GMTS Q:'$D(GMTSOBJ) X
  1. S:$L(GMTSH)&($D(GMTSOBJ("COMPONENT HEADER"))) GMTSN=GMTSH
  1. S:$L(GMTSL)&($L(GMTSN))&($D(GMTSOBJ("LIMITS"))) GMTSN=GMTSN_" "_GMTSL
  1. S X=GMTSN Q X
  1. CNAM(X) ; Component Name
  1. N GMTSH S GMTSH=+($P($G(GMTSEG(+($G(GMTSEGN)))),"^",2))
  1. S X=$P($G(^GMT(142.1,+GMTSH,0)),"^",1) Q X
  1. LABEL ; Label
  1. Q:'$D(GMTSOBJ("USE LABEL")) N LABEL S LABEL=$G(GMTSOBJ("LABEL"))
  1. W !,LABEL W:$L(LABEL) ! W:$D(GMTSOBJ("LABEL BLANK LINE")) !
  1. Q
  1. LABDAT ; Label/Date
  1. Q:'$D(GMTSOBJ("USE LABEL")) N LABEL S LABEL=$G(GMTSOBJ("LABEL"))
  1. I '$D(GMTSOBJ("DATE LINE")),$D(GMTSOBJ("LABEL")),$L(LABEL),$L($G(GMTSDTM)) S LABEL=LABEL_$J("",((79-$L(GMTSDTM))-$L(LABEL)))_GMTSDTM
  1. I '$D(GMTSOBJ("DATE LINE")),$D(GMTSOBJ("LABEL")),'$L(LABEL),$L($G(GMTSDTM)) S LABEL="Information as of "_$G(GMTSDTM)
  1. W !,LABEL W:$L(LABEL) ! W:$D(GMTSOBJ("LABEL BLANK LINE")) !
  1. Q