Documentation
¶
Index ¶
- Constants
- Variables
- func SetMockRepository(t *testing.T, other *MockRepository)
- type ACO
- type Alr
- type AlrMBIs
- type AlrMetaData
- type Attribution
- type AttributionFileStatusResponse
- type AttributionFilesParam
- type AuthResponse
- type BadRequestResponse
- type BulkRequestHeaders
- type BulkRequestResponse
- type BundleResponse
- type CCLFBeneficiary
- type CCLFFile
- type CCLFFileType
- type Claims
- type DeleteJobResponse
- type Denylist
- type EntryResponse
- type ErrorResponse
- type FileNDJSON
- type FileParam
- type GoneResponse
- type GroupIDParam
- type IngestionDatesStatusParam
- type InvalidCredentials
- type Job
- type JobAlrEnqueueArgs
- type JobEnqueueArgs
- type JobIDParam
- type JobKey
- type JobKeyRepository
- type JobStatus
- type JobStatusResponse
- type JobsStatusResponse
- type MetadataResponse
- type MissingCredentials
- type MockRepository
- func (_m *MockRepository) CreateACO(ctx context.Context, aco ACO) error
- func (_m *MockRepository) CreateCCLFFile(ctx context.Context, cclfFile CCLFFile) (uint, error)
- func (_m *MockRepository) CreateJob(ctx context.Context, j Job) (uint, error)
- func (_m *MockRepository) CreateSuppression(ctx context.Context, suppression optout.OptOutRecord) error
- func (_m *MockRepository) CreateSuppressionFile(ctx context.Context, suppressionFile optout.OptOutFile) (uint, error)
- func (_m *MockRepository) GetACOByCMSID(ctx context.Context, cmsID string) (*ACO, error)
- func (_m *MockRepository) GetACOByClientID(ctx context.Context, clientID string) (*ACO, error)
- func (_m *MockRepository) GetACOByUUID(ctx context.Context, _a1 uuid.UUID) (*ACO, error)
- func (_m *MockRepository) GetAlrMBIs(ctx context.Context, cmsID string) (*AlrMBIs, error)
- func (_m *MockRepository) GetCCLFBeneficiaries(ctx context.Context, cclfFileID uint, ignoredMBIs []string) ([]*CCLFBeneficiary, error)
- func (_m *MockRepository) GetCCLFBeneficiaryMBIs(ctx context.Context, cclfFileID uint) ([]string, error)
- func (_m *MockRepository) GetCCLFFileExistsByName(ctx context.Context, name string) (bool, error)
- func (_m *MockRepository) GetJobByID(ctx context.Context, jobID uint) (*Job, error)
- func (_m *MockRepository) GetJobKey(ctx context.Context, jobID uint, filename string) (*JobKey, error)
- func (_m *MockRepository) GetJobKeys(ctx context.Context, jobID uint) ([]*JobKey, error)
- func (_m *MockRepository) GetJobs(ctx context.Context, acoID uuid.UUID, statuses ...JobStatus) ([]*Job, error)
- func (_m *MockRepository) GetJobsByUpdateTimeAndStatus(ctx context.Context, lowerBound time.Time, upperBound time.Time, ...) ([]*Job, error)
- func (_m *MockRepository) GetLatestCCLFFile(ctx context.Context, cmsID string, cclfNum int, importStatus string, ...) (*CCLFFile, error)
- func (_m *MockRepository) GetSuppressedMBIs(ctx context.Context, lookbackDays int, upperBound time.Time) ([]string, error)
- func (_m *MockRepository) UpdateACO(ctx context.Context, acoUUID uuid.UUID, fieldsAndValues map[string]interface{}) error
- func (_m *MockRepository) UpdateCCLFFileImportStatus(ctx context.Context, fileID uint, importStatus string) error
- func (_m *MockRepository) UpdateJob(ctx context.Context, j Job) error
- func (_m *MockRepository) UpdateSuppressionFileImportStatus(ctx context.Context, fileID uint, importStatus string) error
- type NDJSON
- type NotFoundResponse
- type OperationOutcomeResponse
- type OptOut
- type Patient
- type Repository
- type ResourceTypeParam
- type ResourceTypeParamV2
- type ServeDataRequestHeaders
- type ServerError
- type SinceParam
- type StatusParam
- type Termination
- type TokenResponse
- type TooManyRequestsResponse
- type VersionResponse
- type Welcome
Constants ¶
const ( QUE_PROCESS_JOB = "ProcessJob" ALR_JOB = "AlrJob" )
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) Denylisted ¶
Denylisted 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 ¶
Wrap AlrMBIs as []string to ensure not any []string is accepted See repository.go for more info... particularly GetAlrMBIs func
type AlrMetaData ¶
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 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 ¶
"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 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 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 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 CreatedAt time.Time UpdatedAt time.Time }
func (*Job) StatusMessage ¶
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 // parent Job ID 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 }
func (JobEnqueueArgs) Kind ¶
func (jobargs JobEnqueueArgs) Kind() string
Needed by River (queue library)
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 JobKeyRepository ¶
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 ¶
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 ¶
CreateCCLFFile provides a mock function with given fields: ctx, cclfFile
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 ¶
GetACOByCMSID provides a mock function with given fields: ctx, cmsID
func (*MockRepository) GetACOByClientID ¶
GetACOByClientID provides a mock function with given fields: ctx, clientID
func (*MockRepository) GetACOByUUID ¶
GetACOByUUID provides a mock function with given fields: ctx, _a1
func (*MockRepository) GetAlrMBIs ¶
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 ¶
GetCCLFFileExistsByName provides a mock function with given fields: ctx, name
func (*MockRepository) GetJobByID ¶
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 ¶
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 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 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 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 DenylistType Denylist 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.
func (*Termination) Scan ¶
func (t *Termination) Scan(value interface{}) error
Make the Termination struct implement the sql.Scanner interface. This method simply decodes a JSON-encoded value into the struct fields.
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
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
fhir package contains structs representing FHIR data.
|
fhir package contains structs representing FHIR data. |
postgrestest
Package postgrestest provides CRUD utilities for the postgres database.
|
Package postgrestest provides CRUD utilities for the postgres database. |