Ejemplo n.º 1
0
 public void OrderTest()
 {
     try
     {
         const string rawHeader = @"O|1|000003                |3^5238^3^^S1^SC|^^^2^1|R||20000529125556||||N||||1|||||||20000529125645|||F";
         var          order     = new CobasE6000TestOrderRecord(rawHeader);
         var          neworder  =
             new CobasE6000TestOrderRecord(
                 @"O|1|                  0003|0^5020^5^^S1^SC|^^^10^1|R||20121105163859||||N||||1|||||||20121105163860|||F");
         Debug.WriteLine(order.Create());
         Debug.WriteLine(neworder.Create());
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.ToString());
     }
 }
Ejemplo n.º 2
0
        private List <string> CreateOrderFrame(List <string> orderList)
        {
            var retList = new List <string>();

            //Tạo Header mới
            var newHeaderRecord = (CobasE6000HeaderRecord)_clsHRecord.Clone();

            newHeaderRecord.CommentOrSpecialInstructions.Data = "TSDWN^REPLY";
            newHeaderRecord.SenderNameOrId.Data = _clsHRecord.ReveiverId.Data;
            newHeaderRecord.ReveiverId.Data     = _clsHRecord.SenderNameOrId.Data;

            var sTemp    = string.Format("{0}{1}{2}{3}", DeviceHelper.STX, "1", newHeaderRecord.Create(), DeviceHelper.ETB);
            var checksum = DeviceHelper.GetCheckSumValue(sTemp);

            retList.Add(string.Format("{0}{1}{2}", sTemp, checksum, DeviceHelper.CRLF));

            //Xử lý kết quả
            if ((orderList != null) && (orderList.Count != 0))
            {
                //Add Patient Record
                _clsPRecord.SequenceNumber.Data = "1";
                _clsPRecord.PatientSex.Data     = "U";
                _clsPRecord.LaboratoryAssignedPatientId.Data = _sQBarcode;

                sTemp = string.Format("{0}{1}{2}{3}", DeviceHelper.STX, "2", _clsPRecord.Create(), DeviceHelper.ETB);

                checksum = DeviceHelper.GetCheckSumValue(sTemp);
                retList.Add(string.Format("{0}{1}{2}", sTemp, checksum, DeviceHelper.CRLF));

                //Add OrderRecord
                _clsORecord = new CobasE6000TestOrderRecord();
                _clsORecord.SequenceNumber.Data = "1";
                _clsORecord.SpecimenId.Data     = _sQBarcode.PadRight(22);
                var tempIsId = _clsQRecord.StartingRangeIdNumber.Data.Split(_clsQRecord.Rules.ComponentDelimiter);
                _clsORecord.InstrumentSpecimenId.Data = string.Join(_clsORecord.Rules.ComponentDelimiter.ToString(),
                                                                    new[]
                {
                    tempIsId[3], tempIsId[4], tempIsId[5],
                    tempIsId[6], tempIsId[7], tempIsId[8]
                });
                _clsORecord.UniversalTestId.Data = _clsORecord.CreateUniversalTestid(orderList);
                _clsORecord.Priority.Data        = "R";
                _clsORecord.SpecimenCollectionDateAndTime.Data        = DateTime.Now.ToString("yyyyMMddHHmmss");
                _clsORecord.DateTimeResultReportedOrLastModified.Data = DateTime.Now.ToString("yyyyMMddHHmmss");
                _clsORecord.ActionCode.Data         = "A";
                _clsORecord.SpecimenDescriptor.Data = "1";
                _clsORecord.ReportTypes.Data        = "O";
                sTemp    = string.Format("{0}{1}{2}{3}", DeviceHelper.STX, "3", _clsORecord.Create(), DeviceHelper.ETB);
                checksum = DeviceHelper.GetCheckSumValue(sTemp);
                retList.Add(string.Format("{0}{1}{2}", sTemp, checksum, DeviceHelper.CRLF));

                _clsTRecord = new CobasE6000TerminationRecord();
                sTemp       = String.Concat(DeviceHelper.STX, "4", _clsTRecord.Create(), DeviceHelper.ETX);
                checksum    = DeviceHelper.GetCheckSumValue(sTemp);
                retList.Add(string.Format("{0}{1}{2}", sTemp, checksum, DeviceHelper.CRLF));
            }
            else
            {
                _clsTRecord = new CobasE6000TerminationRecord {
                    TerminationCode = { Data = "N" }
                };
                sTemp    = String.Concat(DeviceHelper.STX, "2", _clsTRecord.Create(), DeviceHelper.ETX);
                checksum = DeviceHelper.GetCheckSumValue(sTemp);
                retList.Add(string.Format("{0}{1}{2}", sTemp, checksum, DeviceHelper.CRLF));
            }

            return(retList);
        }