/// <summary>
        ///     Default constructor
        /// </summary>
        /// <param name="relaxTq">Allows 0 qty records to be sent to gateway</param>
        /// <param name="autoTruncate">Forces trim to max length for the field</param>
        /// <param name="sendEof">Forces stream closure</param>
        public RecordBundle(bool relaxTq = false, bool autoTruncate = false, bool sendEof = false)
        {
            SendEof = sendEof;

            _eventLogger = LogManager.GetLogger("motRecordBundle.Manager");
            Patient      = new MotPatientRecord("Add", autoTruncate);
            Scrip        = new MotPrescriptionRecord("Add", autoTruncate);
            Prescriber   = new MotPrescriberRecord("Add", autoTruncate);
            Location     = new MotFacilityRecord("Add", autoTruncate);
            Store        = new MotStoreRecord("Add", autoTruncate);
            Drug         = new MotDrugRecord("Add", autoTruncate);

            TQList         = new List <MotTimesQtysRecord>();
            StoreList      = new List <MotStoreRecord>();
            PrescriberList = new List <MotPrescriberRecord>();

            Patient.RelaxTqRequirements = Scrip.RelaxTqRequirements = Location.RelaxTqRequirements = Prescriber.RelaxTqRequirements = Store.RelaxTqRequirements = Drug.RelaxTqRequirements = relaxTq;

            if (UseQueue)
            {
                _writeQueue             = new MotWriteQueue();
                Patient.LocalWriteQueue = Scrip.LocalWriteQueue = Location.LocalWriteQueue = Prescriber.LocalWriteQueue = Store.LocalWriteQueue = Drug.LocalWriteQueue = _writeQueue;

                _writeQueue.SendEof   = sendEof;
                _writeQueue.DebugMode = DebugMode;
            }

            Patient.QueueWrites = Scrip.QueueWrites = Location.QueueWrites = Prescriber.QueueWrites = Store.QueueWrites = Drug.QueueWrites = UseQueue;

            Patient.SendEof = Scrip.SendEof = Location.SendEof = Prescriber.SendEof = Store.SendEof = Drug.SendEof = sendEof;

            Patient.AutoTruncate = Scrip.AutoTruncate = Location.AutoTruncate = Prescriber.AutoTruncate = Store.AutoTruncate = Drug.AutoTruncate = autoTruncate;
        }
Beispiel #2
0
        public void AddToQueue(MotWriteQueue NewQueue = null)
        {
            if (NewQueue != null)
            {
                LocalWriteQueue = NewQueue;
            }

            AddToQueue("D", _fieldList);
        }
        /// <summary>
        /// Adds to queue.
        /// </summary>
        /// <param name="newQueue">New queue.</param>
        public void AddToQueue(MotWriteQueue newQueue = null)
        {
            if (newQueue != null)
            {
                LocalWriteQueue = newQueue;
            }

            AddToQueue("G", _fieldList);
        }
Beispiel #4
0
        /// <summary>
        /// AddToQueue
        /// </summary>
        /// <param name="newQueue"></param>
        public void AddToQueue(MotWriteQueue newQueue = null)
        {
            var f = _fieldList?.Find(x => x.TagName.ToLower().Contains(("rxsys_storeid")));

            if (f != null && !string.IsNullOrEmpty(f.TagData))
            {
                if (newQueue != null)
                {
                    LocalWriteQueue = newQueue;
                }

                AddToQueue("A", _fieldList);
            }
        }