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.

109 lines
4.2 KiB

1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
  1. using Shentun.Peis.ImportPacsResults;
  2. using Shentun.Utilities;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using Xunit.Abstractions;
  9. namespace Shentun.Peis.PlugIns.Gem.Test
  10. {
  11. public class ImportPacsResultPlugInsGemTest
  12. {
  13. private readonly ITestOutputHelper _output;
  14. public ImportPacsResultPlugInsGemTest(ITestOutputHelper testOutputHelper)
  15. {
  16. _output = testOutputHelper;
  17. }
  18. [Fact]
  19. public async Task ImportResultAsync()
  20. {
  21. string configParm;
  22. string filePath = DirectoryHelper.GetAppDirectory() + "/appsettings.json";
  23. configParm = File.ReadAllText(filePath);
  24. var input = new ImportPacsResultPlugInsGem(configParm);
  25. var loginResult = input.LoginAsync().Result;
  26. var item = await input.ImportResultByPatientRegisterIdAsync(new Guid("3a127c60-cadf-0308-04c7-8f32a50181d8"));
  27. }
  28. [Fact]
  29. public async Task ImportResultCallAppServiceAsync()
  30. {
  31. string configParm;
  32. string filePath = DirectoryHelper.GetAppDirectory() + "/appsettings.json";
  33. configParm = File.ReadAllText(filePath);
  34. var input = new ImportPacsResultPlugInsGem(configParm);
  35. var loginResult = input.LoginAsync().Result;
  36. var createImportPacsResultDto = new CreateImportPacsResultDto()
  37. {
  38. CheckRequestNo = "2405140365",
  39. PatientName = "李湘",
  40. Result = "Pacs检查所见",
  41. Summary = "Pacs结论",
  42. Suggestion = "Pacs建议",
  43. CheckDate = DateTime.Now,
  44. CheckDoctorName = "张医生",
  45. Files = new List<CreateImportPacsResultPictureDto>()
  46. {
  47. new CreateImportPacsResultPictureDto()
  48. {
  49. IsPrint = 'Y',
  50. FileName = Guid.NewGuid().ToString(),
  51. FileFormat = "0",
  52. FileTransMode = "0",
  53. FileBase64 = Shentun.Utilities.FileHelper.ToBase64("E:\\Whitedolphins\\prog20220722\\pic\\login.png")
  54. },
  55. new CreateImportPacsResultPictureDto()
  56. {
  57. IsPrint = 'Y',
  58. FileFormat = "0",
  59. FileTransMode = "0",
  60. FileName = Guid.NewGuid().ToString(),
  61. FileBase64 = Shentun.Utilities.FileHelper.ToBase64("E:\\Whitedolphins\\prog20220722\\pic\\首页背景图.jpg")
  62. },
  63. // new CreateImportPacsResultPictureDto()
  64. //{
  65. // IsPrint = 'Y',
  66. // FileFormat = "1",
  67. // FileTransMode = "0",
  68. // FileName = "http://10.1.13.18:8380//image/66389af146ac4b27f4da93ff/risPdf/3135.pdf",
  69. // FileUrl = "http://10.1.13.18:8380//image/66389af146ac4b27f4da93ff/risPdf/3135.pdf",
  70. // FileBase64 = Shentun.Utilities.FileHelper.ToBase64("http://10.1.13.18:8380//image/66389af146ac4b27f4da93ff/risPdf/3135.pdf")
  71. //},
  72. }
  73. };
  74. var callResult = await input.CallAppServiceAsync<CreateImportPacsResultDto, object>("api/app/ImportPacsResult/ImportResult", createImportPacsResultDto);
  75. //var item = await input.ImportResultAsync(
  76. // new ImportPacsResultPlugInsInput()
  77. // {
  78. // PatientRegisterId = new Guid("3a127c60-cadf-0308-04c7-8f32a50181d8")
  79. // });
  80. }
  81. [Fact]
  82. public async Task DoWorkAsync()
  83. {
  84. string configParm;
  85. string filePath = DirectoryHelper.GetAppDirectory() + "/appsettings.json";
  86. configParm = File.ReadAllText(filePath);
  87. var input = new ImportPacsResultPlugInsGem(new Guid("a3c68a4f-d3a8-463c-b671-389f1fb8d7d8"));
  88. await input.DoWork();
  89. }
  90. }
  91. }