1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Text;
|
---|
4 |
|
---|
5 | namespace IndianHealthService.BMXNet.Model
|
---|
6 | {
|
---|
7 | /// <summary>
|
---|
8 | /// Context interface provides the current status and related events of the
|
---|
9 | /// patient/visit context within an application, or the EHR.
|
---|
10 | /// </summary>
|
---|
11 | /// <remarks>
|
---|
12 | /// Application developers use the WinFramework and ChangableContext to modify the context. Within
|
---|
13 | /// the EHR/VueCentric framework, the Context interface is a basic wrapper of some of the EHR facilties.
|
---|
14 | /// </remarks>
|
---|
15 | public interface Context
|
---|
16 | {
|
---|
17 |
|
---|
18 | /// <summary>
|
---|
19 | /// The most important aspect of the Context interface is the Changed event that allows
|
---|
20 | /// the receiver of the event know when the user is changing patient and visit. Applications
|
---|
21 | /// need to change the data displayed to represent the currnet Patient and optional visit. The
|
---|
22 | /// Changed event occurs after there is confirmation that the change has not been vetoed or the
|
---|
23 | /// veto has been overridden. See Changing event.
|
---|
24 | /// </summary>
|
---|
25 | /// <example>
|
---|
26 | /// Users of the Context object should hook the event ASAP. The
|
---|
27 | /// <code>
|
---|
28 | ///public void Startup()
|
---|
29 | /// {
|
---|
30 | /// if (this.Context != null)
|
---|
31 | /// {
|
---|
32 | /// this.Context.Changed += new EventHandler<ContextChangedArgs>(Context_Changed);
|
---|
33 | /// }
|
---|
34 | ///</code>
|
---|
35 | /// The context can be obtained if your control or component is a LocalSessionConsumer and if so then
|
---|
36 | /// define the Context property as follows:
|
---|
37 | /// <code>
|
---|
38 | /// public Context Context
|
---|
39 | /// {
|
---|
40 | /// get { return this.LocalSession == null ? null : this.LocalSession.Context; }
|
---|
41 | /// }
|
---|
42 | /// </code>
|
---|
43 | /// </example>
|
---|
44 | event EventHandler<ContextChangedArgs> Changed;
|
---|
45 | /// <summary>
|
---|
46 | /// When the current patient or visit is being changed by the user, every subscriber to the
|
---|
47 | /// Changing method has the option to "Veto" the event by Cancelling it:
|
---|
48 | /// <code>
|
---|
49 | ///public void Startup()
|
---|
50 | /// {
|
---|
51 | /// if (this.Context != null)
|
---|
52 | /// {
|
---|
53 | /// this.Context.Changed += new EventHandler<ContextChangedArgs>(Context_Changed);
|
---|
54 | /// this.Context.Changing += new EventHandler<ContextChangedArgs>(Context_Changing);
|
---|
55 | /// }
|
---|
56 | ///
|
---|
57 | /// void Context_Changing(object sender, ContextChangingArgs e)
|
---|
58 | /// {
|
---|
59 | /// e.Cancel = needToFinishSomethingElseBeforeChangingContext;
|
---|
60 | /// }
|
---|
61 | ///</code>
|
---|
62 | /// However, a Veto is like a U.S. presential Veto and that it can be overridden. The WinFramework
|
---|
63 | /// or EHR can override any Veto so all components (even if they veto changes) must be prepared to
|
---|
64 | /// have the context changed at anytime.
|
---|
65 | /// </summary>
|
---|
66 | event EventHandler<ContextChangingArgs> Changing;
|
---|
67 |
|
---|
68 | /// <summary>
|
---|
69 | /// The currently selected patient, or null. The value of the current patient is also in <seealso cref="ContextChangedArgs"/>.
|
---|
70 | /// The concept is that the context is set by external forces, ususally the user. Therefore there is no
|
---|
71 | /// way to set the patient here.
|
---|
72 | /// </summary>
|
---|
73 | /// <remarks>
|
---|
74 | /// Remember to refresh your user interface based on the new selection to the information your application displays
|
---|
75 | /// or edits is that same as the current context.
|
---|
76 | /// </remarks>
|
---|
77 | Patient Patient { get; }
|
---|
78 | /// <summary>
|
---|
79 | /// The currently selected visit, or null. The value of the current visit is also in ContextChangedArgs.
|
---|
80 | /// The concept is that the context is set by external forces, ususally the user. Therefore there is no
|
---|
81 | /// way to set the visit here.
|
---|
82 | /// </summary>
|
---|
83 | /// <remarks>
|
---|
84 | /// In the EHR, a visit stub can be created. A visit stub does not create a visit in RPMS until some data
|
---|
85 | /// is entered. IsVisit will return true for a visit stub but is it your responbilty to use HasUnlockedVisit or IsStub
|
---|
86 | /// on the Visit to make sure you have a visit to edit with.
|
---|
87 | /// Remember to refresh your user interface based on the new selection to the information your application displays
|
---|
88 | /// or edits is that same as the current context.
|
---|
89 | /// </remarks>
|
---|
90 | Visit Visit { get; }
|
---|
91 |
|
---|
92 | /// <summary>
|
---|
93 | /// Answer true/false if there is a patient currently selected. This is a convenience method.
|
---|
94 | /// </summary>
|
---|
95 | bool HasPatient { get; }
|
---|
96 | /// <summary>
|
---|
97 | /// Answer true/false if there is a patient currently selected. This is a convenience method.
|
---|
98 | /// </summary>
|
---|
99 | bool HasVisit { get; }
|
---|
100 | /// <summary>
|
---|
101 | /// Answer true if there is a visit and if it is unlocked. The EHR/VueCentric has a notion of the
|
---|
102 | /// locked visit, a visit that can no longer be visited. The EHR/VueCetnric has has a visit stub, a visit that
|
---|
103 | /// has been create on the desktop but not in RPMS. If a visit is a visit stub, it is not considered unlocked.
|
---|
104 | /// </summary>
|
---|
105 | bool HasUnlockedVisit { get; }
|
---|
106 |
|
---|
107 | /// <summary>
|
---|
108 | /// The user that established the connection to BMX either through the WinFramework dialogs or access/verify codes, or
|
---|
109 | /// a user established through attach tho the EHR/VueCentric with the EhrFramework.
|
---|
110 | /// </summary>
|
---|
111 | User User { get; }
|
---|
112 | }
|
---|
113 | }
|
---|