using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rdh.SocketServer.Client.Models
{
///
/// 表示药品使用信息的协议
///
public class DrugUsageProtocol : ModelProtocol
{
///
/// 获取或设置药品EPC/条码
///
public string? Barcode { get; set; }
///
/// 获取或设置药品主键
///
public string? DrugKey { get; set; }
///
///
///
public string? DrugBatchCode { get; set; }
///
/// 获取或设置使用情况
///
public string? UsageCode { get; set; }
public override string GetContent()
{
return Barcode
+ AddBlockContent(DrugKey)
+ AddBlockContent(UsageCode);
}
public override bool ParseContent(string content)
{
if (base.ParseContent(content))
{
string[] blocks = EleMedKitProtocolHelper.GetContentBlocks(content);
if (blocks.Length > 3)
{
Barcode = blocks[0];
DrugKey = blocks[1];
DrugBatchCode = blocks[2];
UsageCode = blocks[3];
return true;
}
}
return false;
}
}
}