mph

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// claim-level repricing codes
	ClaimRepricingCodeMedicare            ClaimRepricingCode = "MED"
	ClaimRepricingCodeContractPricing     ClaimRepricingCode = "CON"
	ClaimRepricingCodeRBPPricing          ClaimRepricingCode = "RBP"
	ClaimRepricingCodeSingleCaseAgreement ClaimRepricingCode = "SCA"
	ClaimRepricingCodeNeedsMoreInfo       ClaimRepricingCode = "IFO"

	// line-level Medicare repricing codes
	LineRepricingCodeMedicare          LineRepricingCode = "MED"
	LineRepricingCodeSyntheticMedicare LineRepricingCode = "SYN"
	LineRepricingCodeCostPercent       LineRepricingCode = "CST"
	LineRepricingCodeMedicarePercent   LineRepricingCode = "MPT"
	LineRepricingCodeMedicareNoOutlier LineRepricingCode = "MNO"
	LineRepricingCodeBilledPercent     LineRepricingCode = "BIL"
	LineRepricingCodeFeeSchedule       LineRepricingCode = "FSC"
	LineRepricingCodePerDiem           LineRepricingCode = "PDM"
	LineRepricingCodeFlatRate          LineRepricingCode = "FLT"
	LineRepricingCodeLimitedToBilled   LineRepricingCode = "LTB"

	// line-level zero dollar repricing explanations
	LineRepricingCodeNotAllowedByMedicare  LineRepricingCode = "NAM"
	LineRepricingCodePackaged              LineRepricingCode = "PKG"
	LineRepricingCodeNeedsMoreInfo         LineRepricingCode = "IFO"
	LineRepricingCodeProcedureCodeProblem  LineRepricingCode = "CPB"
	LineRepricingCodeNotRepricedPerRequest LineRepricingCode = "NRP"

	// Hospital types
	AcuteCareHospitalType      HospitalType = "Acute Care Hospitals"
	CriticalAccessHospitalType HospitalType = "Critical Access Hospitals"
	ChildrensHospitalType      HospitalType = "Childrens"
	PsychiatricHospitalType    HospitalType = "Psychiatric"
	AcuteCareDODHospitalType   HospitalType = "Acute Care - Department of Defense"
)

Variables

View Source
var (
	NonPayBillTypeSequence                 BillTypeSequence = "0"
	AdmitThroughDischargeBillTypeSequence  BillTypeSequence = "1"
	FirstInterimBillTypeSequence           BillTypeSequence = "2"
	ContinuingInterimBillTypeSequence      BillTypeSequence = "3"
	LastInterimBillTypeSequence            BillTypeSequence = "4"
	LateChargeBillTypeSequence             BillTypeSequence = "5"
	FirstInterimBillTypeSequenceDeprecated BillTypeSequence = "6"
	ReplacementBillTypeSequence            BillTypeSequence = "7"
	VoidOrCancelBillTypeSequence           BillTypeSequence = "8"
	FinalClaimBillTypeSequence             BillTypeSequence = "9"
	CWFAdjustmentBillTypeSequence          BillTypeSequence = "G"
	CMSAdjustmentBillTypeSequence          BillTypeSequence = "H"
	IntermediaryAdjustmentBillTypeSequence BillTypeSequence = "I"
	OtherAdjustmentBillTypeSequence        BillTypeSequence = "J"
	OIGAdjustmentBillTypeSequence          BillTypeSequence = "K"
	MSPAdjustmentBillTypeSequence          BillTypeSequence = "M"
	QIOAdjustmentBillTypeSequence          BillTypeSequence = "P"
	ProviderAdjustmentBillTypeSequence     BillTypeSequence = "Q"
	SexTypeUnknown                         SexType          = 0
	SexTypeMale                            SexType          = 1
	SexTypeFemale                          SexType          = 2
)

Functions

This section is empty.

Types

type BillTypeSequence

type BillTypeSequence string // The location where the claim is at in its billing lifecycle (e.g. 0: Non-Pay, 1: Admit Through Discharge, 7: Replacement, etc.)

