models

package
v0.0.0-...-41bf266 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BlankFileName string = "blank.ndjson"

BlankFileName contains the naming convention for empty ndjson file

Variables

Functions

func SetMockRepository

func SetMockRepository(t *testing.T, other *MockRepository)

SetMockRepository sets the current repository to the one that's supplied in this function. It leverages the Cleanup() func to ensure the original repository is restored at the end of the test.

Types

type ACO

type ACO struct {
	ID                 uint
	UUID               uuid.UUID    `json:"uuid"`
	CMSID              *string      `json:"cms_id"`
	Name               string       `json:"name"`
	ClientID           string       `json:"client_id"`
	GroupID            string       `json:"group_id"`
	SystemID           string       `json:"system_id"`
	TerminationDetails *Termination `json:"termination"`
}

ACO represents an Accountable Care Organization.

func (*ACO) Blacklisted

func (aco *ACO) Blacklisted() bool

Blacklisted returns bool based on TerminationDetails.

type Alr

type Alr struct {
	ID            uint
	MetaKey       uint // Foreign Key
	BeneMBI       string
	BeneHIC       string
	BeneFirstName string
	BeneLastName  string
	BeneSex       string
	BeneDOB       time.Time
	BeneDOD       time.Time
	KeyValue      map[string]string // All "violate" fields
	Timestamp     time.Time         // NOT in the database, from AlrMetaData
}

Data Structure for storing information into database

type AlrMBIs

type AlrMBIs struct {
	MBIS            []string
	Metakey         int64
	CMSID           string
	TransactionTime time.Time
}

Wrap AlrMBIs as []string to ensure not any []string is accepted See repository.go for more info... particularly GetAlrMBIs func

type AlrMetaData

type AlrMetaData struct {
	ID        uint // Primary Key
	CMSID     string
	Timestamp time.Time
}

type Attribution

type Attribution uint8
const (
	AttributionHistorical Attribution = iota
	AttributionLatest
)

type AttributionFileStatusResponse

type AttributionFileStatusResponse struct {
	// in: body
	Body AttributionFilesParam `json:"body,omitempty"`
}

JSON object containing a cclf_files field swagger:response AttributionFileStatusResponse

type AttributionFilesParam

type AttributionFilesParam struct {
	IngestionDates []IngestionDatesStatusParam `json:"ingestion_dates"`
}

type AuthResponse

type AuthResponse struct {
	// in: body
	Body struct {
		// Required: true
		Version string `json:"auth_provider"`
	}
}

JSON object containing an auth_provider field swagger:response AuthResponse

type BadRequestResponse

type BadRequestResponse struct {
	// in: body
	Body OperationOutcomeResponse
}

There was a problem with the request. The body will contain a FHIR OperationOutcome resource in JSON format. https://www.hl7.org/fhir/operationoutcome.html Please refer to the body of the response for details. swagger:response badRequestResponse

type Blacklist

type Blacklist uint8
const (
	// Involuntary means the caller had access revoked immediately
	Involuntary Blacklist = iota
	// Voluntary means the caller had limited access then had their access completely revoked
	Voluntary
	// Limited means the caller has limited access to the service
	Limited
)

type BulkRequestHeaders

type BulkRequestHeaders struct {
	// required: true
	// in: header
	// enum: respond-async
	Prefer string
}

swagger:parameters bulkPatientRequest bulkGroupRequest bulkPatientRequestV2 bulkGroupRequestV2

type BulkRequestResponse

type BulkRequestResponse struct {
	// The location where the job status can be checked
	ContentLocation string `json:"Content-Location"`
}

BulkRequestResponse is the return from a request to initiate a bulk data collection process swagger:response BulkRequestResponse

type BundleResponse

type BundleResponse struct {
	// Bundle
	ResourceType string `json:"resourceType"`
	// Total number of entries
	Total int `json:"total"`
	// Searchset
	Type string `json:"type"`

	Entry []EntryResponse `json:"entry"`
}

type CCLFBeneficiary

type CCLFBeneficiary struct {
	ID           uint
	FileID       uint
	MBI          string
	BlueButtonID string
}

"The MBI has 11 characters, like the Health Insurance Claim Number (HICN), which can have up to 11." https://www.cms.gov/Medicare/New-Medicare-Card/Understanding-the-MBI-with-Format.pdf

type CCLFFile

type CCLFFile struct {
	ID              uint
	CCLFNum         int
	Name            string
	ACOCMSID        string
	Timestamp       time.Time
	PerformanceYear int
	ImportStatus    string
	Type            CCLFFileType
	// CreatedAt is automatically set by the database. This is only
	// set/pulled when querying data in the DB.
	CreatedAt time.Time
}

