source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSXAD.m@ 841

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

initial load of WorldVistAEHR

File size: 5.5 KB
Line 
1GMTSXAD ; SLC/KER - List Parameters/Display ; 02/27/2002
2 ;;2.7;Health Summary;**47,49**;Oct 20, 1995
3 Q
4 ;
5 ; External References in GMTSXAD
6 ; DBIA 10026 ^DIR
7 ; DBIA 10063 ^%ZTLOAD
8 ; DBIA 10086 ^%ZIS
9 ; DBIA 10086 HOME^%ZIS
10 ; DBIA 10089 ^%ZISC
11 ; DBIA 10103 $$FMTE^XLFDT
12 ; DBIA 10103 $$NOW^XLFDT
13 ; DBIA 10112 $$SITE^VASITE
14 ;
15EN ; Main Entry Point
16 D EN2(+($G(DUZ))) Q
17EN2(X) ; Entry for User
18 K ^TMP("GMTSXAD",$J) N GMTSENV,ZTRTN,GMTSNM S ZTRTN="RPT^GMTSXAD",GMTSENV=$$ENV Q:+GMTSENV=0
19 N GMTSUSR S GMTSUSR=+($G(X)) S GMTSNM=$$UNM^GMTSXAW3(+($G(GMTSUSR))) Q:'$L(GMTSNM)
20 W !!,"Display user default Health Summary Type list for ",GMTSNM
21 D PRE,CPL,LIST,DISP
22 Q
23EN3 ; Entry for Site Parameters
24 K ^TMP("GMTSXAD",$J) N GMTSENV,ZTRTN,GMTSNM S ZTRTN="RPT^GMTSXAD",GMTSENV=$$ENV Q:+GMTSENV=0
25 N GMTSUSR S GMTSUSR=.5 S GMTSNM=$P($$SITE^VASITE,"^",2) Q:'$L(GMTSNM)
26 W !!,"Display default Health Summary Type list for ",GMTSNM
27 D PRE,CPL,DISP
28 Q
29 ;
30 ; Report
31PRE ; Precedence
32 N GMTSPRE,GMTSM S GMTSPRE=$$PRE^GMTSXAL(GMTSUSR)
33 S:+($G(GMTSUSR))=.5 GMTSPRE=$$DEF^GMTSXAW
34 S:(+($G(GMTSUSR))=.5)&('$L(GMTSPRE)) GMTSPRE=$$PRE^GMTSXAL(.5)
35 S GMTSM=$L(GMTSPRE,";")
36 Q:'$L(GMTSPRE) N GMTSI,GMTSE,GMTST,GMTSA,GMTSN,GMTSP,GMTSH,GMTSC,GMTSALW D EN^GMTSXAW
37 S (GMTSC,GMTSI)=0 F GMTSI=1:1 Q:$P(GMTSPRE,";",GMTSI)="" D
38 . S GMTSA=$P(GMTSPRE,";",GMTSI) Q:'$L(GMTSA) S GMTSE=$O(GMTSALW("B",GMTSA,0))
39 . S GMTST=$P($G(GMTSALW("B",GMTSA,+GMTSE)),"^",4) Q:GMTSA'="NAT"&('$L(GMTST))
40 . S GMTST=$S(GMTSA="USR":(GMTST_" preferences"),GMTSA="NAT":"National Health Summary Types",1:(GMTST_" defined"))
41 . S GMTSC=GMTSC+1 D:GMTSC=1 PRE2 D TL((" "_GMTSC_" "_GMTST))
42 Q
43PRE2 ; Precedence Title
44 D TL(" Precedence of Parameters: "),AL($G(GMTSPRE)),BL Q
45CPL ; Compile Method
46 D EN3^GMTSXAC Q
47LIST ; Health Summary Types List
48 N GMTS,GMTSALW D GETILIST^GMTSXAL(.GMTS,GMTSUSR),EN^GMTSXAW
49 N GMTS1,GMTS2,GMTST,GMTSA,GMTSI,GMTSN,GMTSEN,GMTSC,GMTSS S GMTSC=0 F Q:$L($G(GMTSS))>29 S GMTSS=$G(GMTSS)_" "
50 S GMTS1=0 F S GMTS1=$O(GMTS("AB",GMTS1)) Q:+GMTS1=0 D
51 . S GMTS2=0 F S GMTS2=$O(GMTS("AB",GMTS1,GMTS2)) Q:+GMTS2=0 D
52 . . S GMTSA=$P($G(GMTS("AB",GMTS1,GMTS2)),"^",1) Q:'$L(GMTSA)
53 . . S GMTSI=+($P($G(GMTS("AB",GMTS1,GMTS2)),"^",2)) Q:+GMTSI'>0
54 . . S GMTSN=$$UP^GMTSXA($P($G(GMTS("AB",GMTS1,GMTS2)),"^",3)) Q:'$L(GMTSN)
55 . . S GMTSEN=+($O(GMTSALW("B",GMTSA,0))) Q:+GMTSEN'>0&(GMTSA'="NAT")
56 . . S GMTSEN=$P($G(GMTSALW("B",GMTSA,GMTSEN)),"^",4) Q:'$L(GMTSEN)&(GMTSA'="NAT")
57 . . S GMTSEN=GMTSEN_" defined types" S:GMTSA="NAT" GMTSEN="National types" S GMTSC=GMTSC+1 S GMTSEN=" "_GMTSEN F Q:$L(GMTSEN)>29 S GMTSEN=GMTSEN_" "
58 . . D:GMTSC=1 LIST2
59 . . D TL($S(+GMTS2=1:GMTSEN,1:GMTSS))
60 . . D AL(($J(GMTSC,2)_" "_GMTSN))
61 Q
62LIST2 ; List Title
63 D TL(" The CPRS Reports Tab will list the following Health Summary Types:"),BL Q
64 ;
65DISP ; Display Report
66 I '$L($G(ZTRTN)) K ^TMP("GMTSXAD",$J) Q
67 N POP D DEV,HOME^%ZIS Q
68DEV ; Device for Display
69 W ! N %ZIS,IOP S %ZIS="PQ" D ^%ZIS Q:POP I $D(IO("Q")) D QUE Q
70NOQUE ; Do not Queue Report
71 W:IOST["C-" @IOF D @ZTRTN,^%ZISC Q
72QUE ; Queue Report
73 N %,ZTDESC,ZTDTH,ZTIO,ZTSAVE,ZTSK I '$D(ZTRTN) K ^TMP("GMTSXAD",$J) Q
74 K IO("Q"),ZTSAVE S ZTSAVE("^TMP(""GMTSXAD"",$J,")=""
75 S ZTDESC="Health Summary Types List User Defaults",ZTIO=$G(ION),ZTDTH=$H
76 D ^%ZTLOAD I $D(ZTSK) W !!,"Request queued",! H 3 W @IOF
77 I '$D(ZTSK) W !!,"Request not queued",! H 3 W @IOF
78 K ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE D ^%ZISC Q
79 ;
80RPT ; Report
81 W ! Q:'$D(^TMP("GMTSXAD",$J))
82 N GMTSHDR,GMTSLC,GMTSI,GMTST,GMTSEXIT S (GMTSI,GMTSLC)=0 D HDRP
83 F S GMTSI=$O(^TMP("GMTSXAD",$J,GMTSI)) Q:+($G(GMTSEXIT))>0 Q:+GMTSI=0 D Q:+($G(GMTSEXIT))>0
84 . S GMTST=$G(^TMP("GMTSXAD",$J,GMTSI,0)),GMTSLC=GMTSLC+1 W !,GMTST
85 . D:$G(IOST)["C-"&(GMTSLC>(+($G(IOSL))-4)) CONT
86 . K:+($G(GMTSEXIT))>0 ^TMP("GMTSXAD",$J)
87 W:$G(IOST)["P-"&($L($G(IOF))) @IOF
88 K ^TMP("GMTSXAD",$J)
89 Q
90CONT ; Page Break/Continue Report
91 I $G(IOST)["P-" W:$L($G(IOF)) @IOF S GMTSLC=0 D HDRP Q
92 N GMTSCONT S GMTSCONT="" I $G(IOST)["C-" S GMTSCONT=$$PG W:$L($G(IOF)) @IOF W:'$L($G(IOF)) !! S GMTSLC=0 D HDRP
93 S:GMTSCONT["^" GMTSEXIT=1
94 Q
95PG(X) ; Page Break
96 N DIR,DTOUT,DIRUT,DIROUT,DUOUT S DIR(0)="EA",DIR("A")=" Press <Return> to continue ",(DIR("?"),DIR("??"))="^W !,"" Enter either <Return> or '^'"""
97 W ! D ^DIR S X=$S((+($G(DTOUT))+($G(DUOUT))+($G(DIRUT)))>0:"^",1:"") Q X
98HDRP ; Page/Report Header
99 N GMTSS,GMTS1,GMTS2,GMTS3,GMTSL
100 S GMTSS=$P($$SITE^VASITE,"^",2)
101 S GMTS1=" Health Summary Types list for CPRS Reports Tab"
102 S:(+($G(GMTSUSR))=.5)&($L(GMTSS)) GMTS1=" "_GMTSS_" Defaults for CPRS Reports Tab"
103 S:+($G(GMTSHDR))>0 GMTS1=GMTS1_" <continued> "
104 S GMTS2=$$UP^GMTSXA($P($$FMTE^XLFDT($$NOW^XLFDT,"ZM"),"@",1)) F Q:$L(GMTS1)'<(78-$L(GMTS2)) S GMTS1=GMTS1_" "
105 S GMTS1=GMTS1_GMTS2 S GMTSL=" -" F Q:$L(GMTSL)'<$L(GMTS1) S GMTSL=GMTSL_"-"
106 W !,GMTS1,!,GMTSL,! S GMTSLC=+($G(GMTSLC))+3
107 Q
108 ;
109 ; Miscellaneous
110ENV(X) ; Environment check
111 D HOME^%ZIS Q:'$L($$UNM^GMTSXAW3(+($G(DUZ)))) 0
112 Q 1
113 ; Add Report Lines
114BL ; Blank Line
115 D TL("") Q
116TL(X) ; Text Line
117 N GMTSC S X=$G(X),GMTSC=+($G(^TMP("GMTSXAD",$J,0))),GMTSC=GMTSC+1,^TMP("GMTSXAD",$J,GMTSC,0)=X,^TMP("GMTSXAD",$J,0)=GMTSC Q
118AL(X) ; Append Line
119 N GMTSC S X=$G(X),GMTSC=+($G(^TMP("GMTSXAD",$J,0))),^TMP("GMTSXAD",$J,GMTSC,0)=$G(^TMP("GMTSXAD",$J,GMTSC,0))_X,^TMP("GMTSXAD",$J,0)=GMTSC Q
Note: See TracBrowser for help on using the repository browser.