IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
LabexBis.Calypso Class Reference

Utilities for communication with the web service Calypso. More...

+ Inheritance diagram for LabexBis.Calypso:
+ Collaboration diagram for LabexBis.Calypso:

Public Member Functions

void TestAfterReceiverStarted ()
 Performs some tests after the receiver has been started. This function is here for debuggind purposes. It should be called after the receiver is started, and it can be empty in the release version of the application. More...
 
bool TestWs (out string Id)
 Returns true if the communication web service is responding, and false if it is not. More...
 
bool TestWs ()
 Returns true if the communication web service is responding, and false if it is not. More...
 
string GetUniqueID ()
 Gets a unique ID from the Calypso web service and returns it. More...
 
void SendMessageToMyself (string message, string msgid)
 Sends a msg that is contained in msg, to the Labex queue. If necessary then the msg is modified such that the right receiver is set in it (i.e. Labex) More...
 
void SendMessageToBis (string message, string msgid)
 Sends a msg that is contained in msg, to the Bis queue. More...
 
void SendMessage (string message, string receiver, string msgid)
 Sends a msg to the specified receiver through the calypso WS. More...
 
void SendOoNullifyToBis (string connectionstring, int IdRsr)
 Sends nullification message for the specified Observation order, to the Bis queue. Original observation order message (as stored in the database) is modified in such a way that the right action code, receiver, sender and responder are set in it, and the specified comment is set in the message. Original message XML is obtained from the message table through the ID in tbl01_RSR. More...
 
void SendOoNullifyToBis (MsgObervationOrder msg, string comment)
 Sends nullification message for the Observation order that is contained in msg, to the Bis queue. msg is modified in such a way that the right action code, receiver, sender and responder are set in it, and the specified comment is set. More...
 
void SendOoNullifyToBis (string message, string msgid, string comment)
 Sends nullification message for the Observation order that is contained in message, to the Bis queue. message is modified in such a way that the right action code, receiver, sender and responder are set in it, and the specified comment is set. More...
 
void ConfirmMessageReceipt (string Id)
 Sends confirmation back to the WS massage queue that the msg with the specified ID has been received and treated and that it doed not need to be kept in the queue any more. More...
 
void ConfirmMessageReceipt (string Id, string queueName)
 Sends confirmation back to the WS massage queue that the msg with the specified ID has been received and treated and that it doed not need to be kept in the queue any more. More...
 
void SaveIncomingMessage (MsgBase msg)
 Saves the msg Xml to a file. File name is determined according to seddings. No GUID is added to file name. More...
 
void SaveIncomingMessage (MsgBase msg, bool addGuid)
 Saves the msg Xml to a file. File name is determined according to seddings. More...
 
void SaveIncomingMessage (MsgBase msg, string filename)
 Saves the msg Xml to a file with a specified name. More...
 
MsgBase GetMessage ()
 Receives the last msg from the Calypso web service and returns msg object. More...
 
void GetMessage (out string Id, out string MessageText)
 Receives a msg from the Calypso web service and returns msg Id and Text. More...
 
LabexBis.WebReference.Message GetNextMessage ()
 Receives a new msg from the Calypso web service and returns it. The msg is also stored to a file whose name is determined from the msg ID. More...
 
void Dispose ()
 

Public Attributes

BisCommunicationSettings Settings = new BisCommunicationSettings()
 

Protected Member Functions

MsgBase GetMessage (string hl7version)
 Receives the last msg from the Calypso web service and returns msg object. The message is also storedto a file whose name is determined from the msg ID. Version of the standard must also be specified. More...
 
void GetMessage (string HL7Version, out string Id, out string MessageText)
 Receives a msg from the Calypso web service and returns msg Id and Text. More...
 
LabexBis.WebReference.Message GetNextMessage (string hl7version)
 Receives a new msg from the Calypso web service and returns it. More...
 

Properties

static IReporter R [get]
 Reporter for this class. More...
 
MsgConst Const [get]
 Gets objects that contains all constants related to communication messages. More...
 
static Calypso Global [get]
 Global communication object (application-wide). More...
 
LabexBis.WebReference.CalypsoWSNSService Service [get]
 Web service used for sending messages between systems. More...
 