type Claim

type Claim struct {
	Provider                            // Provider information for the claim
	ClaimID            string           `json:"claimID,omitempty"`            // Unique identifier for the claim (from REF D9)
	PlanCode           string           `json:"planCode,omitempty"`           // Identifies the subscriber's plan (from SBR03)
	PatientSex         SexType          `json:"patientSex,omitempty"`         // Biological sex of the patient for clinical purposes (from DMG02). 0:Unknown, 1:Male, 2:Female
	PatientDateOfBirth *Date            `json:"patientDateOfBirth,omitempty"` // Patient date of birth (from DMG03)
	PatientHeightInCM  float64          `json:"patientHeightInCM,omitempty"`  // Patient height in centimeters (from HI value A9, MEA value HT)
	PatientWeightInKG  float64          `json:"patientWeightInKG,omitempty"`  // Patient weight in kilograms (from HI value A8, PAT08, CR102 [ambulance only])
	AmbulancePickupZIP string           `json:"ambulancePickupZIP,omitempty"` // Location where patient was picked up in ambulance (from HI with HIxx_01=BE and HIxx_02=A0 or NM1 loop with NM1 PW)
	FormType           FormType         `json:"formType,omitempty"`           // Type of form used to submit the claim. Can be HCFA or UB-04 (from CLM05_02)
	BillTypeOrPOS      string           `json:"billTypeOrPOS,omitempty"`      // Describes type of facility where services were rendered (from CLM05_01)
	BillTypeSequence   BillTypeSequence `json:"billTypeSequence,omitempty"`   // Where the claim is at in its billing lifecycle (e.g. 0: Non-Pay, 1: Admit Through Discharge, 7: Replacement, etc.) (from CLM05_03)
	BilledAmount       float64          `json:"billedAmount,omitempty"`       // Billed amount from provider (from CLM02)
	AllowedAmount      float64          `json:"allowedAmount,omitempty"`      // Amount allowed by the plan for payment. Both member and plan responsibility (non-EDI)
	PaidAmount         float64          `json:"paidAmount,omitempty"`         // Amount paid by the plan for the claim (non-EDI)
	DateFrom           Date             `json:"dateFrom,omitempty"`           // Earliest service date among services, or statement date if not found
	DateThrough        Date             `json:"dateThrough,omitempty"`        // Latest service date among services, or statement date if not found
	DischargeStatus    string           `json:"dischargeStatus,omitempty"`    // Status of the patient at time of discharge (from CL103)
	AdmitDiagnosis     string           `json:"admitDiagnosis,omitempty"`     // ICD diagnosis at the time the patient was admitted (from HI ABJ or BJ)
	PrincipalDiagnosis *Diagnosis       `json:"principalDiagnosis,omitempty"` // Principal ICD diagnosis for the patient (from HI ABK or BK)
	OtherDiagnoses     []Diagnosis      `json:"otherDiagnoses,omitempty"`     // Other ICD diagnoses that apply to the patient (from HI ABF or BF)
	PrincipalProcedure string           `json:"principalProcedure,omitempty"` // Principal ICD procedure for the patient (from HI BBR or BR)
	OtherProcedures    []string         `json:"otherProcedures,omitempty"`    // Other ICD procedures that apply to the patient (from HI BBQ or BQ)
	ConditionCodes     []string         `json:"conditionCodes,omitempty"`     // Special conditions that may affect payment or other processing (from HI BG)
	ValueCodes         []ValueCode      `json:"valueCodes,omitempty"`         // Numeric values related to the patient or claim (HI BE)
	OccurrenceCodes    []string         `json:"occurrenceCodes,omitempty"`    // Date related occurrences related to the patient or claim (from HI BH)
	DRG                string           `json:"drg,omitempty"`                // Diagnosis Related Group for inpatient services (from HI DR)
	Services           []Service        `json:"services,omitempty"`           // One or more services provided to the patient (from LX loop)
}

type ClaimEdits

