handler

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDashboardLocation

func AddDashboardLocation(c *gin.Context)

func AuthSignin

func AuthSignin(c *gin.Context)

func AuthSignup

func AuthSignup(c *gin.Context)

func BackgroundJobSyncResources added in v0.1.8

func BackgroundJobSyncResources(
	parentContext context.Context,
	logger *logrus.Entry,
	databaseRepo database.DatabaseRepository,
	sourceCred *models.SourceCredential,
) (sourceModels.UpsertSummary, error)

This function is used to sync resources from a source (via a callback function). The BackgroundJobSyncResourcesWrapper contains the logic for registering the background job tracking the sync.

func BackgroundJobSyncResourcesWrapper added in v1.0.2

func BackgroundJobSyncResourcesWrapper(
	parentContext context.Context,
	logger *logrus.Entry,
	databaseRepo database.DatabaseRepository,
	sourceCred *models.SourceCredential,
	callbackFn func(
		_backgroundJobContext context.Context,
		_logger *logrus.Entry,
		_databaseRepo database.DatabaseRepository,
		_sourceCred *models.SourceCredential,
	) (sourceModels.SourceClient, sourceModels.UpsertSummary, error),
) (sourceModels.UpsertSummary, error)

BackgroundJobSyncResourcesWrapper is a background job that syncs all FHIR resource for a given source It is a blocking function that will return only when the sync is complete or has failed It will create a background job and associate it with the source It will also update the access token and refresh token if they have been updated It will return the sync summary and error if any

It's a wrapper function that takes a callback function as an argument. The callback function is the actual sync operation that will be run in the background (regular source or manual source)

TODO: run in background thread, or use https://gobyexample.com/tickers TODO: use goroutine to truely run in the background (how will that work with DatabaseRepository, is that thread safe?) Mutex needed?

func CORSProxy

func CORSProxy(c *gin.Context)

SECURITY: there are security implications to this, this may require some additional authentication to limit misuse this is a whitelisted CORS proxy, it is only used to proxy requests to Token Exchange urls for specified endpoint

func CreateBackgroundJobContext added in v0.1.8

func CreateBackgroundJobContext(parentContext context.Context, backgroundJobId string) context.Context

func CreateBackgroundJobError added in v1.1.0

func CreateBackgroundJobError(c *gin.Context)

CreateBackgroundJobError this function is used to store error data related to a Source/Provider connection operation that fails in the client-side - client errors occur when the OAuth provider sends back an error message (error, error_description query string parameters) or when the code -> access token swap results in an error. - server side errors occur for a number of reasons (unable to initialize client, unable to store crednetial in db, unable to sync 1 or more FHIR resources from a patient's medical record)

func CreateManualSource

func CreateManualSource(c *gin.Context)

mimics functionality in CreateRelatedResources mimics functionality in SourceSync

func CreateReconnectSource added in v0.1.8

func CreateReconnectSource(c *gin.Context)

func CreateRelatedResources added in v1.0.2

func CreateRelatedResources(c *gin.Context)

mimics functionality in CreateManualSource

func CreateResourceComposition

func CreateResourceComposition(c *gin.Context)

deprecated - using Manual Resource Wizard instead

func DeleteAccount added in v1.0.2

func DeleteAccount(c *gin.Context)

UX: this is a secure endpoint, and should only be called after a double confirmation

func DeleteSource added in v0.1.8

func DeleteSource(c *gin.Context)

func FindCodeSystem

func FindCodeSystem(codeSystem string) (string, error)

func GetBackgroundContext added in v0.1.7

func GetBackgroundContext(ginContext *gin.Context) context.Context

func GetDashboard

func GetDashboard(c *gin.Context)

func GetResourceFhir

func GetResourceFhir(c *gin.Context)

this endpoint retrieves a specific resource by its ID

func GetResourceFhirGraph

func GetResourceFhirGraph(c *gin.Context)

GetResourceFhirGraph Retrieve a list of all fhir resources (vertex), and a list of all associations (edge) Generate a graph find the PredecessorMap - filter to only vertices that are "Condition" or "Encounter" and are "root" nodes (have no edges directed to this node)

func GetSource

func GetSource(c *gin.Context)

func GetSourceSummary

func GetSourceSummary(c *gin.Context)

func GetSummary

func GetSummary(c *gin.Context)

func GlossarySearchByCode

func GlossarySearchByCode(c *gin.Context)

https://medlineplus.gov/medlineplus-connect/web-service/ NOTE: max requests is 100/min

func ListBackgroundJobs added in v0.1.8

func ListBackgroundJobs(c *gin.Context)

func ListResourceFhir

func ListResourceFhir(c *gin.Context)

func ListSource

func ListSource(c *gin.Context)

func QueryResourceFhir

func QueryResourceFhir(c *gin.Context)

func SSEEventBusServerHandler added in v0.1.7

func SSEEventBusServerHandler(eventBus event_bus.Interface) gin.HandlerFunc

func SourceSync

func SourceSync(c *gin.Context)

func SupportRequest added in v0.1.8

func SupportRequest(c *gin.Context)

func UnsafeRequestSource

func UnsafeRequestSource(c *gin.Context)

func UnsafeResourceGraph

func UnsafeResourceGraph(c *gin.Context)

func UnsafeSyncResourceNames added in v0.2.0

func UnsafeSyncResourceNames(c *gin.Context)

Types

This section is empty.

Jump to

Keyboard shortcuts

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