You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
okapidemo/his/model/models.go

66 lines
1.4 KiB

2 years ago
package model
import (
"time"
"gorm.io/gorm"
"src.whiteboxsystems.nl/DECOZO/okapi"
"src.whiteboxsystems.nl/DECOZO/okapidemo/sharedmodel"
2 years ago
)
type ConnectionState string
const (
ConnectionStatePending = ConnectionState("pending")
ConnectionStateCompleted = ConnectionState("completed")
)
type ServiceProvider struct {
2 years ago
gorm.Model
Reference string
AuthConfigID uint
AuthConfig *sharedmodel.XISAuthConfig
2 years ago
State ConnectionState
Addr string
Supplier string
System string
Services []Service
}
type Service struct {
gorm.Model
ServiceProviderID uint
ServiceProvider *ServiceProvider `json:"ServiceProvider,omitempty"`
2 years ago
ServiceID string
Name string
Description string
SubscriptionPolicy okapi.SubscriptionPolicy
ConsentPolicy okapi.ConsentPolicy
2 years ago
AuthConfigID uint
AuthConfig *sharedmodel.AuthConfig
Subscriptions []Patient `gorm:"many2many:service_patients;"`
}
type Consent struct {
gorm.Model
ServiceProviderID uint
ServiceID string
PatientID uint `json:"-"`
Patient Patient `json:"-"`
ConsentGivenOn *time.Time
VerbalConsent bool
Brochure string
Brochureversion string
2 years ago
}
type Patient struct {
gorm.Model
ExternalId string
ExternalIdSystem string
Name string
Birthdate string
PatientID string
FileBase string
Consent []Consent
}