type ClaimEdits struct {
	ClaimOverallDisposition          string   `json:"claimOverallDisposition,omitempty"`
	ClaimRejectionDisposition        string   `json:"claimRejectionDisposition,omitempty"`
	ClaimDenialDisposition           string   `json:"claimDenialDisposition,omitempty"`
	ClaimReturnToProviderDisposition string   `json:"claimReturnToProviderDisposition,omitempty"`
	ClaimSuspensionDisposition       string   `json:"claimSuspensionDisposition,omitempty"`
	LineItemRejectionDisposition     string   `json:"lineItemRejectionDisposition,omitempty"`
	LineItemDenialDisposition        string   `json:"lineItemDenialDisposition,omitempty"`
	ClaimRejectionReasons            []string `json:"claimRejectionReasons,omitempty"`
	ClaimDenialReasons               []string `json:"claimDenialReasons,omitempty"`
	ClaimReturnToProviderReasons     []string `json:"claimReturnToProviderReasons,omitempty"`
	ClaimSuspensionReasons           []string `json:"claimSuspensionReasons,omitempty"`
	LineItemRejectionReasons         []string `json:"lineItemRejectionReasons,omitempty"`
	LineItemDenialReasons            []string `json:"lineItemDenialReasons,omitempty"`
}

ClaimEdits contains errors which cause the claim to be denied, rejected, suspended, or returned to the provider.

type ClaimRepricingCode

type ClaimRepricingCode string

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is used to interact with the My Price Health API

func NewClient

func NewClient(doer sling.Doer, isTest bool, apiKey string) *Client

NewClient is used to create a new API client for the My Price Health API. In most cases it is simpler to use NewDefaultClient to create a client with the default settings.

func NewDefaultClient

func NewDefaultClient(apiKey string) *Client

NewDefaultClient is used to create a new API client for the My Price Health API with the default settings.

func (*Client) EstimateClaims added in v1.0.1

func (c *Client) EstimateClaims(ctx context.Context, inputs ...Claim) Responses[Pricing]

EstimateClaims is used to get the estimated Medicare reimbursement of multiple claims

func (*Client) EstimateRateSheet added in v1.0.1

func (c *Client) EstimateRateSheet(ctx context.Context, inputs ...RateSheet) Responses[Pricing]

EstimateRateSheet is used to get the estimated Medicare reimbursement of a single claim

func (*Client) Price

func (c *Client) Price(ctx context.Context, config PriceConfig, input Claim) Response[Pricing]

Price is used to get the Medicare reimbursement of a single claim

func (*Client) PriceBatch

func (c *Client) PriceBatch(ctx context.Context, config PriceConfig, inputs ...Claim) Responses[Pricing]

PriceBatch is used to get the Medicare reimbursement of multiple claims

type Date

type Date struct {
	Time time.Time
}

Date is a custom type for representing dates in the format YYYYMMDD

func NewDate

func NewDate(year, month, day int) Date

NewDate is used to create a new Date object

func NewDatePtr

func NewDatePtr(year, month, day int) *Date

NewDatePtr is used to create a pointer to a new Date object

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

type Diagnosis

type Diagnosis struct {
	Code               string `json:"code,omitempty"               fixed:"1,9"`   // ICD-10 diagnosis code (from HIxx_02)
	PresentOnAdmission string `json:"presentOnAdmission,omitempty" fixed:"10,13"` // Flag indicates whether diagnosis was present at the time of admission (from HIxx_09)
}

type FormType

type FormType string // Type of form used to submit the claim. Can be HCFA or UB-04
var (
	UBFormType   FormType = "UB-04"
	HCFAFormType FormType = "HCFA"
)

type HospitalType

type HospitalType string

type InpatientPriceDetail

