ncpdp

package
v0.0.0-...-0ae63b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2016 License: MIT Imports: 4 Imported by: 0

README

NCPDP

Decodes NCPDP script version 8.1 into more user friendly structs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(data []byte) (interface{}, error)

unmarshals NCPDP script from a byte slice

func UnmarshalValues

func UnmarshalValues(values edifact.Values) (interface{}, error)

unmarshals NCPDP script from edifact values

Types

type Address

type Address struct {
	Line1             string
	City              string
	State             string
	Postal            string
	LocationQualifier string
	Location          string // used as line2 sometimes
}

type Drug

type Drug struct {

	// Definition of the loop of the DRU segment.
	// Values:
	//   P = Prescribed
	//   D = Dispensed
	//   R = Requested
	ItemDescriptionIdentification string // 010-00 M
	// Drug name
	ItemDescription string // 010-01 M
	// Drug id  (NDCs, rxnorms, etc...)
	ItemNumber string // 010-02 C
	// The drug id qualifier.
	// Values:
	//   ND = NDC11
	//   MF = Manufacturing
	CodeListResponsibilityAgency string // 010-03 C

	// unit of measure
	QuantityQualifier string // 020-00 M
	Quantity          string // 020-01 M
	CodeListQualifier string // 020-02 C

	DosageId string // 030-00 N/U
	Dosage1  string // 030-01 C
	Dosage2  string // 030-02 C

	DaysSupply *time.Duration // qualifier: ZDS
	DateIssued *time.Time     // qualifier: 85
	// last dispensed or last filled
	LastDemand *time.Time // qualifier: LD

	// Product/service substitution, coded
	// Values:
	// 0 = No Product Selection Indicated
	// 1 = Substitution Not Allowed by Prescriber
	// 2 = Substitution Allowed - Patient Requested Product Dispensed
	// 3 = Substitution Allowed - Pharmacist Selected Product Dispensed
	// 4 = Substitution Allowed - Generic Drug Not in Stock
	// 5 = Substitution Allowed - Brand Drug Dispensed as a Generic
	// 7 = Substitution Not Allowed - Brand Drug Mandated by Law
	// 8 = Substitution Allowed - Generic Drug Not Available in Marketplace
	// (6 was intentionally left off)
	Substitution string // 050 C

	Prescriber *Provider
	Pharmacy   *Provider
}

func (*Drug) Dispensed

func (d *Drug) Dispensed() bool

returns whether the drug is dispensed

func (*Drug) Name

func (d *Drug) Name() string

return the name of the drug

func (*Drug) Prescribed

func (d *Drug) Prescribed() bool

returns whether the drug is prescribed

func (*Drug) Requested

func (d *Drug) Requested() bool

returns whether the drug is requested

type ERROR

type ERROR struct {
	*RXH
	Status *Status
}

Message type: ERROR

type Name

type Name struct {
	Last   string
	First  string
	Middle string
	Suffix string
	Prefix string
}

type Patient

type Patient struct {
	Relationship string // 010 C

	// format: CCYYMMDD
	Dob time.Time // 020 C

	// made up of the components:
	// last, first, middle, suffix, prefix
	Name *Name // 030-* M

	// Values:
	// M = Male
	// F = Female
	// U = Unknown
	Gender string // 040 C

	ReferenceNumber string // 050-00 M

	// default: 1D
	ReferenceQualifier string // 050-01 C

	// made up of the components:
	// line1, city, state, postal, location qualifier, location
	Address *Address // 060-* C

	// made up of the components:
	// number, qualifier
	// repeated n times
	Phones []*Phone // 070-* C
}

segment: PTT

type Phone

type Phone struct {
	Number    string
	Qualifier string
}

type Provider

type Provider struct {
	ProviderCode string // 010 M

	ReferenceNumber string // 020-00 M

	// Values:
	//   ZZ = NPI (not totally sure)
	//   HPI = NPI
	//   DH = DEA number
	//   DE = DEA number
	//   D3 = NCPDP Provider ID Number
	//   0B = State license number
	ReferenceQualifier string // 020-01 C

	// made up of the components:
	// last, first, middle, suffix, prefix
	Name *Name // 050-* C

	PartyName string // 070 C
}

segment: PVD defines a prescriber, pharmacy/pharmacist, and supervisor

type RXH

type RXH struct {

	//una
	UIB edifact.Values
	UIH edifact.Values

	UIT edifact.Values
	UIZ edifact.Values
}

base struct of all messages. required by EDIFACT and NCPDP script

type RXHRES

type RXHRES struct {
	*RXHREX

	Response            *Response
	RequestingPhysician *Provider
	Drugs               []*Drug
}

Response describing a patient’s medication history. Response to RXHREQ.

type RXHREX

type RXHREX struct {
	*RXH
	PVD edifact.Values
	PTT edifact.Values
	COO edifact.Values

	*Patient
}

base struct for RXHRES and RXHREQ

type Response

type Response struct {
	// A = Approved
	// D = Denied
	// C = Approved with changes
	// N = Denied, new prescription to
	// follow. Note: Value “N” is used in
	// REFRES transactions only.
	ResponseType string // 010 M

	// AQ= More History
	// Available. There may
	// be less then 50 drugs
	// in this response due to
	// payer processing.
	CodeListQualifier string // 020 C

	// transaction key
	ReferenceNumber string // 030 C

	// free text. could be an error
	Text string // 040 C
}

Segment: RES

type Status

type Status struct {
	StatusTypeCode    string // 010 M
	CodeListQualifier string // 020 C
	Text              string // 030 C
}

Segment: STS

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL