Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "github.com/richardfuller/erxsoap/erx"
- "os"
- "time"
- )
- func main() {
- NCPDP := os.Getenv("NCPDP")
- Username := os.Getenv("Uname")
- Password := os.Getenv("Unamepw")
- TertID := os.Getenv("TertID")
- MailboxID := os.Getenv("MailboxID")
- message := erx.NewMessageResupply()
- //Set header values
- message.Header = erx.Header{
- To: &erx.To{To: NCPDP, Qualifier: "P"},
- From: &erx.From{From: "RichardFuller", Qualifier: "D"},
- MessageID: "EHR_MSG_ID",
- SentTime: time.Now().UTC(),
- Security: &erx.Security{
- UsernameToken: erx.NewUsernameToken(Username, Password),
- Sender: erx.Sender{
- TertiaryIdentification: TertID,
- },
- Receiver: erx.Receiver{
- TertiaryIdentification: NCPDP,
- },
- },
- Mailbox: &erx.Mailbox{MailboxID: MailboxID},
- PrescriberOrderNumber: "ORDMU201",
- }
- //Set pharmacy information
- message.Body.Resupply.Pharmacy = &erx.Pharmacy{
- Identification: erx.Identification{
- NPI: "9999999999",
- NCPDPID: "11111111",
- },
- StoreName: "TEST PHARMACY NAME",
- Address: erx.Address{
- AddressLine1: "1629-90 Supply Ln",
- City: "Chicago",
- State: "IL",
- ZipCode: "60622",
- },
- CommunicationNumbers: erx.CommunicationNumbers{
- Communication: erx.Communication{
- Number: 3122603142,
- Qualifier: "TE",
- },
- },
- }
- //Set prescriber information
- message.Body.Resupply.Prescriber = &erx.Prescriber{
- Identification: erx.Identification{
- DEANumber: "BC406040",
- NPI: "1457623993",
- },
- ClinicName: "Clinic One",
- Name: erx.Name{
- LastName: "Random",
- FirstName: "Doctor",
- },
- Address: erx.Address{
- AddressLine1: "625 Downton Lane",
- City: "Sonoma",
- State: "CA",
- ZipCode: "95476",
- },
- CommunicationNumbers: erx.CommunicationNumbers{
- Communication: erx.Communication{
- Number: 707210333,
- Qualifier: "TE",
- },
- },
- PrescriberAgent: &erx.PrescriberAgent{
- LastName: "Fuller",
- FirstName: "Richard",
- },
- }
- //Set facility information
- //Set patient information
- message.Body.Resupply.Patient = &erx.Patient{
- Identification: erx.Identification{
- MedicalRecordIdentificationNumberEHR: "Patient1",
- },
- Name: erx.Name{LastName: "Mouse", FirstName: "Mickey"},
- Gender: "M",
- DateOfBirth: erx.DateOfBirth{Date: "1940-01-01"},
- Address: erx.Address{
- AddressLine1: "991 Monroe Avenue",
- City: "Port Charlotte",
- State: "FL",
- ZipCode: "33952",
- },
- CommunicationNumbers: erx.CommunicationNumbers{
- Communication: erx.Communication{
- Number: 9412011223,
- Qualifier: "TE",
- },
- },
- PatientLocation: &erx.PatientLocation{
- FacilityUnit: "Unit 1",
- Bed: "B",
- Room: "103",
- },
- }
- //Set medicationprescribed information
- message.Body.Resupply.MedicationPrescribed = &erx.MedicationPrescribed{
- DrugDescription: "Procardia XL 30 MG Tablet",
- DrugCoded: erx.DrugCoded{
- ProductCode: "00069265041",
- ProductCodeQualifier: "ND",
- Strength: "30",
- DrugDBCode: "207772",
- DrugDBCodeQualifier: "SBD",
- FormSourceCode: "AA",
- FormCode: "C42927",
- StrengthSourceCode: "AB",
- StrengthCode: "C28253",
- },
- Quantity: erx.Quantity{
- Value: "0",
- CodeListQualifier: "QS",
- UnitSourceCode: "AC",
- PotencyUnitCode: "C48542",
- },
- Directions: "Take 1 tablet by mouth every morning.",
- Note: "This is a test order.",
- Refills: erx.Refills{Qualifier: "PRN"},
- Substitutions: "1",
- WrittenDate: erx.WrittenDate{Date: "2017-05-13"},
- EffectiveDate: erx.EffectiveDate{Date: "2017-05-13"},
- }
- message.PrintPretty()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement