Documentation
¶
Overview ¶
Package pas reads Da Vinci Prior Authorization Support (PAS) request Bundles.
It is the reader Perfuse's own PAS server uses, published so that whatever decides a prior authorization - a payer's rules, a utilization management system, a decision service such as Vaglio - reads a request with the same code, and so the same answers about what a request contains. Two readers of one message format are two opinions about it.
It has no dependencies outside the standard library. A request is kept as decoded JSON (map[string]any) rather than as typed resources, because a PAS Bundle carries whatever supporting resources the provider chose to send, and a reader that dropped what it did not model would hide evidence from the decision.
req, problems := pas.Read(bundle, false)
if len(problems) > 0 {
// refuse: the request cannot be answered correctly
}
for _, svc := range req.Services() {
// svc.Codes, svc.Item, and req.Resolve for anything the item references
}
Index ¶
Constants ¶
const Base = "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/"
Base is the canonical base of the PAS StructureDefinitions.
const DataAbsentReason = "http://terminology.hl7.org/CodeSystem/data-absent-reason"
DataAbsentReason is the code system a CodeableConcept uses to say it has no value.
Variables ¶
This section is empty.
Functions ¶
func Map ¶
Map is v as a JSON object. Anything else is an empty object, never nil, so a chain of lookups into a sparse resource reads as absent rather than panicking.
func UsableCode ¶
UsableCode reports whether a CodeableConcept names something, rather than saying it has no code.
Types ¶
type Request ¶
type Request struct {
Bundle map[string]any
Claim map[string]any
ClaimURL string // fullUrl of the Claim's entry, the base relative references resolve against
Entries []map[string]any
}
Request is a PAS request Bundle, read: its Claim and how its references resolve.
func Read ¶
Read checks what is needed to answer a request and reports everything missing at once. It does not repeat the profile validation a client should have done; it refuses what could not be answered correctly.
inquiry relaxes the requirement that the Claim have items, which a $inquire does not need. A nil Request means the Bundle could not be read at all; a Request with problems was read but must not be answered.
func (*Request) Resolve ¶
Resolve finds the entry a reference names: by fullUrl, or relative to the Claim's base as FHIR resolves a relative reference inside a Bundle. It returns the entry, not the resource, so a caller can cite the entry's fullUrl.
func (*Request) Resources ¶
Resources returns every resource in the Bundle of the given type, with the entry each came from.
func (*Request) ServiceCodes ¶
ServiceCodes returns what an item says it is: its productOrService, and the code of every order its requestedService extension references. A CodeableConcept that says it has no code (a data-absent-reason) is not a code.
type Service ¶
type Service struct {
Sequence string // Claim.item.sequence, as text
Item map[string]any // the Claim.item itself
Codes []map[string]any // CodeableConcepts naming the service; empty when the item names none
}
Service is one requested service: a Claim item and the codes that say what it is.