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.

53 lines
1.5 KiB

2 years ago
  1. using ServiceReference1;
  2. using Xunit;
  3. using Xunit.Abstractions;
  4. using static ServiceReference1.bstjPortTypeClient;
  5. namespace Shentun.Peis.PlugIns.Gem.Test
  6. {
  7. public class HisTest
  8. {
  9. private readonly ITestOutputHelper _output;
  10. public HisTest(ITestOutputHelper testOutputHelper)
  11. {
  12. _output = testOutputHelper;
  13. }
  14. [Fact]
  15. public void GetPatientQuery()
  16. {
  17. //var binding = new BasicHttpBinding();
  18. //var endpoint = new EndpointAddress("http://www.yourwebservice.com/Service");
  19. //using (var channelFactory = new ChannelFactory<IService>(binding, endpoint))
  20. //{
  21. // var client = channelFactory.CreateChannel();
  22. // var result = await client.YourOperationAsync(yourParameters);
  23. // Console.WriteLine(result);
  24. //}
  25. var client = new bstjPortTypeClient(EndpointConfiguration.bstjHttpSoap11Endpoint);
  26. string xml = @"<BSXml>
  27. <MsgHeader>
  28. <Sender>HIS</Sender>
  29. <MsgType>PAT_0103</MsgType>
  30. <MsgVersion>3.1</MsgVersion>
  31. </MsgHeader>
  32. <Patient>
  33. <IdCard>110101202404238836</IdCard>
  34. <IdCardCode>01</IdCardCode>
  35. <Name></Name>
  36. <Sex>1</Sex>
  37. <BirthDate>2024-04-23</BirthDate>
  38. <PatientPhone>13700000001</PatientPhone>
  39. <EthnicGroupCode>01</EthnicGroupCode>
  40. <WorkUnit></WorkUnit>
  41. <Address></Address>
  42. </Patient>
  43. </BSXml>
  44. ";
  45. var result = client.invokeAsync("patientQuery", "", "", xml).Result;
  46. _output.WriteLine(result.ToString());
  47. }
  48. }
  49. }