type InpatientPriceDetail struct {
	DRG                            string  `json:"drg,omitempty"`                            // Diagnosis Related Group (DRG) code used to price the claim
	DRGAmount                      float64 `json:"drgAmount,omitempty"`                      // Amount Medicare would pay for the DRG
	PassthroughAmount              float64 `json:"passthroughAmount,omitempty"`              // Per diem amount to cover capital-related costs, direct medical education, and other costs
	OutlierAmount                  float64 `json:"outlierAmount,omitempty"`                  // Additional amount paid for high cost cases
	IndirectMedicalEducationAmount float64 `json:"indirectMedicalEducationAmount,omitempty"` // Additional amount paid for teaching hospitals
	DisproportionateShareAmount    float64 `json:"disproportionateShareAmount,omitempty"`    // Additional amount paid for hospitals with a high number of low-income patients
	UncompensatedCareAmount        float64 `json:"uncompensatedCareAmount,omitempty"`        // Additional amount paid for patients who are unable to pay for their care
	ReadmissionAdjustmentAmount    float64 `json:"readmissionAdjustmentAmount,omitempty"`    // Adjustment amount for hospitals with high readmission rates
	ValueBasedPurchasingAmount     float64 `json:"valueBasedPurchasingAmount,omitempty"`     // Adjustment for hospitals based on quality measures
}

InpatientPriceDetail contains pricing details for an inpatient claim

type LineEdits

type LineEdits struct {
	DenialOrRejectionText string   `json:"denialOrRejectionText,omitempty"`
	ProcedureEdits        []string `json:"procedureEdits,omitempty"`
	Modifier1Edits        []string `json:"modifier1Edits,omitempty"`
	Modifier2Edits        []string `json:"modifier2Edits,omitempty"`
	Modifier3Edits        []string `json:"modifier3Edits,omitempty"`
	Modifier4Edits        []string `json:"modifier4Edits,omitempty"`
	Modifier5Edits        []string `json:"modifier5Edits,omitempty"`
	DataEdits             []string `json:"dataEdits,omitempty"`
	RevenueEdits          []string `json:"revenueEdits,omitempty"`
	ProfessionalEdits     []string `json:"professionalEdits,omitempty"`
}

LineEdits contains errors which cause the line item to be unable to be priced.

type LineRepricingCode

type LineRepricingCode string

type OutpatientPriceDetail

type OutpatientPriceDetail struct {
	OutlierAmount                         float64 `json:"outlierAmount,omitempty"`                         // Additional amount paid for high cost cases
	FirstPassthroughDrugOffsetAmount      float64 `json:"firstPassthroughDrugOffsetAmount,omitempty"`      // Amount built into the APC payment for certain drugs
	SecondPassthroughDrugOffsetAmount     float64 `json:"secondPassthroughDrugOffsetAmount,omitempty"`     // Amount built into the APC payment for certain drugs
	ThirdPassthroughDrugOffsetAmount      float64 `json:"thirdPassthroughDrugOffsetAmount,omitempty"`      // Amount built into the APC payment for certain drugs
	FirstDeviceOffsetAmount               float64 `json:"firstDeviceOffsetAmount,omitempty"`               // Amount built into the APC payment for certain devices
	SecondDeviceOffsetAmount              float64 `json:"secondDeviceOffsetAmount,omitempty"`              // Amount built into the APC payment for certain devices
	FullOrPartialDeviceCreditOffsetAmount float64 `json:"fullOrPartialDeviceCreditOffsetAmount,omitempty"` // Credit for devices that are supplied for free or at a reduced cost
	TerminatedDeviceProcedureOffsetAmount float64 `json:"terminatedDeviceProcedureOffsetAmount,omitempty"` // Credit for devices that are not used due to a terminated procedure
}

OutpatientPriceDetail contains pricing details for an outpatient claim

type PriceConfig

type PriceConfig struct {
	IsCommercial                        bool    // set to true to use commercial code crosswalks
	DisableCostBasedReimbursement       bool    // by default, the API will use cost-based reimbursement for MAC priced line-items. This is the best estimate we have for this proprietary pricing
	UseCommercialSyntheticForNotAllowed bool    // set to true to use a synthetic Medicare price for line-items that are not allowed by Medicare
	UseDRGFromGrouper                   bool    // set to true to always use the DRG from the inpatient grouper
	UseBestDRGPrice                     bool    // set to true to use the best DRG price between the price on the claim and the price from the grouper
	OverrideThreshold                   float64 // set to a value greater than 0 to allow the pricer flexibility to override NCCI edits and other overridable errors and return a price
	IncludeEdits                        bool    // set to true to include edit details in the response
}

