source: Scheduling/trunk/m/BSDX30.m@ 1450

Last change on this file since 1450 was 1187, checked in by Sam Habiel, 14 years ago

Changes to BSDX01 to prevent Scheduled,dc'ed,completed radiology appointments from being cancelled. Updated files to T2.

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