string ReceiverBis [get]
 
string ReceiverLabex [get]
 

Private Member Functions

void ReceiveAndProcessMessage (bool ReadFromWS)
 Receives and processes one msg from the callypso server. Dependent on Pado server settings, msg can aldo be read from a file (for testing purposes). More...
 
void ReceiverThreadMain ()
 Periodically receives messages from Calypso and works them. More...
 
void SendMessage (string hl7version, string msg, string receiver, string msgid)
 Sending a msg to WS with HL7 version specification. More...
 

Private Attributes

LabexBis.WebReference.CalypsoWSNSService _service = null
 
const string QueueNameLabex = "Labex"
 
const string QueueNameBis = ""
 
const string HL7Version = "v30"
 
bool _dbCmdInitialized = false
 
int PauseBetweenReads_ms = 5000
 
int PauseBeforeReads_ms = 400
 
bool ControlOutputs = true
 
bool ReceiverRun = false
 

Static Private Attributes

static IReporter _rep = new ReporterConsole()
 
static Calypso _global = null
 

Detailed Description

Utilities for communication with the web service Calypso.

Member Function Documentation

void LabexBis.Calypso.ReceiveAndProcessMessage ( bool  ReadFromWS)
inlineprivate

Receives and processes one msg from the callypso server. Dependent on Pado server settings, msg can aldo be read from a file (for testing purposes).

Parameters
ReadFromWsIf false then msg is not read from the web service but from a file.
void LabexBis.Calypso.ReceiverThreadMain ( )
inlineprivate

Periodically receives messages from Calypso and works them.

void LabexBis.Calypso.TestAfterReceiverStarted ( )
inline

Performs some tests after the receiver has been started. This function is here for debuggind purposes. It should be called after the receiver is started, and it can be empty in the release version of the application.

bool LabexBis.Calypso.TestWs ( out string  Id)
inline

Returns true if the communication web service is responding, and false if it is not.

Parameters
IdOutput parameter through which a unique Id returned by the web service is obtained when the web service is responding properly.
Returns

References LabexBis.Calypso.GetUniqueID().

Referenced by IGTest.ProgramIGTest.TestCalypsoWs().

bool LabexBis.Calypso.TestWs ( )
inline

Returns true if the communication web service is responding, and false if it is not.

string LabexBis.Calypso.GetUniqueID ( )
inline
void LabexBis.Calypso.SendMessageToMyself ( string  message,
string  msgid 
)
inline

Sends a msg that is contained in msg, to the Labex queue. If necessary then the msg is modified such that the right receiver is set in it (i.e. Labex)

Parameters
msgXml document containing the msg to be sent.
msgidMessage Id.

References LabexBis.Calypso.ReceiverLabex, and LabexBis.Calypso.SendMessage().

Referenced by IGTest.ProgramIGTest.TestCalypsoWs().

void LabexBis.Calypso.SendMessageToBis ( string  message,
string  msgid 
)
inline

Sends a msg that is contained in msg, to the Bis queue.

If necessary then the msg is modified such that the right receiver is set in it (i.e. Bis)

Parameters
msgXml document containing the msg to be sent.
msgidMessage Id.

References LabexBis.Calypso.ReceiverBis, and LabexBis.Calypso.SendMessage().

Referenced by LabexBis.Calypso.SendOoNullifyToBis(), IGTest.ProgramIGTest.TestMsgFinancialTransaction(), and IGTest.ProgramIGTest.TestMsgObservationEvent().

void LabexBis.Calypso.SendMessage ( string  message,
string  receiver,
string  msgid 
)
inline

Sends a msg to the specified receiver through the calypso WS.

Parameters
msgXml document containing the msg to be sent.
receiverCode of the application that will receive the msg.
msgidMessage Id.

References LabexBis.Calypso.HL7Version.

Referenced by LabexBis.Calypso.SendMessageToBis(), and LabexBis.Calypso.SendMessageToMyself().

void LabexBis.Calypso.SendMessage ( string  hl7version,
string  msg,
string  receiver,
string  msgid 
)
inlineprivate

Sending a msg to WS with HL7 version specification.

