Advertisement
Guest User

Untitled

a guest
Aug 25th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.62 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "github.com/richardfuller/erxsoap/erx"
  5. "os"
  6. "time"
  7. )
  8.  
  9. func main() {
  10. NCPDP := os.Getenv("NCPDP")
  11. Username := os.Getenv("Uname")
  12. Password := os.Getenv("Unamepw")
  13. TertID := os.Getenv("TertID")
  14. MailboxID := os.Getenv("MailboxID")
  15.  
  16. message := erx.NewMessageResupply()
  17.  
  18. //Set header values
  19. message.Header = erx.Header{
  20. To: &erx.To{To: NCPDP, Qualifier: "P"},
  21. From: &erx.From{From: "RichardFuller", Qualifier: "D"},
  22. MessageID: "EHR_MSG_ID",
  23. SentTime: time.Now().UTC(),
  24. Security: &erx.Security{
  25. UsernameToken: erx.NewUsernameToken(Username, Password),
  26. Sender: erx.Sender{
  27. TertiaryIdentification: TertID,
  28. },
  29. Receiver: erx.Receiver{
  30. TertiaryIdentification: NCPDP,
  31. },
  32. },
  33. Mailbox: &erx.Mailbox{MailboxID: MailboxID},
  34. PrescriberOrderNumber: "ORDMU201",
  35. }
  36.  
  37. //Set pharmacy information
  38. message.Body.Resupply.Pharmacy = &erx.Pharmacy{
  39. Identification: erx.Identification{
  40. NPI: "9999999999",
  41. NCPDPID: "11111111",
  42. },
  43. StoreName: "TEST PHARMACY NAME",
  44. Address: erx.Address{
  45. AddressLine1: "1629-90 Supply Ln",
  46. City: "Chicago",
  47. State: "IL",
  48. ZipCode: "60622",
  49. },
  50. CommunicationNumbers: erx.CommunicationNumbers{
  51. Communication: erx.Communication{
  52. Number: 3122603142,
  53. Qualifier: "TE",
  54. },
  55. },
  56. }
  57.  
  58. //Set prescriber information
  59. message.Body.Resupply.Prescriber = &erx.Prescriber{
  60. Identification: erx.Identification{
  61. DEANumber: "BC406040",
  62. NPI: "1457623993",
  63. },
  64. ClinicName: "Clinic One",
  65. Name: erx.Name{
  66. LastName: "Random",
  67. FirstName: "Doctor",
  68. },
  69. Address: erx.Address{
  70. AddressLine1: "625 Downton Lane",
  71. City: "Sonoma",
  72. State: "CA",
  73. ZipCode: "95476",
  74. },
  75. CommunicationNumbers: erx.CommunicationNumbers{
  76. Communication: erx.Communication{
  77. Number: 707210333,
  78. Qualifier: "TE",
  79. },
  80. },
  81. PrescriberAgent: &erx.PrescriberAgent{
  82. LastName: "Fuller",
  83. FirstName: "Richard",
  84. },
  85. }
  86. //Set facility information
  87.  
  88. //Set patient information
  89. message.Body.Resupply.Patient = &erx.Patient{
  90. Identification: erx.Identification{
  91. MedicalRecordIdentificationNumberEHR: "Patient1",
  92. },
  93. Name: erx.Name{LastName: "Mouse", FirstName: "Mickey"},
  94. Gender: "M",
  95. DateOfBirth: erx.DateOfBirth{Date: "1940-01-01"},
  96. Address: erx.Address{
  97. AddressLine1: "991 Monroe Avenue",
  98. City: "Port Charlotte",
  99. State: "FL",
  100. ZipCode: "33952",
  101. },
  102. CommunicationNumbers: erx.CommunicationNumbers{
  103. Communication: erx.Communication{
  104. Number: 9412011223,
  105. Qualifier: "TE",
  106. },
  107. },
  108. PatientLocation: &erx.PatientLocation{
  109. FacilityUnit: "Unit 1",
  110. Bed: "B",
  111. Room: "103",
  112. },
  113. }
  114. //Set medicationprescribed information
  115. message.Body.Resupply.MedicationPrescribed = &erx.MedicationPrescribed{
  116. DrugDescription: "Procardia XL 30 MG Tablet",
  117. DrugCoded: erx.DrugCoded{
  118. ProductCode: "00069265041",
  119. ProductCodeQualifier: "ND",
  120. Strength: "30",
  121. DrugDBCode: "207772",
  122. DrugDBCodeQualifier: "SBD",
  123. FormSourceCode: "AA",
  124. FormCode: "C42927",
  125. StrengthSourceCode: "AB",
  126. StrengthCode: "C28253",
  127. },
  128. Quantity: erx.Quantity{
  129. Value: "0",
  130. CodeListQualifier: "QS",
  131. UnitSourceCode: "AC",
  132. PotencyUnitCode: "C48542",
  133. },
  134. Directions: "Take 1 tablet by mouth every morning.",
  135. Note: "This is a test order.",
  136. Refills: erx.Refills{Qualifier: "PRN"},
  137. Substitutions: "1",
  138. WrittenDate: erx.WrittenDate{Date: "2017-05-13"},
  139. EffectiveDate: erx.EffectiveDate{Date: "2017-05-13"},
  140. }
  141. message.PrintPretty()
  142. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement