Exemple #1
0
        private string CreateOrderFrame(List <string> orderList)
        {
            _clsPRecord = new CentaurPatientRecord();
            _clsORecord = new CentaurOrderRecord();
            _clsTRecord = new CentaurTerminationRecord();
            string sTemp = String.Concat("1", _clsHRecord.sHeaderRecord);

            if ((orderList != null) && (orderList.Count > 0))
            {
                sTemp = String.Concat(sTemp, _clsPRecord.CreateData());
                sTemp = String.Concat(sTemp, _clsORecord.CreateData(_sQBarcode, orderList));
                sTemp = String.Concat(sTemp, _clsTRecord.TerminationRecord);
            }
            else
            {
                _clsTRecord.TerminationCode = "I";
                sTemp = String.Concat(sTemp, _clsTRecord.CreateData());
            }


            sTemp = String.Concat(DeviceHelper.STX, sTemp, DeviceHelper.ETX);
            string checksum   = DeviceHelper.GetCheckSumValue(sTemp);
            string orderFrame = String.Concat(sTemp, checksum, DeviceHelper.CRLF);

            Log.Debug("Order frame: <", orderFrame);
            return(orderFrame);
        }
 public Centaur()
 {
     _clsHRecord          = new CentaurHeaderRecord();
     _clsPRecord          = new CentaurPatientRecord();
     _clsORecord          = new CentaurOrderRecord();
     _clsQRecord          = new CentaurQueryRecord();
     _clsRRecord          = new CentaurResultRecord();
     _clsTRecord          = new CentaurTerminationRecord();
     TransitionCompleted += HandleTransitionCompleted;
 }
 public CentaurManager()
 {
     try
     {
         _clsHRecord = new CentaurHeaderRecord();
         _clsPRecord = new CentaurPatientRecord();
         _clsORecord = new CentaurOrderRecord();
         _clsQRecord = new CentaurQueryRecord();
         _clsRRecord = new CentaurResultRecord();
         _clsTRecord = new CentaurTerminationRecord();
     }
     catch (Exception ex)
     {
         Log.Error(string.Format("Error: {0}", ex));
     }
 }
Exemple #4
0
        public Centaur()
        {
            try
            {
                _clsHRecord              = new CentaurHeaderRecord();
                _clsPRecord              = new CentaurPatientRecord();
                _clsORecord              = new CentaurOrderRecord();
                _clsQRecord              = new CentaurQueryRecord();
                _clsRRecord              = new CentaurResultRecord();
                _clsTRecord              = new CentaurTerminationRecord();
                PrvRequestArray          = new Queue <string>();
                _failSending             = 0;
                _timeoutManager          = new Timer(30000);
                _timeoutManager.Elapsed += _timeoutManager_Elapsed;
                objService = new ExternalDataExchangeService();

                InstanceId = Guid.NewGuid();
                objWorkFlowRuntime.AddService(objService);
                objASTM = new ClsAstm();
                objService.AddService(objASTM);
                objASTM.SendACKEvent += objASTM_SendACKEvent;
                objASTM.SendNAKEvent += objASTM_SendNAKEvent;
                objASTM.SendENQEvent += objASTM_SendENQEvent;
                objASTM.SendEOTEvent += objASTM_SendEOTEvent;
                //objASTM.ACKTimeoutEvent += new EventHandler(objASTM_ACKTimeoutEvent);
                objWorkFlowInstance = objWorkFlowRuntime.CreateWorkflow(typeof(ASTMWorkflow), null, InstanceId);
                objWorkFlowInstance.Start();
                Console.WriteLine(@"Work flow started");

                objDataEventArgs             = new ExternalDataEventArgs(InstanceId);
                objDataEventArgs.WaitForIdle = true;
                DumpStateMachine(objWorkFlowRuntime, InstanceId);
            }
            catch (Exception ex)
            {
                Log.FatalException("Fatal Error: ", ex);
            }
        }