Parameters
hl7versionVersion of the HL7 specification.
msgXml document containing the msg to be sent.
receiverCode of the application that will receive the msg.
msgidMessage Id.

References IG.Lib.IReporterBase.Depth, LabexBis.Calypso.HL7Version, LabexBis.BisCommunicationSettings.OutgoingFileName(), LabexBis.Calypso.R, IG.Lib.IReporterBase.ReportError(), IG.Lib.IReporterBase.ReportInfo(), LabexBis.Calypso.Service, IG.Lib.MsgBase.SetMessageReceiver(), and IG.Lib.IReporterBase.TreatInfo.

void LabexBis.Calypso.SendOoNullifyToBis ( string  connectionstring,
int  IdRsr 
)
inline

Sends nullification message for the specified Observation order, to the Bis queue. Original observation order message (as stored in the database) is modified in such a way that the right action code, receiver, sender and responder are set in it, and the specified comment is set in the message. Original message XML is obtained from the message table through the ID in tbl01_RSR.

Parameters
ConnectionString
IdRsR
comment

References LabexBis.Calypso.R, IG.Lib.IReporterBase.ReportError(), and IG.Lib.IReporterBase.ReportInfo().

Referenced by IGTest.ProgramIGTest.TestMsgObservationOrderNullifySend().

void LabexBis.Calypso.SendOoNullifyToBis ( MsgObervationOrder  msg,
string  comment 
)
inline

Sends nullification message for the Observation order that is contained in msg, to the Bis queue. msg is modified in such a way that the right action code, receiver, sender and responder are set in it, and the specified comment is set.

Parameters
msgXml document containing the original observation order to be nullified.
msgidMessage Id.
commentComment that is set in the message.

References IG.Lib.ParsableXmlObject.Doc, IG.Lib.MsgBase.MessageId, IG.Lib.MsgBase.MessageNumber, IG.Lib.MsgObervationOrder.PrepareOoNullify(), LabexBis.Calypso.SendMessageToBis(), and IG.Lib.MsgBase.Type.

void LabexBis.Calypso.SendOoNullifyToBis ( string  message,
string  msgid,
string  comment 
)
inline

Sends nullification message for the Observation order that is contained in message, to the Bis queue. message is modified in such a way that the right action code, receiver, sender and responder are set in it, and the specified comment is set.

Parameters
messageXml document containing the original observation order to be nullified.
msgidMessage Id. Needed to form the file name where message is stored before sending.
commentComment that is set in the message.

References IG.Lib.MsgObervationOrder.PrepareOoNullify(), and LabexBis.Calypso.SendMessageToBis().

void LabexBis.Calypso.ConfirmMessageReceipt ( string  Id)
inline

Sends confirmation back to the WS massage queue that the msg with the specified ID has been received and treated and that it doed not need to be kept in the queue any more.

Parameters
IdId of the received msg (as obtained from the web service).

References LabexBis.Calypso.QueueNameLabex.

Referenced by IGTest.ProgramIGTest.ReceiveSpecimenObservationOrder().

void LabexBis.Calypso.ConfirmMessageReceipt ( string  Id,
string  queueName 
)
inline

Sends confirmation back to the WS massage queue that the msg with the specified ID has been received and treated and that it doed not need to be kept in the queue any more.

Parameters
IdId of the received msg (as obtained from the web service).
queuwNameName of the queue from which the msg has been picked.

References IG.Lib.IReporterBase.Depth, LabexBis.Calypso.R, IG.Lib.IReporterBase.ReportError(), IG.Lib.IReporterBase.ReportInfo(), LabexBis.Calypso.Service, and IG.Lib.IReporterBase.TreatInfo.

void LabexBis.Calypso.SaveIncomingMessage ( MsgBase  msg)
inline

Saves the msg Xml to a file. File name is determined according to seddings. No GUID is added to file name.

Parameters
msgMessage to be saved.

References LabexBis.BisCommunicationSettings.IncomingFileName(), and IG.Lib.MsgBase.MessageId.

Referenced by IGTest.ProgramIGTest.ReceiveSpecimenObservationOrder(), and LabexBis.Calypso.SaveIncomingMessage().

void LabexBis.Calypso.SaveIncomingMessage ( MsgBase  msg,
bool  addGuid 
)
inline

