source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/IndianHealthService.BMXNet.EHR/BMXNetEhrSessionConnection.cs@ 1172

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

Initial Import of BMX4

File size: 2.3 KB
RevLine 
[1146]1using System;
2using System.Collections.Generic;
3using System.Text;
4using CIA_CSS;
5using CSS_User;
6
7namespace IndianHealthService.BMXNet.EHR
8{
9 internal class BMXNetEhrSessionConnection : BMXNetSessionConnection
10 {
11
12 public override int SendTimeout
13 {
14 get { return 60000; }
15 set { }
16 }
17
18 public override int ReceiveTimeout
19 {
20 get { return 60000; }
21 set { }
22 }
23
24
25 public BMXNetEhrSessionConnection(BMXNetBroker aBroker):base(aBroker)
26 {
27 }
28
29
30 public override void Close()
31 {
32 //Don't close the EHR's internal broker
33 this.CiaSession = null;
34 }
35
36 public override bool IsConnected
37 {
38 get { return this.CiaSession != null; }
39 }
40
41 public override string GetLoginFacility(string aDuz)
42 {
43 return this.TransmitRPC("BMXGetFac", aDuz);
44 }
45
46 public static BMXNetEhrSessionConnection OpenOn(BMXNetBroker aBroker,ICSS_Session aCssSession, ICSS_User aCiaUser)
47 {
48 BMXNetEhrSessionConnection answer = new BMXNetEhrSessionConnection(aBroker);
49 answer.CiaSession= aCssSession;
50 answer.CiaUser=aCiaUser;
51 return answer;
52 }
53
54 private ICSS_User _ciaUser;
55
56 public ICSS_User CiaUser
57 {
58 get { return _ciaUser; }
59 set
60 {
61 _ciaUser = value;
62 if (value != null)
63 {
64 this.UserName = value.Name;
65 this.DUZ = value.Handle.ToString();
66 }
67 }
68 }
69
70 private ICSS_Session _ciaSession;
71
72 public ICSS_Session CiaSession
73 {
74 get { return _ciaSession; }
75 set { _ciaSession = value;}
76 }
77
78 protected override string SendReceiveString(string sendString, string multi)
79 {
80 return this.DecodeReceiveString(
81 this.CiaSession.CallRPCText(
82 "BMXRPC^BMX CIA",
83 this.EncodeSendString(sendString, this.EncodeSendString(this.EncryptionProvider.Encrypt(this.AppContext==null ? "" : this.AppContext),multi)))).Trim();
84 }
85
86
87 }
88}
Note: See TracBrowser for help on using the repository browser.