type CCLFFileType

type CCLFFileType int16
const (
	FileTypeDefault CCLFFileType = iota
	FileTypeRunout
)

func (CCLFFileType) String

func (t CCLFFileType) String() string

String returns the letter associated with the CCLFFileType.

type Claims

type Claims uint8
const (
	ClaimsHistorical Claims = iota
	ClaimsLatest
)

type DeleteJobResponse

type DeleteJobResponse struct {
}

The job has been deleted. swagger:response deleteJobResponse

type EntryResponse

type EntryResponse struct {
	Resource struct {
		// Task
		ResourceType string `json:"resourceType"`
		// Order
		Intent string `json:"intent"`
		// Job Status
		Status string `json:"status"`

		ExecutionPeriod struct {
			// Time job started
			Start time.Time `json:"start"`
			// Time job completed
			End time.Time `json:"end"`
		}
		Identifier struct {
			// Url for jobs statuses
			System string `json:"system"`
			// Official
			Use string `json:"use"`
			// Job Id
			Value string `json:"value"`
		} `json:"identifier"`
		Input []struct {
			Type struct {
				// BULK FHIR Export
				Text string `json:"text"`
			} `json:"type"`
			// Original job request url
			ValueString string `json:"valueString"`
		} `json:"input"`
	} `json:"resource"`
}

type ErrorResponse

type ErrorResponse struct {
	// in: body
	Body OperationOutcomeResponse
}

An error occurred. The body will contain a FHIR OperationOutcome resource in JSON format. https://www.hl7.org/fhir/operationoutcome.html Please refer to the body of the response for details. swagger:response errorResponse

type FileNDJSON

type FileNDJSON struct {
	// Header defining encoding type used
	// enum: gzip
	ContentEncoding string `json:"Content-Encoding"`
	// in: body
	Body NDJSON
}

File of newline-delimited JSON FHIR objects swagger:response FileNDJSON

type FileParam

type FileParam struct {
	// Name of file to be downloaded
	// in: path
	// required: true
	Filename string `json:"filename"`
}

swagger:parameters serveData

type GoneResponse

type GoneResponse struct {
	// in: body
	Body OperationOutcomeResponse
}

The requested resource is no longer available. The body will contain a FHIR OperationOutcome resource in JSON format. https://www.hl7.org/fhir/operationoutcome.html swagger:response goneResponse

type GroupIDParam

type GroupIDParam struct {
	// ID of group export
	// in: path
	// required: true
	// enum: all,runout
	GroupID string `json:"groupId"`
}

A BulkGroupRequest parameter model.

This is used for operations that want the groupID of a group in the path swagger:parameters bulkGroupRequest bulkGroupRequestV2

type IngestionDatesStatusParam

type IngestionDatesStatusParam struct {
	Timestamp time.Time `json:"timestamp"`
	Type      string    `json:"type"`
}

type InvalidCredentials

type InvalidCredentials struct{}

Unauthorized. The provided credentials are invalid for the requested resource. swagger:response invalidCredentials

type Job