PriceConfig is used to configure the behavior of the pricing API

type PricedService

type PricedService struct {
	LineNumber                  string            `json:"lineNumber,omitempty"`              // Number of the service line item (copied from input)
	ProviderDetail              *ProviderDetail   `json:"providerDetail,omitempty"`          // Provider Details used when pricing the service if different than the claim
	MedicareAmount              float64           `json:"medicareAmount,omitempty"`          // Amount Medicare would pay for the service
	AllowedAmount               float64           `json:"allowedAmount,omitempty"`           // Allowed amount based on a contract or RBP pricing
	AllowedCalculationError     string            `json:"allowedCalculationError,omitempty"` // Reason the allowed amount was not calculated
	RepricingCode               LineRepricingCode `json:"repricingCode,omitempty"`           // Explains the methodology used to calculate Medicare
	RepricingNote               string            `json:"repricingNote,omitempty"`           // Note explaining approach for pricing or reason for error
	TechnicalComponentAmount    float64           `json:"tcAmount,omitempty"`                // Amount Medicare would pay for the technical component
	ProfessionalComponentAmount float64           `json:"pcAmount,omitempty"`                // Amount Medicare would pay for the professional component
	MedicareStdDev              float64           `json:"medicareStdDev,omitempty"`          // Standard deviation of the estimated Medicare amount (estimates service only)
	MedicareSource              string            `json:"medicareSource,omitempty"`          // Source of the Medicare amount (e.g. physician fee schedule, OPPS, etc.)
	PricerResult                string            `json:"pricerResult,omitempty"`            // Pricing service return details
	StatusIndicator             string            `json:"statusIndicator,omitempty"`         // Code which gives more detail about how Medicare pays for the service
	PaymentIndicator            string            `json:"paymentIndicator,omitempty"`        // Text which explains the type of payment for Medicare
	PaymentAPC                  string            `json:"paymentAPC,omitempty"`              // Ambulatory Payment Classification
	EditDetail                  *LineEdits        `json:"editDetail,omitempty"`              // Errors which cause the line item to be unable to be priced
}

PricedService contains the results of a pricing request for a single service line

type Pricer

type Pricer interface {
	Price(ctx context.Context, config PriceConfig, input Claim) Response[Pricing]
	PriceBatch(ctx context.Context, config PriceConfig, inputs ...Claim) Responses[Pricing]
	EstimateClaims(ctx context.Context, inputs ...Claim) Responses[Pricing]
	EstimateRateSheet(ctx context.Context, inputs ...RateSheet) Responses[Pricing]
}

Pricer is the interface that wraps the Price and PriceBatch methods

type Pricing

