Skip to content
/ ncpdp Public

Structs for decoding NCPDP Script Version 2017071

License

Notifications You must be signed in to change notification settings

dgoradia/ncpdp

Repository files navigation

codecov

NCPDP Script 2017071

Usage

See tests for more usage examples.

The decoder accepts an io.Reader and can decode xml to a *Message or json.

Decode NewRx (xml) file:

file, err := os.Open("testdata/sample-newrx.xml")
if err != nil {
    log.Fatal(err)
}
defer file.Close()

script := ncpdp.NewDecoder(file)
message, err := script.Decode()
if err != nil {
    log.Fatal(err)
}

fmt.Printf("%+v\n", message.Body.NewRx)

Get JSON representation:

message, err := script.ToJson()
if err != nil {
    log.Fatal(err)
}

fmt.Printf("%+v\n", string(message))

About

Structs for decoding NCPDP Script Version 2017071

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages