source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORWGAPIP.m@ 1361

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

revised back to 6/30/08 version

File size: 6.2 KB
RevLine 
[623]1ORWGAPIP ; SLC/STAFF - Graph Parameters ;11/20/06 08:59
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**215,260**;Dec 17, 1997;Build 26
3 ;
4DATES(DAT,REPORTID) ; from ORWGAPI
5 N BEGIN,END,INFO,NEXT,PARAM1,PARAM2,RPT,START,STOP
6 S RPT=+$O(^ORD(101.24,"AC",+$G(REPORTID),0))
7 I 'RPT Q ; RPT=1150 is exported graph report
8 S PARAM1=$P($G(^ORD(101.24,RPT,2)),U)
9 S PARAM2=$P($G(^ORD(101.24,RPT,2)),U,2)
10 S INFO=$$XGET^ORWGAPIX("ALL","ORWRP TIME/OCC LIMITS INDV",RPT,"I")
11 S BEGIN=$P(INFO,";"),START=$$DATE^ORWGAPIX(BEGIN)
12 S END=$P(INFO,";",2),STOP=$$DATE^ORWGAPIX(END)
13 I START<1 Q
14 I STOP<1 Q
15 S NEXT=1+$O(DAT(""),-1)
16 S DAT(NEXT)=U_BEGIN_" to "_END_"^^^"_INFO_U_START_U_STOP_U_PARAM1_U_PARAM2
17 Q
18 ;
19DELVIEWS(DATA,NAME,PUBLIC) ; from ORWGAPI
20 N ERR,TMP
21 D RETURN^ORWGAPIU(.TMP,.DATA)
22 S ERR=0
23 I '$L(NAME) S ERR=1
24 I 'ERR D
25 . S NAME=$$UP^ORWGAPIX(NAME)
26 . I PUBLIC D XDEL^ORWGAPIX("SYS","ORWG GRAPH VIEW",NAME,.ERR)
27 . I 'PUBLIC D XDEL^ORWGAPIX("USR","ORWG GRAPH VIEW",NAME,.ERR)
28 I TMP S ^TMP(DATA,$J)=ERR,^TMP(DATA,$J,1)=ERR
29 I 'TMP S DATA=ERR,DATA(1)=ERR
30 Q
31 ;
32GETPREF(DATA) ; from ORWGAPI
33 N CNT,NUM,PROF,RESULT,TMP,VAL K PROF
34 I '$O(^PXRMINDX(63,"PI","")) Q ; graphing is not used if no indexes
35 S VAL=$$XGET^ORWGAPIX("PKG","ORWG GRAPH SETTING",1,"I")
36 I '$L(VAL) Q ; graphing not used if no pkg param on settings
37 D RETURN^ORWGAPIU(.TMP,.DATA)
38 S VAL=$$XGET^ORWGAPIX("DIV^SYS^PKG","ORWG GRAPH SETTING",1,"I")
39 S PROF(1)=VAL
40 S VAL=$$XGET^ORWGAPIX("ALL","ORWG GRAPH SETTING",1,"I")
41 S PROF(0)=VAL
42 S CNT=0
43 S NUM=""
44 F S NUM=$O(PROF(NUM)) Q:NUM="" D
45 . S RESULT=$G(PROF(NUM))
46 . D SETUP^ORWGAPIU(.DATA,RESULT,TMP,.CNT)
47 Q
48 ;
49GETSIZE(DATA) ; from ORWGAPI
50 N CNT,NUM,PROF,RESULT,TMP K PROF
51 D RETURN^ORWGAPIU(.TMP,.DATA)
52 D XGETLST^ORWGAPIX(.PROF,"USR","ORWG GRAPH SIZING")
53 S CNT=0
54 S NUM=""
55 F S NUM=$O(PROF(NUM)) Q:NUM="" D
56 . S RESULT=$G(PROF(NUM))
57 . D SETUP^ORWGAPIU(.DATA,RESULT,TMP,.CNT)
58 Q
59 ;
60GETVIEWS(DATA,ALL,PUBLIC,EXT) ; from ORWGAPI
61 N CNT,FIRST,NUM,PIECE,PROF,RESULT,RESULT1,SECOND,TMP,VALUE K PROF
62 D RETURN^ORWGAPIU(.TMP,.DATA)
63 I PUBLIC D
64 . I ALL=1 D XGETLST^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW") ; get list of public views
65 . I ALL'=1 D XGETWP^ORWGAPIX(.PROF,"SYS","ORWG GRAPH VIEW",ALL) ; get a public view definition
66 I 'PUBLIC D
67 . I ALL=1 D XGETLST^ORWGAPIX(.PROF,"USR","ORWG GRAPH VIEW") ; get list of personal views
68 . I ALL'=1 D XGETWP^ORWGAPIX(.PROF,"USR","ORWG GRAPH VIEW",ALL) ; get a personal view definition
69 S CNT=0
70 I 'EXT D Q
71 . S NUM=""
72 . F S NUM=$O(PROF(NUM)) Q:NUM="" D
73 .. I ALL=1 S RESULT=$P($G(PROF(NUM)),U)
74 .. I ALL'=1 S RESULT=$G(PROF(NUM,0))
75 .. D SETUP^ORWGAPIU(.DATA,RESULT,TMP,.CNT)
76 S NUM=""
77 F S NUM=$O(PROF(NUM)) Q:NUM="" D
78 . S RESULT=$G(PROF(NUM,0))
79 . S PIECE=0
80 . F S PIECE=PIECE+1 S VALUE=$P(RESULT,"|",PIECE) D:$L(VALUE) Q:'$L($P(RESULT,"|",PIECE+1,999))
81 .. S FIRST=$P(VALUE,"~"),SECOND=$P(VALUE,"~",2)
82 .. I FIRST=0 S CNT=CNT+1,RESULT1="0^"_SECOND_U_$$FILENAME^ORWGAPIT(SECOND)_" <any>"
83 .. I FIRST'=0 S CNT=CNT+1,RESULT1=FIRST_U_SECOND_U_$$EVALUE^ORWGAPIU(SECOND,FIRST)
84 .. D SETUP^ORWGAPIU(.DATA,RESULT1,TMP,.CNT)
85 Q
86 ;
87INISET ; from ORWGAPIU initial setup of package parameters
88 N ERR,RPTNUM
89 S RPTNUM=1150
90 D SETPREF(.ERR,"63;53.79;55;55NVA;52;70;120.5|BCEFGHIK|1|4|90||100||",9) ; default public settings
91 I '$D(^ORD(101.24,RPTNUM,0)) D ; make sure report has been added
92 . L +^ORD(101.24,0):20 I '$T Q
93 . S $P(^ORD(101.24,0),U,3)=RPTNUM,$P(^(0),U,4)=$P(^(0),U,4)+1
94 . S ^ORD(101.24,RPTNUM,0)="ORWG GRAPHING^OR_GRAPHS^^2^^^1^R^^^^G^^T"
95 . S ^ORD(101.24,RPTNUM,2)="^^Graphing (local only)^Graphing"
96 . L -^ORD(101.24,0)
97 . D INDEX^ORWGAPIX("^ORD(101.24,",RPTNUM)
98 D XEN^ORWGAPIX("PKG","ORWRP REPORT LIST",12,RPTNUM)
99 D XVIEWS ; *****
100 Q
101 ;
102PUBLIC(USER) ; from ORWGAPI
103 N ERR,IDX,ORSRV,USRCLASS,VAL K USRCLASS
104 S VAL=0
105 I '$G(USER) Q VAL
106 S ORSRV=$$GET1^DIQ(200,DUZ,29,"I")
107 D XGETLST1^ORWGAPIX(.USRCLASS,"SYS","ORWG GRAPH PUBLIC EDITOR CLASS","Q",.ERR)
108 I ERR Q VAL
109 S IDX=0
110 F S IDX=$O(USRCLASS(IDX)) Q:'IDX D Q:VAL
111 . I $$ISA^ORWGAPIA(USER,$P(USRCLASS(IDX),U,2),.ERR) S VAL=1
112 Q VAL
113 ;
114RPTPARAM(IEN) ; from ORWGAPI
115 N NODE,VAL
116 S VAL=""
117 S NODE=$$UP^XLFSTR($P($G(^ORD(101.24,+$G(IEN),2)),U,1,2))
118 I $L(NODE)<2 Q VAL
119 Q NODE
120 ;
121SETPREF(DATA,VAL,PUBLIC) ; from ORWGAPI
122 N ERR,TMP
123 D RETURN^ORWGAPIU(.TMP,.DATA)
124 S ERR=0
125 I '$L(VAL) S ERR=1
126 I 'ERR D
127 . S VAL=$$UP^ORWGAPIX(VAL)
128 . I PUBLIC=9 D XEN^ORWGAPIX("PKG","ORWG GRAPH SETTING",1,VAL,.ERR) ; only on postinit
129 . I PUBLIC D XEN^ORWGAPIX("SYS","ORWG GRAPH SETTING",1,VAL,.ERR)
130 . I 'PUBLIC D XEN^ORWGAPIX("USR","ORWG GRAPH SETTING",1,VAL,.ERR)
131 I TMP S ^TMP(DATA,$J)=ERR,^TMP(DATA,$J,1)=ERR
132 I 'TMP S DATA=ERR,DATA(1)=ERR
133 Q
134 ;
135SETSIZE(DATA,VAL) ; from ORWGAPI
136 N ERR,NAME,NUM,VALUE,VALUES,TMP
137 D RETURN^ORWGAPIU(.TMP,.DATA)
138 S ERR=0
139 I '$L($O(VAL(0))) S ERR=1
140 I 'ERR D
141 . S NUM=0
142 . F S NUM=$O(VAL(NUM)) Q:NUM<1 D Q:ERR
143 .. S VALUES=VAL(NUM)
144 .. S VALUES=$$UP^ORWGAPIX(VALUES)
145 .. S NAME=$P(VALUES,U)
146 .. S VALUE=$P(VALUES,U,2)
147 .. D XEN^ORWGAPIX("USR","ORWG GRAPH SIZING",NAME,VALUE,.ERR)
148 I TMP S ^TMP(DATA,$J)=ERR,^TMP(DATA,$J,1)=ERR
149 I 'TMP S DATA=ERR,DATA(1)=ERR
150 Q
151 ;
152SETVIEWS(DATA,NAME,PUBLIC,VAL) ; from ORWGAPI
153 N ERR,TMP
154 D RETURN^ORWGAPIU(.TMP,.DATA)
155 S ERR=0
156 I '$L(NAME) S ERR=1
157 I '$L($O(VAL(""))) S ERR=1
158 I 'ERR D
159 . S NAME=$$UP^ORWGAPIX(NAME)
160 . S VAL=NAME
161 . I PUBLIC D XEN^ORWGAPIX("SYS","ORWG GRAPH VIEW",NAME,.VAL,.ERR)
162 . I 'PUBLIC D XEN^ORWGAPIX("USR","ORWG GRAPH VIEW",NAME,.VAL,.ERR)
163 I TMP S ^TMP(DATA,$J)=ERR,^TMP(DATA,$J,1)=ERR
164 I 'TMP S DATA=ERR,DATA(1)=ERR
165 Q
166 ;
167XVIEWS ; conversion on v26t41 *****
168 N CNT,DATA,ERR,NAME,NUM,NUM1,SYSNAME,VIEWS,VIEWDEF,VIEWDIV
169 K DATA,SYSNAME,VIEWS,VIEWDEF,VIEWDIV
170 D XGETLST^ORWGAPIX(.VIEWS,"SYS","ORWG GRAPH VIEW")
171 S NUM=0
172 F S NUM=$O(VIEWS(NUM)) Q:NUM<1 D
173 . S NAME=$P(VIEWS(NUM),U)
174 . I NAME="" Q
175 . S SYSNAME(NAME)=""
176 K VIEWS
177 D XGETLST^ORWGAPIX(.VIEWS,"DIV","ORWG GRAPH VIEW")
178 S NUM=0
179 F S NUM=$O(VIEWS(NUM)) Q:NUM<1 D
180 . S NAME=$P(VIEWS(NUM),U)
181 . I NAME="" Q
182 . I '$D(SYSNAME(NAME)) D
183 .. K VIEWDEF,VIEWDIV
184 .. D XGETWP^ORWGAPIX(.VIEWDIV,"DIV","ORWG GRAPH VIEW",NAME)
185 .. S CNT=0
186 .. S NUM1=""
187 .. F S NUM1=$O(VIEWDIV(NUM1)) Q:NUM1="" D
188 ... S CNT=CNT+1
189 ... S VIEWDEF(CNT)=$G(VIEWDIV(NUM1,0))
190 .. D SETVIEWS^ORWGAPIP(.DATA,NAME,1,.VIEWDEF)
191 . D XDEL^ORWGAPIX("DIV","ORWG GRAPH VIEW",NAME,.ERR)
192 Q
193 ;
Note: See TracBrowser for help on using the repository browser.