Documentation ¶
Index ¶
- type BackgroundJob
- type BackgroundJobQueryOptions
- type BackgroundJobSyncData
- type ClientRegistrationRequest
- type ClientRegistrationRequestJwks
- type ClientRegistrationRequestJwksKey
- type ClientRegistrationResponse
- type ClientRegistrationTokenResponse
- type Event
- type EventInterface
- type EventKeepAlive
- type EventSourceComplete
- type EventSourceSync
- type EventSourceSyncStatus
- type Glossary
- type InstallationRegistrationRequest
- type InstallationRegistrationResponse
- type ListResourceQueryOptions
- type MedlinePlusConnectResultEntry
- type MedlinePlusConnectResults
- type ModelBase
- type OriginBase
- type OriginBaser
- type QueryResource
- type QueryResourceAggregation
- type QueryResourceAggregations
- type RelatedResource
- type RequestHealthSystem
- type ResourceAssociation
- type ResourceBase
- type ResourceComposition
- type ResourceCompositionRelatesTo
- type ResourceCompositionRelatesToTarget
- type ResourceCompositionRelatesToTargetReference
- type ResourceGraphMetadata
- type ResourceGraphOptions
- type ResponseWrapper
- type ResponseWrapperTyped
- type SourceCredential
- func (s *SourceCredential) GetAccessToken() string
- func (s *SourceCredential) GetBrandId() string
- func (s *SourceCredential) GetClientId() string
- func (s *SourceCredential) GetEndpointId() string
- func (s *SourceCredential) GetExpiresAt() int64
- func (s *SourceCredential) GetPatientId() string
- func (s *SourceCredential) GetPlatformType() sourcesPkg.PlatformType
- func (s *SourceCredential) GetPortalId() string
- func (s *SourceCredential) GetRefreshToken() string
- func (s *SourceCredential) GetSourceId() string
- func (s *SourceCredential) IsDynamicClient() bool
- func (s *SourceCredential) RefreshDynamicClientAccessToken() error
- func (s *SourceCredential) RegisterDynamicClient() error
- func (s *SourceCredential) SetTokens(accessToken string, refreshToken string, expiresAt int64)
- type SourceSummary
- type Summary
- type SupportRequest
- type SystemSettingEntry
- type SystemSettings
- type User
- type UserSettingEntry
- type UserSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundJob ¶ added in v0.1.8
type BackgroundJob struct { ModelBase User User `json:"user,omitempty"` //SECURITY: user and user.id will be set by the repository service UserID uuid.UUID `json:"user_id"` JobType pkg.BackgroundJobType `json:"job_type"` //this should be JSON encoded data from BackgroundJobSyncData or Data datatypes.JSON `gorm:"column:data;type:text;serializer:json" json:"data,omitempty"` JobStatus pkg.BackgroundJobStatus `json:"job_status"` LockedTime *time.Time `json:"locked_time"` DoneTime *time.Time `json:"done_time"` Retries int `json:"retries"` Schedule *pkg.BackgroundJobSchedule `json:"schedule,omitempty"` }
func NewScheduledSyncBackgroundJob ¶ added in v0.1.8
func NewScheduledSyncBackgroundJob(schedule pkg.BackgroundJobSchedule) *BackgroundJob
TODO: this is a WIP.
func NewSyncBackgroundJob ¶ added in v0.1.8
func NewSyncBackgroundJob(source SourceCredential) *BackgroundJob
func (*BackgroundJob) BeforeCreate ¶ added in v0.1.8
func (b *BackgroundJob) BeforeCreate(tx *gorm.DB) (err error)
type BackgroundJobQueryOptions ¶ added in v0.1.8
type BackgroundJobQueryOptions struct { JobType *pkg.BackgroundJobType Status *pkg.BackgroundJobStatus //pagination Limit int Offset int }
type BackgroundJobSyncData ¶ added in v0.1.8
type ClientRegistrationRequest ¶
type ClientRegistrationRequest struct { SoftwareId string `json:"software_id"` Jwks ClientRegistrationRequestJwks `json:"jwks"` }
type ClientRegistrationRequestJwks ¶
type ClientRegistrationRequestJwks struct {
Keys []ClientRegistrationRequestJwksKey `json:"keys"`
}
type ClientRegistrationResponse ¶
type ClientRegistrationResponse struct { RedirectUrls []string `json:"redirect_uris"` TokenEndpointAuthMethod string `json:"token_endpoint_auth_method"` GrantTypes []string `json:"grant_types"` SoftwareId string `json:"software_id"` ClientId string `json:"client_id"` ClientIdIssuedAt int `json:"client_id_issued_at"` Jwks ClientRegistrationRequestJwks `json:"jwks"` }
ClientRegistrationResponse { "redirect_uris": [ " https://fhir.epic.com/test/smart" ], "token_endpoint_auth_method": "none", "grant_types": [ "urn:ietf:params:oauth:grant-type:jwt-bearer" ], "software_id": " d45049c3-3441-40ef-ab4d-b9cd86a17225", "client_id": "G65DA2AF4-1C91-11EC-9280-0050568B7514", "client_id_issued_at": 1632417134, "jwks": { "keys": [{ "kty": "RSA", "n": "vGASMnWdI-ManPgJi5XeT15Uf1tgpaNBmxfa-_bKG6G1DDTsYBy2K1uubppWMcl8Ff_2oWe6wKDMx2-bvrQQkR1zcV96yOgNmfDXuSSR1y7xk1Kd-uUhvmIKk81UvKbKOnPetnO1IftpEBm5Llzy-1dN3kkJqFabFSd3ujqi2ZGuvxfouZ-S3lpTU3O6zxNR6oZEbP2BwECoBORL5cOWOu_pYJvALf0njmamRQ2FKKCC-pf0LBtACU9tbPgHorD3iDdis1_cvk16i9a3HE2h4Hei4-nDQRXfVgXLzgr7GdJf1ArR1y65LVWvtuwNf7BaxVkEae1qKVLa2RUeg8imuw", "e": "AQAB" } ] } }
type ClientRegistrationTokenResponse ¶
type ClientRegistrationTokenResponse struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` Scope string `json:"scope"` State string `json:"state"` Patient string `json:"patient"` EpicDstu2Patient string `json:"__epic.dstu2.patient"` }
type Event ¶ added in v0.1.7
type Event struct { UserID string `json:"-"` EventType EventSourceSyncStatus `json:"event_type"` }
type EventInterface ¶ added in v0.1.7
type EventInterface interface {
GetUserID() string
}
type EventKeepAlive ¶ added in v0.1.7
func NewEventKeepAlive ¶ added in v0.1.7
func NewEventKeepAlive(userID string) *EventKeepAlive
type EventSourceComplete ¶ added in v0.1.7
func NewEventSourceComplete ¶ added in v0.1.7
func NewEventSourceComplete(userID string, sourceID string) *EventSourceComplete
type EventSourceSync ¶ added in v0.1.7
type EventSourceSync struct { *Event `json:",inline"` SourceID string `json:"source_id"` ResourceType string `json:"resource_type"` ResourceID string `json:"resource_id"` }
func NewEventSourceSync ¶ added in v0.1.7
func NewEventSourceSync(userID string, sourceID string, resourceType string, resourceID string) *EventSourceSync
type EventSourceSyncStatus ¶ added in v0.1.7
type EventSourceSyncStatus string
const ( EventTypeKeepAlive EventSourceSyncStatus = "keep_alive" EventTypeSourceSync EventSourceSyncStatus = "source_sync" EventTypeSourceComplete EventSourceSyncStatus = "source_complete" )
type Glossary ¶
type Glossary struct { ModelBase Code string `json:"code" gorm:"uniqueIndex:idx_glossary_term"` CodeSystem string `json:"code_system" gorm:"uniqueIndex:idx_glossary_term"` Publisher string `json:"publisher"` Title string `json:"title"` Url string `json:"url"` Description string `json:"description"` }
Glossary contains patient friendly terms for medical concepts Can be retrieved by Code and CodeSystem Structured similar to ValueSet https://hl7.org/fhir/valueset.html
type InstallationRegistrationRequest ¶ added in v1.1.1
type InstallationRegistrationRequest struct { // AdministratorEmail specifies email address for the administrator of the installation AdministratorEmail string `json:"administrator_email,omitempty"` //opt-in SoftwareArchitecture string `json:"software_architecture,omitempty"` SoftwareOS string `json:"software_os,omitempty"` FastenDesktopVersion string `json:"fasten_desktop_version,omitempty"` FastenOnpremVersion string `json:"fasten_onprem_version,omitempty"` FastenSourcesVersion string `json:"fasten_sources_version,omitempty"` }
type InstallationRegistrationResponse ¶ added in v1.1.1
type InstallationRegistrationResponse struct { // InstallationID specifies client identifier string. REQUIRED InstallationID string `json:"installation_id"` // InstallationSecret specifies client secret string. OPTIONAL InstallationSecret string `json:"installation_secret"` // InstallationIDIssuedAt specifies time at which the client identifier was issued. OPTIONAL InstallationIDIssuedAt time.Time `json:"installation_id_issued_at"` VerificationStatus pkg.InstallationVerificationStatus `json:"verification_status"` QuotaStatus pkg.InstallationQuotaStatus `json:"quota_status"` *InstallationRegistrationRequest `json:",inline"` }
type MedlinePlusConnectResultEntry ¶
type MedlinePlusConnectResultEntry struct { Title struct { Value string `json:"_value"` Type string `json:"type"` } `json:"title"` Link []struct { Href string `json:"href"` Rel string `json:"rel"` } `json:"link"` ID struct { Value string `json:"_value"` } `json:"id"` Summary struct { Type string `json:"type"` Value string `json:"_value"` } `json:"summary"` Updated struct { Value time.Time `json:"_value"` } `json:"updated"` }
type MedlinePlusConnectResults ¶
type MedlinePlusConnectResults struct { Feed struct { Base string `json:"base"` Lang string `json:"lang"` Xsi string `json:"xsi"` Title struct { Type string `json:"type"` Value string `json:"_value"` } `json:"title"` Updated struct { Value time.Time `json:"_value"` } `json:"updated"` ID struct { Value string `json:"_value"` } `json:"id"` Author struct { Name struct { Value string `json:"_value"` } `json:"name"` URI struct { Value string `json:"_value"` } `json:"uri"` } `json:"author"` Subtitle struct { Type string `json:"type"` Value string `json:"_value"` } `json:"subtitle"` Category []struct { Scheme string `json:"scheme"` Term string `json:"term"` } `json:"category"` Entry []MedlinePlusConnectResultEntry `json:"entry"` } `json:"feed"` }
type ModelBase ¶
type OriginBase ¶
type OriginBase struct { ModelBase User *User `json:"user,omitempty" gorm:"-"` UserID uuid.UUID `json:"user_id"` Source *SourceCredential `json:"source,omitempty" gorm:"-"` SourceID uuid.UUID `json:"source_id" gorm:"not null;index:,unique,composite:source_resource_id"` SourceResourceType string `json:"source_resource_type" gorm:"not null;index:,unique,composite:source_resource_id"` SourceResourceID string `json:"source_resource_id" gorm:"not null;index:,unique,composite:source_resource_id"` }
func (OriginBase) GetSourceID ¶
func (o OriginBase) GetSourceID() uuid.UUID
func (OriginBase) GetSourceResourceID ¶
func (o OriginBase) GetSourceResourceID() string
func (OriginBase) GetSourceResourceType ¶
func (o OriginBase) GetSourceResourceType() string
type OriginBaser ¶
type QueryResource ¶
type QueryResource struct { Use string `json:"use"` Select []string `json:"select"` From string `json:"from"` Where map[string]interface{} `json:"where"` Limit *int `json:"limit,omitempty"` Offset *int `json:"offset,omitempty"` //aggregation fields Aggregations *QueryResourceAggregations `json:"aggregations"` }
maps to frontend/src/app/models/widget/dashboard-widget-query.ts
func (*QueryResource) Validate ¶
func (q *QueryResource) Validate() error
type QueryResourceAggregation ¶ added in v0.1.7
type QueryResourceAggregations ¶
type QueryResourceAggregations struct { CountBy *QueryResourceAggregation `json:"count_by,omitempty"` //alias for both groupby and orderby, cannot be used together GroupBy *QueryResourceAggregation `json:"group_by,omitempty"` OrderBy *QueryResourceAggregation `json:"order_by,omitempty"` }
type RelatedResource ¶
type RelatedResource struct { ResourceBaseUserID uuid.UUID `gorm:"resource_base_user_id"` ResourceBaseSourceID uuid.UUID `gorm:"resource_base_source_id"` ResourceBaseSourceResourceType string `gorm:"resource_base_source_resource_type"` ResourceBaseSourceResourceID string `gorm:"resource_base_source_resource_id"` RelatedResourceUserID uuid.UUID `gorm:"related_resource_user_id"` RelatedResourceSourceID uuid.UUID `gorm:"related_resource_source_id"` RelatedResourceSourceResourceType string `gorm:"related_resource_source_resource_type"` RelatedResourceSourceResourceID string `gorm:"related_resource_source_resource_id"` }
this model is used by the DB (see ResourceAssociation for web model)
type RequestHealthSystem ¶ added in v1.1.3
type ResourceAssociation ¶
type ResourceAssociation struct { SourceID string `json:"source_id"` SourceResourceType string `json:"source_resource_type"` SourceResourceID string `json:"source_resource_id"` OldRelatedSourceID string `json:"old_related_source_id"` OldRelatedSourceResourceType string `json:"old_related_source_resource_type"` OldRelatedSourceResourceID string `json:"old_related_source_resource_id"` NewRelatedSourceID string `json:"new_related_source_id"` NewRelatedSourceResourceType string `json:"new_related_source_resource_type"` NewRelatedSourceResourceID string `json:"new_related_source_resource_id"` }
this model is used by the Webserver (see RelatedResource for db model)
type ResourceBase ¶
type ResourceBase struct { OriginBase SortDate *time.Time `json:"sort_date" gorm:"sort_date"` SortTitle *string `json:"sort_title" gorm:"sort_title"` SourceUri *string `json:"source_uri" gorm:"source_uri"` // The raw resource content in JSON format ResourceRaw datatypes.JSON `gorm:"column:resource_raw;type:text;serializer:json" json:"resource_raw,omitempty"` //relationships RelatedResource []*ResourceBase `` /* 198-byte string literal not displayed */ }
func (*ResourceBase) SetOriginBase ¶
func (s *ResourceBase) SetOriginBase(originBase OriginBase)
func (*ResourceBase) SetResourceRaw ¶
func (s *ResourceBase) SetResourceRaw(resourceRaw datatypes.JSON)
func (*ResourceBase) SetSortDate ¶
func (s *ResourceBase) SetSortDate(sortDate *time.Time)
func (*ResourceBase) SetSortTitle ¶
func (s *ResourceBase) SetSortTitle(sortTitle *string)
func (*ResourceBase) SetSourceUri ¶
func (s *ResourceBase) SetSourceUri(sourceUri *string)
type ResourceComposition ¶
type ResourceComposition struct { Title string `bson:"title" json:"title"` RelatesTo []ResourceCompositionRelatesTo `bson:"relatesTo,omitempty" json:"relatesTo,omitempty"` }
this model is based on FHIR401 Resource Composition - https://github.com/fastenhealth/gofhir-models/blob/main/fhir401/composition.go
type ResourceCompositionRelatesTo ¶
type ResourceCompositionRelatesTo struct {
Target ResourceCompositionRelatesToTarget `bson:"target,omitempty" json:"target,omitempty"`
}
type ResourceCompositionRelatesToTarget ¶
type ResourceCompositionRelatesToTarget struct {
TargetReference ResourceCompositionRelatesToTargetReference `bson:"targetReference,omitempty" json:"targetReference,omitempty"`
}
type ResourceCompositionRelatesToTargetReference ¶
type ResourceCompositionRelatesToTargetReference struct {
Reference string `bson:"reference,omitempty" json:"reference,omitempty"`
}
type ResourceGraphMetadata ¶ added in v0.1.7
type ResourceGraphOptions ¶ added in v0.1.7
type ResourceGraphOptions struct {
ResourcesIds []OriginBase `json:"resource_ids"`
}
type ResponseWrapper ¶
type ResponseWrapperTyped ¶ added in v1.1.1
type SourceCredential ¶
type SourceCredential struct { ModelBase User *User `json:"user,omitempty"` UserID uuid.UUID `json:"user_id" gorm:"uniqueIndex:idx_user_source_patient"` Patient string `json:"patient" gorm:"uniqueIndex:idx_user_source_patient"` EndpointID uuid.UUID `json:"endpoint_id" gorm:"uniqueIndex:idx_user_source_patient"` //New Fields Display string `json:"display"` LighthouseEnvType sourcesPkg.FastenLighthouseEnvType `json:"lighthouse_env_type"` BrandID uuid.UUID `json:"brand_id"` PortalID uuid.UUID `json:"portal_id"` PlatformType sourcesPkg.PlatformType `json:"platform_type"` LatestBackgroundJob *BackgroundJob `json:"latest_background_job,omitempty"` LatestBackgroundJobID *uuid.UUID `json:"-"` // auth/credential data ClientId string `json:"client_id"` AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` IdToken string `json:"id_token"` ExpiresAt int64 `json:"expires_at"` CodeChallenge string `json:"code_challenge"` CodeVerifier string `json:"code_verifier"` //dynamic client auth/credential data DynamicClientJWKS []map[string]string `json:"dynamic_client_jwks" gorm:"type:text;serializer:json"` DynamicClientId string `json:"dynamic_client_id"` }
SourceCredential Data/Medical Provider Credentials similar to LighthouseSourceDefinition from fasten-source
func (*SourceCredential) GetAccessToken ¶
func (s *SourceCredential) GetAccessToken() string
func (*SourceCredential) GetBrandId ¶ added in v1.0.2
func (s *SourceCredential) GetBrandId() string
func (*SourceCredential) GetClientId ¶
func (s *SourceCredential) GetClientId() string
func (*SourceCredential) GetEndpointId ¶ added in v1.0.2
func (s *SourceCredential) GetEndpointId() string
func (*SourceCredential) GetExpiresAt ¶
func (s *SourceCredential) GetExpiresAt() int64
func (*SourceCredential) GetPatientId ¶
func (s *SourceCredential) GetPatientId() string
func (*SourceCredential) GetPlatformType ¶ added in v1.0.2
func (s *SourceCredential) GetPlatformType() sourcesPkg.PlatformType
func (*SourceCredential) GetPortalId ¶ added in v1.0.2
func (s *SourceCredential) GetPortalId() string
func (*SourceCredential) GetRefreshToken ¶
func (s *SourceCredential) GetRefreshToken() string
func (*SourceCredential) GetSourceId ¶ added in v1.0.2
func (s *SourceCredential) GetSourceId() string
func (*SourceCredential) IsDynamicClient ¶
func (s *SourceCredential) IsDynamicClient() bool
IsDynamicClient this method is used to check if this source uses dynamic client registration (used to customize token refresh logic)
func (*SourceCredential) RefreshDynamicClientAccessToken ¶
func (s *SourceCredential) RefreshDynamicClientAccessToken() error
this will set/update the AccessToken and Expiry using the dynamic client credentials it will set the following fields: - AccessToken - ExpiresAt
func (*SourceCredential) RegisterDynamicClient ¶ added in v0.1.8
func (s *SourceCredential) RegisterDynamicClient() error
This method will generate a new keypair, register a new dynamic client with the provider it will set the following fields: - DynamicClientJWKS - DynamicClientId
type SourceSummary ¶
type SourceSummary struct { Source *SourceCredential `json:"source,omitempty"` ResourceTypeCounts []map[string]interface{} `json:"resource_type_counts,omitempty"` Patient *ResourceBase `json:"patient"` }
type Summary ¶
type Summary struct { Sources []SourceCredential `json:"sources"` Patients []ResourceBase `json:"patients"` ResourceTypeCounts []map[string]interface{} `json:"resource_type_counts"` }
type SupportRequest ¶ added in v0.1.8
type SupportRequest struct { FullName string `json:"full_name"` Email string `json:"email"` RequestContent string `json:"request_content"` CurrentPage string `json:"current_page"` DistType string `json:"dist_type"` Version string `json:"version"` Flavor string `json:"flavor"` Os string `json:"os"` Arch string `json:"arch"` }
type SystemSettingEntry ¶ added in v1.1.1
type SystemSettingEntry struct { //GORM attributes, see: http://gorm.io/docs/conventions.html ModelBase SettingKeyName string `json:"setting_key_name" gorm:"not null;index:,unique,composite:system_setting_key_name"` SettingKeyDescription string `json:"setting_key_description"` SettingDataType string `json:"setting_data_type"` SettingValueNumeric int `json:"setting_value_numeric"` SettingValueString string `json:"setting_value_string"` SettingValueBool bool `json:"setting_value_bool"` SettingValueArray []string `json:"setting_value_array" gorm:"column:setting_value_array;type:text;serializer:json"` }
SystemSettingEntry matches a setting row in the database
func (SystemSettingEntry) TableName ¶ added in v1.1.1
func (s SystemSettingEntry) TableName() string
type SystemSettings ¶ added in v1.1.1
type SystemSettings struct { InstallationID string `json:"installation_id"` InstallationSecret string `json:"installation_secret"` }
func (*SystemSettings) FromSystemSettingsEntry ¶ added in v1.1.1
func (s *SystemSettings) FromSystemSettingsEntry(entry *SystemSettingEntry) error
see https://gist.github.com/lelandbatey/a5c957b537bed39d1d6fb202c3b8de06
func (*SystemSettings) ToSystemSettingsEntry ¶ added in v1.1.1
func (s *SystemSettings) ToSystemSettingsEntry(entries []SystemSettingEntry) ([]SystemSettingEntry, error)
type User ¶
type User struct { ModelBase FullName string `json:"full_name"` Username string `json:"username" gorm:"unique"` Password string `json:"password"` //additional optional metadata that Fasten stores with users Picture string `json:"picture"` Email string `json:"email"` Role pkg.UserRole `json:"role"` }
func (*User) CheckPassword ¶
func (*User) HashPassword ¶
type UserSettingEntry ¶
type UserSettingEntry struct { //GORM attributes, see: http://gorm.io/docs/conventions.html ModelBase User *User `json:"user,omitempty" gorm:"-"` UserID uuid.UUID `json:"user_id" gorm:"not null;index:,unique,composite:user_setting_key_name"` SettingKeyName string `json:"setting_key_name" gorm:"not null;index:,unique,composite:user_setting_key_name"` SettingKeyDescription string `json:"setting_key_description"` SettingDataType string `json:"setting_data_type"` SettingValueNumeric int `json:"setting_value_numeric"` SettingValueString string `json:"setting_value_string"` SettingValueBool bool `json:"setting_value_bool"` SettingValueArray []string `json:"setting_value_array" gorm:"column:setting_value_array;type:text;serializer:json"` }
SettingEntry matches a setting row in the database
func (UserSettingEntry) TableName ¶
func (s UserSettingEntry) TableName() string
type UserSettings ¶
type UserSettings struct {
DashboardLocations []string `json:"dashboard_locations"`
}
func (*UserSettings) FromUserSettingsEntry ¶
func (s *UserSettings) FromUserSettingsEntry(entry *UserSettingEntry) error
see https://gist.github.com/lelandbatey/a5c957b537bed39d1d6fb202c3b8de06
func (*UserSettings) ToUserSettingsEntry ¶
func (s *UserSettings) ToUserSettingsEntry(entries []UserSettingEntry) ([]UserSettingEntry, error)
Source Files ¶
- background_job.go
- background_job_query_options.go
- background_job_scheduled_sync.go
- background_job_sync.go
- base.go
- client_registration_request.go
- client_registration_response.go
- client_registration_token_response.go
- event.go
- event_keep_alive.go
- event_source_complete.go
- event_source_sync.go
- glossary.go
- installation_registration_request.go
- installation_registration_response.go
- list_resource_query_options.go
- medlineplus_connect_results.go
- query_resource.go
- related_resource.go
- request_healthsystem.go
- resource_association.go
- resource_base.go
- resource_composition.go
- resource_graph_metadata.go
- resource_graph_options.go
- response_wrapper.go
- source_credential.go
- source_summary.go
- summary.go
- support_request.go
- system_setting_entry.go
- system_settings.go
- user.go
- user_setting_entry.go
- user_settings.go