电子药箱通讯服务端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RequestMulOperationUsageDetailProtocol.cs 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Rdh.SocketServer.Client.Models
  7. {
  8. /// <summary>
  9. /// 表示上传多个手术用药信息的类
  10. /// </summary>
  11. public class RequestMulOperationUsageDetailProtocol : ModelProtocol
  12. {
  13. public RequestMulOperationUsageDetailProtocol()
  14. {
  15. }
  16. public String? No { get; set; }
  17. public UserInfoProtocol? UserInfo { get; set; }
  18. public string? RoomCode { get; set; }
  19. public String? OperationID { get; set; }
  20. public DateTime? CreateTime { get; set; }
  21. public List<DrugUsageProtocol>? ListDrugs { get; set; }
  22. public override string GetContent()
  23. {
  24. return null;
  25. }
  26. public bool ParseContent(string[] lines)
  27. {
  28. if (lines == null
  29. || lines.Length < 6)
  30. {
  31. return false;
  32. }
  33. No = EleMedKitProtocolHelper.GetLineContent(lines[0]);
  34. UserInfo = new UserInfoProtocol();
  35. if (!UserInfo.ParseContent(lines[1]))
  36. {
  37. return false;
  38. }
  39. RoomCode = EleMedKitProtocolHelper.GetLineContent(lines[2]);
  40. OperationID = EleMedKitProtocolHelper.GetLineContent(lines[3]);
  41. DateTime? createTime = EleMedKitProtocolHelper.GetDateTimeByLineContent(lines[4]);
  42. if (createTime == null)
  43. {
  44. return false;
  45. }
  46. CreateTime = createTime.Value;
  47. ListDrugs = new List<DrugUsageProtocol>();
  48. for (int i = 5; i < lines.Length; i++)
  49. {
  50. DrugUsageProtocol drugInfo = new DrugUsageProtocol();
  51. if (drugInfo.ParseContent(lines[i]))
  52. {
  53. ListDrugs.Add(drugInfo);
  54. }
  55. else
  56. {
  57. return false;
  58. }
  59. }
  60. return true;
  61. }
  62. }
  63. }