type Pricing struct {
	ClaimID                 string                 `json:"claimID,omitempty"`                 // The unique identifier for the claim (copied from input)
	MedicareAmount          float64                `json:"medicareAmount,omitempty"`          // The amount Medicare would pay for the service
	AllowedAmount           float64                `json:"allowedAmount,omitempty"`           // The allowed amount based on a contract or RBP pricing
	AllowedCalculationError string                 `json:"allowedCalculationError,omitempty"` // The reason the allowed amount was not calculated
	MedicareRepricingCode   ClaimRepricingCode     `json:"medicareRepricingCode,omitempty"`   // Explains the methodology used to calculate Medicare (MED or IFO)
	MedicareRepricingNote   string                 `json:"medicareRepricingNote,omitempty"`   // Note explaining approach for pricing or reason for error
	AllowedRepricingCode    ClaimRepricingCode     `json:"allowedRepricingCode,omitempty"`    // Explains the methodology used to calculate allowed amount (CON, RBP, SCA, or IFO)
	AllowedRepricingNote    string                 `json:"allowedRepricingNote,omitempty"`    // Note explaining approach for pricing or reason for error
	MedicareStdDev          float64                `json:"medicareStdDev,omitempty"`          // The standard deviation of the estimated Medicare amount (estimates service only)
	MedicareSource          string                 `json:"medicareSource,omitempty"`          // Source of the Medicare amount (e.g. physician fee schedule, OPPS, etc.)
	InpatientPriceDetail    *InpatientPriceDetail  `json:"inpatientPriceDetail,omitempty"`    // Details about the inpatient pricing
	OutpatientPriceDetail   *OutpatientPriceDetail `json:"outpatientPriceDetail,omitempty"`   // Details about the outpatient pricing
	ProviderDetail          *ProviderDetail        `json:"providerDetail,omitempty"`          // The provider details used when pricing the claim
	EditDetail              *ClaimEdits            `json:"editDetail,omitempty"`              // Errors which cause the claim to be denied, rejected, suspended, or returned to the provider
	PricerResult            string                 `json:"pricerResult,omitempty"`            // Pricer return details
	Services                []Service              `json:"services,omitempty"`                // Pricing for each service line on the claim
	EditError               *ResponseError         `json:"error,omitempty"`                   // An error that occurred during some step of the pricing process
}

Pricing contains the results of a pricing request

type Provider

type Provider struct {
	NPI                      string   `json:"npi,omitempty"`                      // National Provider Identifier of the provider (from NM109, required)
	ProviderTaxID            string   `json:"providerTaxID,omitempty"`            // Tax ID of the provider (from REF highly recommended)
	ProviderPhones           []string `json:"providerPhones,omitempty"`           // Phone numbers of the provider (from PER, optional)
	ProviderFaxes            []string `json:"providerFaxes,omitempty"`            // Fax numbers of the provider (from PER, optional)
	ProviderEmails           []string `json:"providerEmails,omitempty"`           // Email addresses of the provider (from PER, optional)
	ProviderLicenseNumber    string   `json:"providerLicenseNumber,omitempty"`    // State license number of the provider (from REF 0B, optional)
	ProviderCommercialNumber string   `json:"providerCommercialNumber,omitempty"` // Commercial number of the provider used by some payers (from REF G2, optional)
	ProviderTaxonomy         string   `json:"providerTaxonomy,omitempty"`         // Taxonomy code of the provider (from PRV03, highly recommended)
	ProviderFirstName        string   `json:"providerFirstName,omitempty"`        // First name of the provider (NM104, highly recommended)
	ProviderLastName         string   `json:"providerLastName,omitempty"`         // Last name of the provider (from NM103, highly recommended)
	ProviderOrgName          string   `json:"providerOrgName,omitempty"`          // Organization name of the provider (from NM103, highly recommended)
	ProviderAddress1         string   `json:"providerAddress1,omitempty"`         // Address line 1 of the provider (from N301, highly recommended)
	ProviderAddress2         string   `json:"providerAddress2,omitempty"`         // Address line 2 of the provider (from N302, optional)
	ProviderCity             string   `json:"providerCity,omitempty"`             // City of the provider (from N401, highly recommended)
	ProviderState            string   `json:"providerState,omitempty"`            // State of the provider (from N402, highly recommended)
	ProviderZIP              string   `json:"providerZIP,omitempty"`              // ZIP code of the provider (from N403, required)
}

type ProviderDetail

type ProviderDetail struct {
	CCN            string       `json:"ccn,omitempty"`           // CMS Certification Number for the facility
	MAC            uint16       `json:"mac"`                     // Medicare Administrative Contractor number
	Locality       uint8        `json:"locality"`                // Geographic locality number used for pricing
	RuralIndicator byte         `json:"ruralIndicator"`          // Indicates whether provider is Rural (R), Super Rural (B), or Urban (blank)
	SpecialtyType  string       `json:"specialtyType,omitempty"` // Medicare provider specialty type
	HospitalType   HospitalType `json:"hospitalType,omitempty"`  // Type of hospital
}