Saves the msg Xml to a file. File name is determined according to seddings.

Parameters
msgMessage to be saved.
addGuidIf true then GUID is added to file name.

References LabexBis.BisCommunicationSettings.IncomingFileName(), IG.Lib.MsgBase.MessageId, and LabexBis.Calypso.SaveIncomingMessage().

void LabexBis.Calypso.SaveIncomingMessage ( MsgBase  msg,
string  filename 
)
inline

Saves the msg Xml to a file with a specified name.

Parameters
msgMessage object whose Xml is saved.
filenameName of a file into which the object is saved.

References IG.Lib.MsgBase.MessageXml.

MsgBase LabexBis.Calypso.GetMessage ( )
inline
MsgBase LabexBis.Calypso.GetMessage ( string  hl7version)
inlineprotected

Receives the last msg from the Calypso web service and returns msg object. The message is also storedto a file whose name is determined from the msg ID. Version of the standard must also be specified.

References LabexBis.Calypso.GetMessage(), IG.Lib.MsgBase.GetMessageType(), LabexBis.BisCommunicationSettings.IncomingFileName(), IG.Lib.MsgBase.MessageFile, IG.Lib.MsgBase.MessageId, IG.Lib.MsgBase.MessageXml, LabexBis.Calypso.R, IG.Lib.IReporterBase.ReportError(), IG.Lib.IReporterBase.ReportInfo(), and IG.Lib.IReporterBase.TreatInfo.

void LabexBis.Calypso.GetMessage ( out string  Id,
out string  MessageText 
)
inline

Receives a msg from the Calypso web service and returns msg Id and Text.

Parameters
Idmessagestr ID that is a part of the received msg.
MessageTextmessagestr itself.

References LabexBis.Calypso.GetMessage(), and LabexBis.Calypso.HL7Version.

void LabexBis.Calypso.GetMessage ( string  HL7Version,
out string  Id,
out string  MessageText 
)
inlineprotected

Receives a msg from the Calypso web service and returns msg Id and Text.

Parameters
hl7versionVersion of the HL7 standard according to which the msg is assembled.
Idmessagestr ID that is a part of the received msg.
MessageTextmessagestr itself.

References IG.Lib.IReporterBase.Depth, LabexBis.Calypso.GetNextMessage(), LabexBis.Calypso.R, IG.Lib.IReporterBase.ReportError(), IG.Lib.IReporterBase.ReportInfo(), and IG.Lib.IReporterBase.TreatInfo.

LabexBis.WebReference.Message LabexBis.Calypso.GetNextMessage ( )
inline

Receives a new msg from the Calypso web service and returns it. The msg is also stored to a file whose name is determined from the msg ID.

Returns
The msg received.

References LabexBis.Calypso.HL7Version.

Referenced by LabexBis.Calypso.GetMessage().

LabexBis.WebReference.Message LabexBis.Calypso.GetNextMessage ( string  hl7version)
inlineprotected
void LabexBis.Calypso.Dispose ( )
inline

Member Data Documentation

IReporter LabexBis.Calypso._rep = new ReporterConsole()
staticprivate
Calypso LabexBis.Calypso._global = null
staticprivate
LabexBis.WebReference.CalypsoWSNSService LabexBis.Calypso._service = null
private
const string LabexBis.Calypso.QueueNameLabex = "Labex"
private
const string LabexBis.Calypso.QueueNameBis = ""
private
const string LabexBis.Calypso.HL7Version = "v30"
private
bool LabexBis.Calypso._dbCmdInitialized = false
private
int LabexBis.Calypso.PauseBetweenReads_ms = 5000
private
int LabexBis.Calypso.PauseBeforeReads_ms = 400
private
bool LabexBis.Calypso.ControlOutputs = true
private
bool LabexBis.Calypso.ReceiverRun = false
private

Property Documentation

MsgConst LabexBis.Calypso.Const
getprotected

Gets objects that contains all constants related to communication messages.

LabexBis.WebReference.CalypsoWSNSService LabexBis.Calypso.Service
getprotected
string LabexBis.Calypso.ReceiverBis
get
string LabexBis.Calypso.ReceiverLabex
get

The documentation for this class was generated from the following file: