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.
66 lines
1.4 KiB
66 lines
1.4 KiB
3 years ago
|
package model
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"gorm.io/gorm"
|
||
|
"whiteboxsystems.nl/openkvpoc/openkv"
|
||
|
"whiteboxsystems.nl/openkvpoc/sharedmodel"
|
||
|
)
|
||
|
|
||
|
type ConnectionState string
|
||
|
|
||
|
const (
|
||
|
ConnectionStatePending = ConnectionState("pending")
|
||
|
ConnectionStateCompleted = ConnectionState("completed")
|
||
|
)
|
||
|
|
||
|
type Connection struct {
|
||
|
gorm.Model
|
||
|
Reference string
|
||
|
AuthConfigID uint
|
||
|
AuthConfig *sharedmodel.AuthConfig
|
||
|
State ConnectionState
|
||
|
Addr string
|
||
|
Supplier string
|
||
|
System string
|
||
|
Services []Service
|
||
|
}
|
||
|
|
||
|
type Service struct {
|
||
|
gorm.Model
|
||
|
ConnectionID uint
|
||
|
Connection *Connection `json:"Connection,omitempty"`
|
||
|
ServiceID string
|
||
|
Name string
|
||
|
Description string
|
||
|
SubscriptionPolicy openkv.SubscriptionPolicy
|
||
|
ConsentPolicy openkv.ConsentPolicy
|
||
|
AuthConfigID uint
|
||
|
AuthConfig *sharedmodel.AuthConfig
|
||
|
Subscriptions []Patient `gorm:"many2many:service_patients;"`
|
||
|
}
|
||
|
|
||
|
type Consent struct {
|
||
|
gorm.Model
|
||
|
ConnectionID uint
|
||
|
ServiceID string
|
||
|
PatientID uint `json:"-"`
|
||
|
Patient Patient `json:"-"`
|
||
|
ConsentGivenOn *time.Time
|
||
|
VerbalConsent bool
|
||
|
Brochure string
|
||
|
Brochureversion string
|
||
|
}
|
||
|
|
||
|
type Patient struct {
|
||
|
gorm.Model
|
||
|
ExternalId string
|
||
|
ExternalIdSystem string
|
||
|
Name string
|
||
|
Birthdate string
|
||
|
PatientID string
|
||
|
FileBase string
|
||
|
Consent []Consent
|
||
|
}
|