ProviderDetail contains basic information about the provider and/or locality used for pricing. Not all fields are returned with every pricing request. For example, the CMS Certification Number (CCN) is only returned for facilities which have a CCN such as hospitals.

type RateSheet added in v1.0.1

type RateSheet struct {
	NPI               string             `json:"npi,omitempty"`               // National Provider Identifier of the provider (from NM109, required)
	ProviderFirstName string             `json:"providerFirstName,omitempty"` // First name of the provider (NM104, highly recommended)
	ProviderLastName  string             `json:"providerLastName,omitempty"`  // Last name of the provider (from NM103, highly recommended)
	ProviderOrgName   string             `json:"providerOrgName,omitempty"`   // Organization name of the provider (from NM103, highly recommended)
	ProviderAddress   string             `json:"providerAddress,omitempty"`   // Address of the provider (from N301, highly recommended)
	ProviderCity      string             `json:"providerCity,omitempty"`      // City of the provider (from N401, highly recommended)
	ProviderState     string             `json:"providerState"`               // State of the provider (from N402, highly recommended)
	ProviderZip       string             `json:"providerZIP"`                 // ZIP code of the provider (from N403, required)
	FormType          FormType           `json:"formType"`                    // Type of form used to submit the claim. Can be HCFA or UB-04 (from CLM05_02)
	BillTypeOrPOS     string             `json:"billTypeOrPOS"`               // Describes type of facility where services were rendered (from CLM05_01)
	DRG               string             `json:"drg,omitempty"`               // Diagnosis Related Group for inpatient services (from HI DR)
	BilledAmount      float64            `json:"billedAmount,omitempty"`      // Billed amount from provider (from CLM02)
	AllowedAmount     float64            `json:"allowedAmount,omitempty"`     // Amount allowed by the plan for payment. Both member and plan responsibility (non-EDI)
	PaidAmount        float64            `json:"paidAmount,omitempty"`        // Amount paid by the plan for the claim (non-EDI)
	Services          []RateSheetService `json:"services,omitempty"`          // One or more services provided to the patient (from LX loop)
}

type RateSheetService added in v1.0.1

type RateSheetService struct {
	ProcedureCode      string   `json:"procedureCode,omitempty"`      // Procedure code (from SV101_02 / SV202_02)
	ProcedureModifiers []string `json:"procedureModifiers,omitempty"` // Procedure modifiers (from SV101_03, 4, 5, 6 / SV202_03, 4, 5, 6)
	BilledAmount       float64  `json:"billedAmount,omitempty"`       // Billed charge for the service (from SV102 / SV203)
	AllowedAmount      float64  `json:"allowedAmount,omitempty"`      // Plan allowed amount for the service (non-EDI)
}

type Response

type Response[Result any] struct {
	Error      *ResponseError `json:"error,omitempty"`  // supplied when entire response is an error
	Result     Result         `json:"result,omitempty"` // supplied on success. Will be a single object.
	StatusCode int            `json:"status"`           // supplied on success and error
}

Response contains the standardized API response data used by all My Price Health API's. It is based off of the generalized error handling recommendation found in IETF RFC 7807 https://tools.ietf.org/html/rfc7807 and is a simplification of the Spring Boot error response as described at https://www.baeldung.com/rest-api-error-handling-best-practices

An error response might look like this:
{
	"error: {
		"title": "Incorrect username or password.",
		"detail": "Authentication failed due to incorrect username or password.",
	}
	"status": 401,
}

A successful response with a single result might look like this:

{
	"result": {
		"procedureCode": "ABC",
		"billedAverage": 15.23
	},
	"status": 200,
}

func (*Response[Result]) UnmarshalJSON

func (r *Response[Result]) UnmarshalJSON(data []byte) error

type ResponseError

type ResponseError struct {
	Title  string `json:"title,omitempty"`
	Detail string `json:"detail,omitempty"`
}

ResponseError supplies detailed error information when an entire request or an item in a response fails

