Beispiel #1
0
 public void PatientInforTest()
 {
     try
     {
         var newHeader = new CobasE6000PatientInformationRecord(@"P|1|||||||M||||||35^Y");
         var tempP     = new CobasE6000PatientInformationRecord(@"P|1|||||||M||||||35^Y||||||||||||||||||||");
         Debug.WriteLine(tempP.Create());
         Debug.WriteLine(newHeader.Create());
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.ToString());
     }
 }
Beispiel #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);
        }