Example #1
0
        public static void PLdataReceived(object receivedata, string name)//PL数据ASTM化
        {
            PLManager.PL12         data = (PLManager.PL12)receivedata;
            ASTMManager.ASTMStruct astm = new ASTMManager.ASTMStruct();
            astm.Item = new List <string>();

            ASTM_HeaderRecordPack h = new ASTM_HeaderRecordPack();

            h.DelimiterDefinition = "\\^&";
            h.SenderNameorID      = data.DEVEICE;
            h.ProcessingID        = "PR";
            h.VersionNumber       = "1394-97";
            h.DateandTime         = DateTime.Now.ToString("yyyyMMddhhmmss");

            ASTM_PatientRecordPack p = new ASTM_PatientRecordPack();//这个必须有

            p.SequenceNumber = "1";
            p.PatientID      = data.SAMPLE_ID;

            ASTM_TestOrderRecordPack o = new ASTM_TestOrderRecordPack();

            o.SequenceNumber = "1";
            o.SampleID       = data.SAMPLE_ID;
            o.SpecimenCollectionDateandTime = data.TEST_TIME.ToString("yyyyMMddhhmmss"); //检测时间
            o.ReportType = "F";                                                          //最终的结果

            ASTM_TestOrderRecordPack.Assay item = new ASTM_TestOrderRecordPack.Assay();
            int num = 1;
            List <ASTM_ResultRecordPack> listR = new List <ASTM_ResultRecordPack>();
            ASTM_ResultRecordPack        rAPP  = new ASTM_ResultRecordPack();

            item.AssayNo   = num.ToString();
            item.AssayName = "AAP";
            item.RepeatNum = "1";
            o.AssayList.Add(item);
            rAPP.SequenceNumber           = num.ToString();
            rAPP.AssayNo                  = num.ToString();
            rAPP.AssayName                = "诱聚剂项目";
            rAPP.Replicatenumber          = "1";
            rAPP.ResultType               = "F"; //定量结果
            rAPP.MeasurementValue         = data.AAP;
            rAPP.ResultStatus             = "F"; //最终结果
            rAPP.InstrumentIdentification = data.DEVEICE;
            listR.Add(rAPP);
            foreach (PLManager.PL12Result temp in data.Result)
            {
                ++num;
                item.AssayNo   = num.ToString();
                item.AssayName = temp.ITEM;
                item.RepeatNum = "1";
                o.AssayList.Add(item);

                ASTM_ResultRecordPack r = new ASTM_ResultRecordPack();
                r.SequenceNumber             = num.ToString();
                r.AssayNo                    = num.ToString();
                r.AssayName                  = temp.FULL_NAME;
                r.Replicatenumber            = "1";
                r.ResultType                 = "F";//定量结果
                r.MeasurementValue           = temp.RESULT;
                r.Units                      = temp.UNIT;
                r.MeasurementRangeLowerLimit = temp.NORMAL_LOW.ToString();
                r.MeasurementRangeUpperLimit = temp.NORMAL_HIGH.ToString();
                r.ResultAbnormalflag         = temp.INDICATE;
                r.ResultStatus               = "F";//最终结果
                r.InstrumentIdentification   = data.DEVEICE;
                listR.Add(r);
                astm.Item.Add(temp.ITEM);
            }
            ASTM_Encode message = new ASTM_Encode(h, p, o, listR);

            astm.ASTMMessage = message.Encode();
            astm.Device      = data.DEVEICE;
            astm.Sample_ID   = data.SAMPLE_ID;
            astmManager.AddASTM(astm);
        }
Example #2
0
        public static void DSdataReceived(object receivedata, string name)//DS数据ASTM化
        {
            DI800Manager.DI800     data = (DI800Manager.DI800)receivedata;
            ASTMManager.ASTMStruct astm = new ASTMManager.ASTMStruct();
            astm.Item = new List <string>();

            ASTM_HeaderRecordPack h = new ASTM_HeaderRecordPack();

            h.DelimiterDefinition = "\\^&";
            h.SenderNameorID      = data.Device;
            h.ProcessingID        = "PR";
            h.VersionNumber       = "1394-97";
            h.DateandTime         = DateTime.Now.ToString("yyyyMMddhhmmss");

            ASTM_PatientRecordPack p = new ASTM_PatientRecordPack();

            p.SequenceNumber              = "1";
            p.PatientID                   = data.PATIENT_ID;
            p.PatientLastName             = data.FIRST_NAME;
            p.Age                         = data.AGE;
            p.PatientSex                  = data.SEX;
            p.DocterLastName              = data.DOCTOR;
            p.Location                    = data.AREA;
            p.NatureofaltDiagCodeandClass = data.BED;

            ASTM_TestOrderRecordPack o = new ASTM_TestOrderRecordPack();

            o.SequenceNumber = "1";
            o.SampleID       = data.SAMPLE_ID;
            o.Priority       = (data.Type.IndexOf("急诊") > 0) ? "S" : "R";
            o.SpecimenCollectionDateandTime    = data.TIME.ToString("yyyyMMddhhmmss");      //检测时间
            o.DateTimeSpecimenReceivedintheLab = data.SEND_TIME.ToString("yyyyMMddhhmmss"); //送检时间
            o.ReportType = "F";                                                             //最终的结果

            ASTM_TestOrderRecordPack.Assay item = new ASTM_TestOrderRecordPack.Assay();
            int num = 0;
            List <ASTM_ResultRecordPack> listR = new List <ASTM_ResultRecordPack>();

            foreach (DI800Manager.DI800Result temp in data.Result)
            {
                ++num;
                item.AssayNo   = num.ToString();
                item.AssayName = temp.ITEM;
                item.RepeatNum = "1";
                o.AssayList.Add(item);

                ASTM_ResultRecordPack r = new ASTM_ResultRecordPack();
                r.SequenceNumber             = num.ToString();
                r.AssayNo                    = num.ToString();
                r.AssayName                  = temp.FULL_NAME;
                r.Replicatenumber            = "1";
                r.ResultType                 = "F";//定量结果
                r.MeasurementValue           = temp.RESULT.ToString();
                r.Units                      = temp.UNIT;
                r.MeasurementRangeLowerLimit = temp.NORMAL_LOW.ToString();
                r.MeasurementRangeUpperLimit = temp.NORMAL_HIGH.ToString();
                r.ResultAbnormalflag         = temp.INDICATE;
                r.ResultStatus               = "F";//最终结果
                r.InstrumentIdentification   = data.Device;
                listR.Add(r);
                astm.Item.Add(temp.ITEM);
            }
            ASTM_Encode message = new ASTM_Encode(h, p, o, listR);

            astm.ASTMMessage = message.Encode();
            astm.Device      = data.Device;
            astm.Sample_ID   = data.SAMPLE_ID;
            astm.SendTime    = data.SEND_TIME.ToString();
            astmManager.AddASTM(astm);
        }