source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORB3U2.m@ 1437

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

initial load of WorldVistAEHR

File size: 6.2 KB
Line 
1ORB3U2 ; slc/CLA - OE/RR 3 Notifications Utilities routine two ;5/19/97 11:07 [ 04/02/97 2:09 PM ]
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**9,74,105,179**;Dec 17, 1997
3 Q
4USRNOTS(ORBUSR) ; generate a list of notifs indicating user's recip status
5 I +$G(ORBUSR)<1 S ORBUSR=DUZ
6 N ORY,ORYI,ORBY,ORBIEN,ORBNAM,NODE,ORX,DESC,HDR,ORBENT,ORDIV,ORZ
7 ;
8 ;get ORBUSR's Division:
9 I $$DIV4^XUSER(.ORZ,ORBUSR) D
10 .S ORDIV=0,ORDIV=$O(ORZ(ORDIV))
11 .I +$G(ORDIV)>0 S ORBENT=ORDIV_";DIC(4,^SYS^PKG"
12 I '$L($G(ORBENT)) S ORBENT="SYS^PKG"
13 ;
14 S ORYI=1
15 ;
16 ;prompt for additional information:
17 W !!,"Would you like help understanding the list of notifications" S %=2 D YN^DICN I %=1 D HLPMSG
18 K %
19 ;
20 ;see if notification system is disabled:
21 S ORX=$$GET^XPAR(ORBENT,"ORB SYSTEM ENABLE/DISABLE",1,"I")
22 I ORX="D" D
23 .S ORY(ORYI)="Notifications is disabled. No notifications will be processed or delivered."
24 .S DESC="Notification possibilities for a user"
25 .S NODE=$G(^VA(200,ORBUSR,0)) S:$L($G(NODE)) HDR="Notification List for "_$P(NODE,U)
26 .D OUTPUT(.ORY,DESC,HDR)
27 Q:ORX="D"
28 ;
29 W !!,"This will take a moment or two, please stand by."
30 ;
31 S ORY(ORYI)="Notification ON/OFF For This User and Why",ORYI=ORYI+1
32 S ORY(ORYI)="-------------------------------- ---------------------------------------------",ORYI=ORYI+1
33 ;
34 ;loop thru all notifications and determine recipient status:
35 S ORBNAM="" F S ORBNAM=$O(^ORD(100.9,"B",ORBNAM)) Q:ORBNAM="" D
36 .S ORBIEN=0,ORBIEN=$O(^ORD(100.9,"B",ORBNAM,ORBIEN)) I +$G(ORBIEN)>0 D
37 ..S ORBY(ORBNAM)=ORBIEN
38 ..S ORX=$$ONOFF^ORB3USER(ORBIEN,ORBUSR,"","") I $L($G(ORX)) D
39 ...W "."
40 ...S ORBNAM=$E(ORBNAM_" ",1,32)
41 ...S ORY(ORYI)=ORBNAM_" "_$E($P(ORX,U)_" ",1,5)_$P(ORX,U,3),ORYI=ORYI+1
42 ;
43 S ORYI=ORYI+1,ORY(ORYI)="",ORYI=ORYI+1,ORY(ORYI)="",ORYI=ORYI+1
44 S DESC="Notification possibilities for a user"
45 S NODE=$G(^VA(200,ORBUSR,0)) S:$L($G(NODE)) HDR="Notification List for "_$P(NODE,U)
46 D OUTPUT(.ORY,DESC,HDR)
47 Q
48HLPMSG ;display/print help message for a user's notifications
49 N ORY,ORYI
50 S ORYI=1
51 S ORY(ORYI)="The delivery of notifications as alerts is determined from values set for:",ORYI=ORYI+1
52 S ORY(ORYI)="Users, OE/RR Teams, Service/Sections, Inpatient Locations,",ORYI=ORYI+1
53 S ORY(ORYI)="Hospital Divisions, Computer System and Order Entry/Results Reporting.",ORYI=ORYI+1
54 S ORY(ORYI)="Possible values include 'Enabled', 'Disabled' and 'Mandatory'. These values",ORYI=ORYI+1
55 S ORY(ORYI)="indicate a User's, OE/RR Team's, Service's, Location's, Division's, System's",ORYI=ORYI+1
56 S ORY(ORYI)="and OERR's desire for the notification to be 'Enabled' (sent under most",ORYI=ORYI+1
57 S ORY(ORYI)="conditions), 'Disabled' (not sent), or 'Mandatory' (almost always sent.)",ORYI=ORYI+1
58 S ORY(ORYI)="",ORYI=ORYI+1
59 S ORY(ORYI)="All values, except the OERR (Order Entry) value, can be set by IRM",ORYI=ORYI+1
60 S ORY(ORYI)="or Clinical Coordinators. Individual users can set 'Enabled/Disabled/Mandatory'",ORYI=ORYI+1
61 S ORY(ORYI)="values for each specific notification via the 'Enable/Disable My Notifications'",ORYI=ORYI+1
62 S ORY(ORYI)="option under the Personal Preferences and Notification Mgmt Menu option menus.",ORYI=ORYI+1
63 S ORY(ORYI)="'ON' indicates the user will receive the notification under normal conditions.",ORYI=ORYI+1
64 S ORY(ORYI)="'OFF' indicates the user normally will not receive the notification.",ORYI=ORYI+1
65 S ORY(ORYI)="Notification recipient determination can also be influenced by patient",ORYI=ORYI+1
66 S ORY(ORYI)="location (inpatients only.) This list does not consider patient location",ORYI=ORYI+1
67 S ORY(ORYI)="when calculating the ON/OFF value for a notification.",ORYI=ORYI+1
68 S ORY(ORYI)="",ORYI=ORYI+1,ORY(ORYI)="",ORYI=ORYI+1
69 S DESC="Help Message - notification possibilities for a user"
70 S HDR="Notification List Help Message"
71 D OUTPUT(.ORY,DESC,HDR)
72 Q
73OUTPUT(ORY,ORBDESC,ORBHDR) ;prompt for device and send report
74 N POP
75 ;prompt for device:
76 S %ZIS="Q" ;prompt for Queueing
77 D ^%ZIS
78 Q:$G(POP)>0
79 I $D(IO("Q")) D ;queue the report
80 .S ZTRTN="PRINT^ORB3U1"
81 .S ZTSAVE("ORY(")="",ZTSAVE("ORBHDR")=""
82 .S ZTDESC=ORBDESC
83 .D ^%ZTLOAD
84 .K ZTRTN,ZTSAVE,ZTDESC
85 .I $D(ZTSK)[0 W !!?5,"Report canceled!"
86 .E W !!?5,"Report queued."
87 .D HOME^%ZIS
88 K %ZIS
89 I $D(IO("Q")) K IO("Q") Q
90PRINT ;print body of List User's Notifications Report
91 N END,PAGE,I,X
92 S (END,PAGE,I)=0
93 U IO
94 D @("HDR"_(2-($E(IOST,1,2)="C-")))
95 F S I=$O(ORY(I)) Q:I=""!(END=1) D
96 .D HDR:$Y+5>IOSL
97 .Q:END=1
98 .W !,ORY(I)
99 I END=1 W !!," - Report Interrupted -",!
100 E W " - End of Report -",!
101 I ($E(IOST,1,2)="C-") W !,"Press RETURN to continue: " R X:DTIME
102 D ^%ZISC
103 D:$G(ZTSK) KILL^%ZTLOAD
104 Q
105HDR ;print header of report
106 I PAGE,($E(IOST,1,2)="C-") D
107 .W !,"Press RETURN to continue or '^' to exit: "
108 .R X:DTIME S END='$T!(X="^")
109 Q:END=1
110HDR1 W:'($E(IOST,1,2)='"C-"&'PAGE) @IOF
111HDR2 S PAGE=PAGE+1 W ?20,ORBHDR
112 W ?(IOM-10),"Page: ",$J(PAGE,3),!!
113 Q
114LABTHR(ORBADUZ,ORBDFN,ORNUM) ;returns Lab Threshold notif recipients
115 ;ORBADUZ: array of notif recipients
116 ;ORBDFN: patient identifier
117 ;ORNUM: order number (may or may not exist)
118 ;
119 N ORNUMOI,ORLAB,ORSPEC,ORY,ORI,ORSLT,ORLABSP,OROP,ORX,ORERR,ORPENT,ORPVAL
120 ;
121 I '$L($G(ORNUM)) D ;prompt for order number
122 .K DIR S DIR(0)="NAO^::2",DIR("A")="ORDER NUMBER: "
123 .S DIR("?",1)="The Lab Threshold Exceeded notification uses lab order results to determine"
124 .S DIR("?",2)="alert recipients. Enter the order number associated with the lab result."
125 .S DIR("?",3)="Order number must be entered as a whole number (e.g. 458829)."
126 .;
127 .S DIR("?")=" "
128 .D ^DIR
129 .S ORNUM=+Y
130 Q:$D(DUOUT)
131 K DIR,Y,X,DTOUT,DUOUT,DIRUT
132 ;
133 Q:+$G(ORNUM)<1
134 S ORNUMOI=$$OI^ORQOR2(ORNUM)
135 Q:+$G(ORNUMOI)<1
136 S ORLAB=+$P(^ORD(101.43,ORNUMOI,0),U,2)
137 S ORSPEC=$$VALUE^ORCSAVE2(ORNUM,"SPECIMEN")
138 D ORDER^ORQQLR(.ORY,ORBDFN,ORNUM)
139 Q:'$D(ORY) ;quit if no results found
140 S ORI=0 F S ORI=$O(ORY(ORI)) Q:+$G(ORI)<1 D
141 .I ORLAB=$P(ORY(ORI),U) S ORSLT=$P(ORY(ORI),U,3)
142 Q:+$G(ORSLT)=0 ;quit if result is non-numeric or null
143 ;
144 S ORLABSP=ORLAB_";"_ORSPEC
145 F OROP="<",">" D
146 .D ENVAL^XPAR(.ORX,"ORB LAB "_OROP_" THRESHOLD",ORLABSP,.ORERR)
147 .Q:+$G(ORERR)'=0
148 .Q:+$G(ORX)=0
149 .S ORPENT="" F S ORPENT=$O(ORX(ORPENT)) Q:'ORPENT D
150 ..S ORPVAL=ORX(ORPENT,ORLABSP)
151 ..I $L(ORPVAL) D
152 ...I $P(ORPENT,";",2)="VA(200,",@(ORSLT_OROP_ORPVAL) D
153 ....S ORBADUZ(+ORPENT)=""
154 Q
Note: See TracBrowser for help on using the repository browser.