Esempio n. 1
0
        public string Response(string response)
        {
            var data      = response.Split($"{LF}");
            var header    = data[1].Split(" ");
            var blockCode = header.Last();

            var t1 = data.ToList().IndexOf(char.ToString('\u0002'));
            var t2 = data.ToList().IndexOf(char.ToString('\u0003'));

            var body = data.Skip(t1 + 1).Take(t2 - t1 - 1).ToList();

            //var chan = CobasIntegra400ChainBuilder.CreateInstance(visitor);
            //chan.Handle(blockCode, body, ress);

            object t;

            t = null;

            switch (blockCode)
            {
            case "00":
            {
                t = new Block00Idle(_deviceName, body);
                break;
            }

            case "02":
            {
                t = new Block02CalibrationResult(body);
                break;
            }

            case "03":
            {
                t = new Block03ControlResult(body);
                break;
            }

            case "04":
            {
                t = new Block04PatientResults(body);
                break;
            }

            case "05":
            {
                t = new Block05CalibrationResultLotInfo(body);
                break;
            }

            case "06":
            {
                t = new Block06ControlResultLotInfo(body);
                break;
            }

            case "07":
            {
                t = new Block07PatientResultLotInfo(body);
                break;
            }

            case "08":
            {
                t = new Block08ResultRequestResponse(body);
                break;
            }

            case "19":
            {
                t = new Block19OrderManipulationResponse(body);
                break;
            }

            case "49":
            {
                t = new Block49PatientManipulationResponse(body);
                break;
            }

            case "61":
            {
                t = new Block61SlotConfiguration(body);
                break;
            }

            case "62":
            {
                t = new Block62SampleTubeInformation(body);
                break;
            }

            case "63":
            {
                t = new { blockCode = 63, desc = "nadarim" };
                break;
            }

            case "69":
            {
                t = new Block69ServiceRequestResponse(body);
                break;
            }

            case "91":
            {
                t = new Block91SystemStatusResponse(body);
                break;
            }

            case "93":
            {
                t = new Block93ProtocolVersionData(body);
                break;
            }

            case "99":
            {
                t = new Block99ControlMessage(body);
                break;
            }
            }
            return(JsonConvert.SerializeObject(t));
        }
Esempio n. 2
0
        public string Idle()
        {
            var t = new Block00Idle(_deviceName);

            return(t.Generate());
        }