func (*ResponseError) Error

func (e *ResponseError) Error() string

type Responses

type Responses[Result any] struct {
	Error        *ResponseError `json:"error,omitempty"`   // supplied when entire response is an error
	Results      []Result       `json:"results,omitempty"` // A slice of results that will either be a successful result or an error.
	SuccessCount int            `json:"successCount"`      // count of successful results when WriteResults is called
	ErrorCount   int            `json:"errorCount"`        // count of errored results when WriteResults is called
	StatusCode   int            `json:"status"`            // supplied on success and error
}

Responses contains the standardized API response data used by all My Price Health API's. It is based off of the generalized error handling recommendation found in IETF RFC 7807 https://tools.ietf.org/html/rfc7807 and is a simplification of the Spring Boot error response as described at https://www.baeldung.com/rest-api-error-handling-best-practices

A response with one success and one failure might look like this:
{
	"results": [
		{
			"procedureCode": "ABC",
			"billedAverage": 15.23
		},
		{
			"error": {
				"title": "invalid procedure code",
				"detail": "unable to find procedure code `DEF` in the list of valid procedure codes"
			}
		}
	],
	"status": 200,
	"successCount": 1,
	"errorCount": 1,
}

A successful response with multiple results might look like this (note no embedded error field):

{
	"results": [
		{
			"procedureCode": "ABC",
			"billedAverage": 15.23
		},
		{
			"procedureCode": "DEF",
			"billedAverage": 12.22
		}
	],
	"status": 200,
	"successCount": 2,
	"errorCount": 0,
}

func (*Responses[Result]) UnmarshalJSON

func (r *Responses[Result]) UnmarshalJSON(data []byte) error

type Service

type Service struct {
	Provider                    // Additional provider information specific to this service item
	LineNumber         string   `json:"lineNumber,omitempty"`         // Unique line number for the service item (from LX01)
	RevCode            string   `json:"revCode,omitempty"`            // Revenue code (from SV2_01)
	ProcedureCode      string   `json:"procedureCode,omitempty"`      // Procedure code (from SV101_02 / SV202_02)
	ProcedureModifiers []string `json:"procedureModifiers,omitempty"` // Procedure modifiers (from SV101_03, 4, 5, 6 / SV202_03, 4, 5, 6)
	DrugCode           string   `json:"drugCode,omitempty"`           // National Drug Code (from LIN03)
	DateFrom           Date     `json:"dateFrom,omitempty"`           // Begin date of service (from DTP 472)
	DateThrough        Date     `json:"dateThrough,omitempty"`        // End date of service (from DTP 472)
	BilledAmount       float64  `json:"billedAmount,omitempty"`       // Billed charge for the service (from SV102 / SV203)
	AllowedAmount      float64  `json:"allowedAmount,omitempty"`      // Plan allowed amount for the service (non-EDI)
	PaidAmount         float64  `json:"paidAmount,omitempty"`         // Plan paid amount for the service (non-EDI)
	Quantity           float64  `json:"quantity"`                     // Quantity of the service (from SV104 / SV205)
	Units              string   `json:"units,omitempty"`              // Units connected to the quantity given (from SV103 / SV204)
	PlaceOfService     string   `json:"placeOfService,omitempty"`     // Place of service code (from SV105)
	DiagnosisPointers  []int8   `json:"diagnosisPointers,omitempty"`  // Diagnosis pointers (from SV107)
	AmbulancePickupZIP string   `json:"ambulancePickupZIP,omitempty"` // ZIP code where ambulance picked up patient. Supplied if different than claim-level value (from NM1 PW)
}

type SexType

type SexType uint8 // Biological sex of the patient for clinical purposes

type ValueCode

type ValueCode struct {
	Code   string          `json:"code,omitempty"   fixed:"1,2"`        // Code indicating the type of value provided (from HIxx_02)
	Amount decimal.Decimal `json:"amount,omitempty" fixed:"3,11,right"` // Amount associated with the value code (from HIxx_05)
}

Jump to

Keyboard shortcuts

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