1 | BSDX30 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; [ 09/12/2007 1:54 PM ]
|
---|
2 | ;;1.5V2;BSDX;;Mar 03, 2011
|
---|
3 | ;
|
---|
4 | ;
|
---|
5 | SPACED(BSDXY,BSDXDIC,BSDXVAL) ;EP
|
---|
6 | ;Entry point for debugging
|
---|
7 | ;
|
---|
8 | D DEBUG^%Serenji("SPACE^BSDX30(.BSDXY,BSDXDIC,BSDXVAL)")
|
---|
9 | Q
|
---|
10 | ;
|
---|
11 | SPACE(BSDXY,BSDXDIC,BSDXVAL) ;EP
|
---|
12 | ;Update ^DISV with most recent lookup value BSDXVAL from file BSDXDIC
|
---|
13 | ;BSDXDIC is the data global in the form GLOBAL(
|
---|
14 | ;BSDXVAL is the entry number (IEN) in the file
|
---|
15 | ;
|
---|
16 | ;Return Status = 1 if success, 0 if fail
|
---|
17 | ;
|
---|
18 | S BSDXY="^BSDXTMP("_$J_")"
|
---|
19 | N BSDX1,BSDXRES
|
---|
20 | S BSDXI=0
|
---|
21 | S X="ETRAP^BSDX30",@^%ZOSF("TRAP")
|
---|
22 | I (BSDXDIC="")!('+$G(BSDXVAL)) D ERR(BSDXI+1,99) Q
|
---|
23 | S BSDXDIC="^"_BSDXDIC
|
---|
24 | S ^BSDXTMP($J,0)="T00020ERRORID"_$C(30)
|
---|
25 | ;Note: Naked reference below is immediately preceded
|
---|
26 | ;by the full global reference per SAC 2.2.2.8
|
---|
27 | I $D(@(BSDXDIC_"BSDXVAL,0)")),'$D(^(-9)) D
|
---|
28 | . S ^DISV(DUZ,BSDXDIC)=BSDXVAL
|
---|
29 | . S BSDXRES=1
|
---|
30 | E S BSDXRES=0
|
---|
31 | S BSDXI=BSDXI+1
|
---|
32 | S ^BSDXTMP($J,BSDXI)=BSDXRES_$C(30)_$C(31)
|
---|
33 | Q
|
---|
34 | ;
|
---|
35 | ERR(BSDXI,BSDXERR) ;Error processing
|
---|
36 | S BSDXI=BSDXI+1
|
---|
37 | S ^BSDXTMP($J,BSDXI)=BSDXERR_$C(30)
|
---|
38 | S BSDXI=BSDXI+1
|
---|
39 | S ^BSDXTMP($J,BSDXI)=$C(31)
|
---|
40 | Q
|
---|
41 | ;
|
---|
42 | ETRAP ;EP Error trap entry
|
---|
43 | I '$D(BSDXI) N BSDXI S BSDXI=999
|
---|
44 | S BSDXI=BSDXI+1
|
---|
45 | D ERR(99,0)
|
---|
46 | Q
|
---|
47 | ;
|
---|
48 | EHRPTD(BSDXY,BSDXWID,BSDXDFN) ;
|
---|
49 | ;
|
---|
50 | D DEBUG^%Serenji("EHRPT^BSDX30(.BSDXY,BSDXWID,BSDXDFN)")
|
---|
51 | Q
|
---|
52 | ;
|
---|
53 | EHRPT(BSDXY,BSDXWID,BSDXDFN) ;
|
---|
54 | ;
|
---|
55 | ;Return Status = 1 if success, 0 if error
|
---|
56 | ;
|
---|
57 | S BSDXY="^BSDXTMP("_$J_")"
|
---|
58 | N BSDX1,BSDXRES
|
---|
59 | S BSDXI=0,BSDXRES=1
|
---|
60 | S X="ETRAP^BSDX30",@^%ZOSF("TRAP")
|
---|
61 | S ^BSDXTMP($J,0)="T00020ERRORID"_$C(30)
|
---|
62 | I '+BSDXDFN D ERR(BSDXI+1,0) Q
|
---|
63 | ;
|
---|
64 | D PEVENT(BSDXWID,BSDXDFN) ;Raise patient selected event
|
---|
65 | ;
|
---|
66 | S BSDXI=BSDXI+1
|
---|
67 | S ^BSDXTMP($J,BSDXI)=BSDXRES_$C(30)_$C(31)
|
---|
68 | Q
|
---|
69 | ;
|
---|
70 | PEVENT(BSDXWID,DFN) ;EP - Raise patient selection event to EHR
|
---|
71 | ;
|
---|
72 | ;Change patient context to patient DFN
|
---|
73 | ;on all EHR client sessions associated with user DUZ
|
---|
74 | ;and workstation BSDXWID.
|
---|
75 | ;
|
---|
76 | ;If BSDXWID is "", the context change is sent to
|
---|
77 | ;all EHR client sessions belonging to user DUZ.
|
---|
78 | ;
|
---|
79 | Q:'$G(DUZ)
|
---|
80 | ;N X
|
---|
81 | ;S X="CIANBUTL" X ^%ZOSF("TEST") Q:'$T
|
---|
82 | ;S X="CIANBEVT" X ^%ZOSF("TEST") Q:'$T
|
---|
83 | N UID,BRET
|
---|
84 | S BRET=0,UID=0
|
---|
85 | F S BRET=$$NXTUID^CIANBUTL(.UID,1) Q:'UID D
|
---|
86 | . Q:DUZ'=$$GETVAR^CIANBUTL("DUZ",,,UID)
|
---|
87 | . I BSDXWID'="" Q:BSDXWID'=$TR($$GETVAR^CIANBUTL("WID",,,UID),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
---|
88 | . D QUEUE^CIANBEVT("CONTEXT.PATIENT",+DFN,UID)
|
---|
89 | Q
|
---|