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.

113 lines
4.6 KiB

  1. using Shentun.Peis.Enums;
  2. using Shentun.Peis.Models;
  3. using Shentun.Peis.PatientRegisters;
  4. using Shentun.Peis.RegisterAsbitems;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using Volo.Abp.Domain.Repositories;
  11. using Volo.Abp.Uow;
  12. using Xunit;
  13. using Xunit.Abstractions;
  14. namespace Shentun.Peis
  15. {
  16. public class PatientRegisterAppServiceTest : PeisApplicationTestBase
  17. {
  18. private readonly IRepository<PatientRegister> _repository;
  19. private readonly PatientRegisterAppService _appService;
  20. private readonly ITestOutputHelper _output;
  21. private readonly IUnitOfWorkManager _unitOfWorkManager;
  22. public PatientRegisterAppServiceTest(ITestOutputHelper testOutputHelper)
  23. {
  24. _output = testOutputHelper;
  25. _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
  26. _repository = GetRequiredService<IRepository<PatientRegister>>();
  27. _appService = GetRequiredService<PatientRegisterAppService>();
  28. }
  29. [Fact]
  30. public async Task CreatePatientRegisterAsync()
  31. {
  32. using (var unitOfWork = _unitOfWorkManager.Begin())
  33. {
  34. var entity = new CreatePatientRegisterDto()
  35. {
  36. MedicalCenterId = new Guid("68f2d834-2bf0-4978-ad54-d2133c12a333"),
  37. PatientId = new Guid("3a119be6-d9aa-2e13-a764-0b363c60169d"),
  38. CustomerOrgId = new Guid("00000000-0000-0000-0000-000000000001"),
  39. CustomerOrgRegisterId = new Guid("00000000-0000-0000-0000-000000000002"),
  40. PatientName = "test",
  41. SexId = SexFlag.UnKnown,
  42. BirthDate = null,
  43. Age = 38,
  44. JobCardNo = "jobCardNo",
  45. MedicalCardNo = "MedicalCardNo",
  46. MaritalStatusId = MaritalStatusFlag.Married,
  47. MedicalTypeId = new Guid("3a0c5093-6dbf-d29b-cfbc-b1f742ee59d3"),
  48. PersonnelTypeId = new Guid("3a0c5099-a5f3-e41a-dfab-caeae79e0dfe"),
  49. JobPost = "JobPost",
  50. JobTitle = "JobTitle",
  51. Salesman = "Salesman",
  52. SexHormoneTermId = new Guid("3a0d38cf-8b3c-95db-1a69-5119f28dc468"),
  53. MedicalConclusionId = new Guid("3a0c50fe-cacf-d3c8-8c3c-9d3495d8bd76"),
  54. IsUpload = 'N',
  55. CompleteFlag = PatientRegisterCompleteFlag.PreRegistration,
  56. IsMedicalStart = 'N',
  57. MedicalStartDate = null,
  58. IsRecoverGuide = 'N',
  59. SummaryDate = null,
  60. IsAudit = 'N',
  61. IsLock = 'N',
  62. IsNameHide = 'N',
  63. IsPhoneFollow = 'N',
  64. IsVip = 'N',
  65. Remark = "Remark"
  66. };
  67. entity.RegisterAsbitems.Add(new CreateRegisterCheckAsbitemDto()
  68. {
  69. AsbitemId = new Guid("3a0c55fa-63b9-1510-3e81-20750c496d44"),
  70. StandardPrice = 10,
  71. ChargePrice = 10,
  72. Amount = 1,
  73. PayTypeFlag = PayTypeFlag.PersonPay,
  74. IsCharge = 'N'
  75. });
  76. entity.RegisterAsbitems.Add(new CreateRegisterCheckAsbitemDto()
  77. {
  78. AsbitemId = new Guid("3a0c5600-ae78-9ed4-e3c1-993ef41d3c51"),
  79. StandardPrice = 10,
  80. ChargePrice = 10,
  81. Amount = 1,
  82. PayTypeFlag = PayTypeFlag.PersonPay,
  83. IsCharge = 'N'
  84. });
  85. entity.RegisterAsbitems.Add(new CreateRegisterCheckAsbitemDto()
  86. {
  87. AsbitemId = new Guid("3a0c5635-b904-dc9b-593e-93d0dd228576"),
  88. StandardPrice = 10,
  89. ChargePrice = 10,
  90. Amount = 1,
  91. PayTypeFlag = PayTypeFlag.PersonPay,
  92. IsCharge = 'N'
  93. });
  94. entity.RegisterAsbitems.Add(new CreateRegisterCheckAsbitemDto()
  95. {
  96. AsbitemId = new Guid("3a11abbc-b19e-3549-e639-acc0e9aa6fbc"),
  97. StandardPrice = 10,
  98. ChargePrice = 10,
  99. Amount = 1,
  100. PayTypeFlag = PayTypeFlag.PersonPay,
  101. IsCharge = 'N'
  102. });
  103. var newEntity = await _appService.CreatePatientRegisterAsync(entity);
  104. await unitOfWork.CompleteAsync();
  105. }
  106. }
  107. }
  108. }