type Job struct {
	ID                uint
	ACOID             uuid.UUID `json:"aco_id"`
	RequestURL        string    `json:"request_url"` // request_url
	Status            JobStatus `json:"status"`      // status
	TransactionTime   time.Time // most recent data load transaction time from BFD
	JobCount          int
	CompletedJobCount int
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

func (*Job) StatusMessage

func (j *Job) StatusMessage() string

type JobAlrEnqueueArgs

type JobAlrEnqueueArgs struct {
	ID              uint
	CMSID           string
	MBIs            []string
	ResourceType    []string // Currently Not Used
	MetaKey         int64
	BBBasePath      string
	LowerBound      time.Time // Currently Not Used
	UpperBound      time.Time // Currently Not Used
	TransactionTime time.Time
}

There is no AlrJobs struct because ALR uses Job struct from BFD

type JobEnqueueArgs

type JobEnqueueArgs struct {
	ID              int
	ACOID           string
	CMSID           string
	BeneficiaryIDs  []string
	ResourceType    string
	Since           string
	TransactionID   string
	TransactionTime time.Time
	BBBasePath      string
	ClaimsWindow    struct {
		LowerBound time.Time
		UpperBound time.Time
	}
	DataType string
}

type JobIDParam

type JobIDParam struct {
	// ID of data export job
	//
	// in: path
	// required: true
	JobID int `json:"jobId"`
}

A JobStatus parameter model.

This is used for operations that want the ID of a job in the path swagger:parameters jobStatus jobStatusV2 serveData deleteJob deleteJobV2

type JobKey

type JobKey struct {
	ID           uint
	JobID        uint `json:"job_id"`
	FileName     string
	ResourceType string
}

type JobKeyRepository

type JobKeyRepository interface {
	GetJobKeys(ctx context.Context, jobID uint) ([]*JobKey, error)

	GetJobKey(ctx context.Context, jobID uint, filename string) (*JobKey, error)
}

type JobStatus

type JobStatus string
const (
	JobStatusPending          JobStatus = "Pending"
	JobStatusInProgress       JobStatus = "In Progress"
	JobStatusCompleted        JobStatus = "Completed"
	JobStatusArchived         JobStatus = "Archived"
	JobStatusExpired          JobStatus = "Expired"
	JobStatusFailed           JobStatus = "Failed"
	JobStatusCancelled        JobStatus = "Cancelled"
	JobStatusFailedExpired    JobStatus = "FailedExpired"    // JobStatusFailedExpired represents a job that failed whose data has been cleaned up
	JobStatusCancelledExpired JobStatus = "CancelledExpired" // JobStatusCancelledExpired represents a job that has been cancelled whose data has been cleaned up
)

type JobStatusResponse

type JobStatusResponse struct {
	// The status of the job progress
	XProgress string `json:"X-Progress"`
}

Data export job is in progress. swagger:response jobStatusResponse

type JobsStatusResponse

type JobsStatusResponse struct {
	Body BundleResponse
}

JSON object containing status of requested jobs. The body will contain a FHIR Bundle resource in JSON format https://www.hl7.org/fhir/bundle.html and FHIR Task resources for the Bundle entries in JSON format https://www.hl7.org/fhir/task.html swagger:response jobsStatusResponse

type MetadataResponse

type MetadataResponse struct {
	// in: body
	Body fhirmodels.CapabilityStatement `json:"body,omitempty"`
}

FHIR CapabilityStatement in JSON format swagger:response MetadataResponse

type MissingCredentials

type MissingCredentials struct{}

Missing credentials swagger:response missingCredentials

type MockRepository

type MockRepository struct {
	mock.Mock
}

MockRepository is an autogenerated mock type for the Repository type

func (*MockRepository) CreateACO

func (_m *MockRepository) CreateACO(ctx context.Context, aco ACO) error

CreateACO provides a mock function with given fields: ctx, aco

func (*MockRepository) CreateCCLFFile

func (_m *MockRepository) CreateCCLFFile(ctx context.Context, cclfFile CCLFFile) (uint, error)

CreateCCLFFile provides a mock function with given fields: ctx, cclfFile

func (*MockRepository) CreateJob

func (_m *MockRepository) CreateJob(ctx context.Context, j Job) (uint, error)

CreateJob provides a mock function with given fields: ctx, j

func (*MockRepository) CreateSuppression

func (_m *MockRepository) CreateSuppression(ctx context.Context, suppression optout.OptOutRecord) error

CreateSuppression provides a mock function with given fields: ctx, suppression

func (*MockRepository) CreateSuppressionFile

func (_m *MockRepository) CreateSuppressionFile(ctx context.Context, suppressionFile optout.OptOutFile) (uint, error)

CreateSuppressionFile provides a mock function with given fields: ctx, suppressionFile

func (*MockRepository) GetACOByCMSID

func (_m *MockRepository) GetACOByCMSID(ctx context.Context, cmsID string) (*ACO, error)

GetACOByCMSID provides a mock function with given fields: ctx, cmsID

func (*MockRepository) GetACOByClientID

func (_m *MockRepository) GetACOByClientID(ctx context.Context, clientID string) (*ACO, error)

GetACOByClientID provides a mock function with given fields: ctx, clientID

func (*MockRepository) GetACOByUUID

func (_m *MockRepository) GetACOByUUID(ctx context.Context, _a1 uuid.UUID) (*ACO, error)

GetACOByUUID provides a mock function with given fields: ctx, _a1

func (*MockRepository) GetAlrMBIs

func (_m *MockRepository) GetAlrMBIs(ctx context.Context, cmsID string) (*AlrMBIs, error)

GetAlrMBIs provides a mock function with given fields: ctx, cmsID

func (*MockRepository) GetCCLFBeneficiaries

func (_m *MockRepository) GetCCLFBeneficiaries(ctx context.Context, cclfFileID uint, ignoredMBIs []string) ([]*CCLFBeneficiary, error)

GetCCLFBeneficiaries provides a mock function with given fields: ctx, cclfFileID, ignoredMBIs

func (*MockRepository) GetCCLFBeneficiaryMBIs

func (_m *MockRepository) GetCCLFBeneficiaryMBIs(ctx context.Context, cclfFileID uint) ([]string, error)

GetCCLFBeneficiaryMBIs provides a mock function with given fields: ctx, cclfFileID

func (*MockRepository) GetCCLFFileExistsByName

func (_m *MockRepository) GetCCLFFileExistsByName(ctx context.Context, name string) (bool, error)

GetCCLFFileExistsByName provides a mock function with given fields: ctx, name

func (*MockRepository) GetJobByID

func (_m *MockRepository) GetJobByID(ctx context.Context, jobID uint) (*Job, error)

GetJobByID provides a mock function with given fields: ctx, jobID

func (*MockRepository) GetJobKey

func (_m *MockRepository) GetJobKey(ctx context.Context, jobID uint, filename string) (*JobKey, error)

GetJobKey provides a mock function with given fields: ctx, jobID, filename

func (*MockRepository) GetJobKeys

func (_m *MockRepository) GetJobKeys(ctx context.Context, jobID uint) ([]*JobKey, error)

GetJobKeys provides a mock function with given fields: ctx, jobID

func (*MockRepository) GetJobs

func (_m *MockRepository) GetJobs(ctx context.Context, acoID uuid.UUID, statuses ...JobStatus) ([]*Job, error)

GetJobs provides a mock function with given fields: ctx, acoID, statuses

func (*MockRepository) GetJobsByUpdateTimeAndStatus

func (_m *MockRepository) GetJobsByUpdateTimeAndStatus(ctx context.Context, lowerBound time.Time, upperBound time.Time, statuses ...JobStatus) ([]*Job, error)

GetJobsByUpdateTimeAndStatus provides a mock function with given fields: ctx, lowerBound, upperBound, statuses

func (*MockRepository) GetLatestCCLFFile

func (_m *MockRepository) GetLatestCCLFFile(ctx context.Context, cmsID string, cclfNum int, importStatus string, lowerBound time.Time, upperBound time.Time, fileType CCLFFileType) (*CCLFFile, error)

GetLatestCCLFFile provides a mock function with given fields: ctx, cmsID, cclfNum, importStatus, lowerBound, upperBound, fileType

func (*MockRepository) GetSuppressedMBIs

func (_m *MockRepository) GetSuppressedMBIs(ctx context.Context, lookbackDays int, upperBound time.Time) ([]string, error)

GetSuppressedMBIs provides a mock function with given fields: ctx, lookbackDays, upperBound

func (*MockRepository) UpdateACO

func (_m *MockRepository) UpdateACO(ctx context.Context, acoUUID uuid.UUID, fieldsAndValues map[string]interface{}) error

UpdateACO provides a mock function with given fields: ctx, acoUUID, fieldsAndValues

func (*MockRepository) UpdateCCLFFileImportStatus

func (_m *MockRepository) UpdateCCLFFileImportStatus(ctx context.Context, fileID uint, importStatus string) error

UpdateCCLFFileImportStatus provides a mock function with given fields: ctx, fileID, importStatus

func (*MockRepository) UpdateJob

func (_m *MockRepository) UpdateJob(ctx context.Context, j Job) error

UpdateJob provides a mock function with given fields: ctx, j

func (*MockRepository) UpdateSuppressionFileImportStatus

func (_m *MockRepository) UpdateSuppressionFileImportStatus(ctx context.Context, fileID uint, importStatus string) error

UpdateSuppressionFileImportStatus provides a mock function with given fields: ctx, fileID, importStatus

type NDJSON

type NDJSON string

swagger:model

type NotFoundResponse

type NotFoundResponse struct {
	// in: body
	Body OperationOutcomeResponse
}

The requested path was not found. The body will contain a FHIR OperationOutcome resource in JSON format. https://www.hl7.org/fhir/operationoutcome.html swagger:response notFoundResponse

type OperationOutcomeResponse

type OperationOutcomeResponse struct {
	// OperationOutcome
	ResourceType string

	Issue struct {
		// Severity of the outcome: fatal | error | warning | information
		// Required: true
		Severity string
		//Error or warning code
		// Required: true
		Code string
		// Additional details about the error
		// Required: true
		Details string
		// Additional diagnostic information about the issue
		// Required: true
		Diagnostics string
		// Path of element(s) related to issue
		// Required: true
		Location string
		// FHIRPath of element(s) related to issue
		// Required: true
		Expression string
	}
}

type OptOut

type OptOut uint8
const (
	OptOutHistorical OptOut = iota
	OptOutLatest
)

type Patient

type Patient struct {
	// uuid identifier of this request
	ID   string `json:"id"`
	Meta struct {
		LastUpdated time.Time
	}
	Entry []struct {
		Resource struct {
			Identifier []struct {
				System string `json:"system"`
				Value  string `json:"value"`
			} `json:"identifier"`
			ID string `json:"id"`
		} `json:"resource"`
	} `json:"entry"`
}

type Repository

type Repository interface {
	JobKeyRepository
	// contains filtered or unexported methods
}

Repository contains all of the CRUD methods represented in the models package from the storage layer

type ResourceTypeParam

type ResourceTypeParam struct {
	// Resource types requested
	// in: query
	// style: form
	// explode: false
	ResourceType []string `json:"_type"`
}

swagger:parameters bulkPatientRequest bulkGroupRequest

type ResourceTypeParamV2

type ResourceTypeParamV2 struct {
	// Resource types requested
	// in: query
	// style: form
	// explode: false
	// required: true
	// items.enum: Coverage,Patient,ExplanationOfBenefit
	ResourceType []string `json:"_type"`
}

swagger:parameters bulkPatientRequestV2 bulkGroupRequestV2

type ServeDataRequestHeaders

type ServeDataRequestHeaders struct {
	// Encoding type to use
	// in: header
	// enum: gzip
	AcceptEncoding string `json:"Accept-Encoding"`
}

swagger:parameters serveData

type ServerError

type ServerError struct{}

Server error swagger:response serverError

type SinceParam

type SinceParam struct {
	// Only include resource versions that were created at or after the given instant in time.  Format of string must align with the FHIR Instant datatype (i.e., `2020-02-13T08:00:00.000-05:00`)
	// in: query
	// required: false
	DateTime string `json:"_since"`
}

swagger:parameters bulkPatientRequest bulkGroupRequest bulkPatientRequestV2 bulkGroupRequestV2

type StatusParam

type StatusParam struct {
	// Job statuses requested
	// in: query
	// style: form
	// explode: false
	// required: false
	// items.enum: Completed,Archived,Expired,Failed,FailedExpired,Pending,In Progress,Cancelled,CancelledExpired
	Status []JobStatus `json:"_status"`
}

swagger:parameters jobsStatus jobsStatusV2

type Termination

type Termination struct {
	TerminationDate time.Time // When caller moved from full to limited access
	CutoffDate      time.Time // When caller moved to no access

	BlacklistType       Blacklist
	AttributionStrategy Attribution
	OptOutStrategy      OptOut
	ClaimsStrategy      Claims
}

func (*Termination) AttributionDate

func (t *Termination) AttributionDate() time.Time

AttributionDate returns the date that should be used for attribution based on the associated attribution strategy. The returned date should be used as an upper bound when querying for attribution data.

func (*Termination) ClaimsDate

func (t *Termination) ClaimsDate() time.Time

ClaimsDate returns the date that should be used for claims based on the associated claims strategy. The returned date should be used as an upper bound when querying for claims data.

func (*Termination) OptOutDate

func (t *Termination) OptOutDate() time.Time

OptOutDate returns the date that should be used for opt-outs based on the associated opt-out strategy. The returned date should be used as an upper bound when querying for opt-out data.

type TokenResponse

type TokenResponse struct {
	// in: body
	Body struct {
		// Required: true
		AccessToken string `json:"access_token"`
		ExpiresIn   string `json:"expires_in,omitempty"`
		TokenType   string `json:"token_type"`
	}
}

JSON with a valid JWT swagger:response tokenResponse

type TooManyRequestsResponse

type TooManyRequestsResponse struct {
}

A bulk export job of this resource type is already in progress for the ACO. swagger:response tooManyRequestsResponse

type VersionResponse

type VersionResponse struct {
	// in: body
	Body struct {
		// Required: true
		Version string `json:"version"`
	}
}

JSON object containing a version field swagger:response VersionResponse

type Welcome

type Welcome struct{}

Welcome message swagger:response welcome

Directories

Path Synopsis
fhir package contains structs representing FHIR data.
fhir package contains structs representing FHIR data.
alr
postgrestest
Package postgrestest provides CRUD utilities for the postgres database.
Package postgrestest provides CRUD utilities for the postgres database.

Jump to

Keyboard shortcuts

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