2022-12-02 20:40:58 -07:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
|
|
|
"gorm.io/datatypes"
|
2023-01-07 10:41:43 -07:00
|
|
|
"time"
|
2022-12-02 20:40:58 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
type ResourceFhir struct {
|
|
|
|
OriginBase
|
|
|
|
|
2023-01-10 20:23:47 -07:00
|
|
|
SortDate *time.Time `json:"sort_date" gorm:"sort_date"`
|
|
|
|
SortTitle *string `json:"sort_title" gorm:"sort_title"`
|
2023-01-07 10:41:43 -07:00
|
|
|
|
2022-12-02 20:40:58 -07:00
|
|
|
//embedded data
|
|
|
|
ResourceRaw datatypes.JSON `json:"resource_raw" gorm:"resource_raw"`
|
2022-12-17 16:10:19 -07:00
|
|
|
|
|
|
|
//relationships
|
2022-12-21 20:51:02 -07:00
|
|
|
RelatedResourceFhir []*ResourceFhir `json:"related_resources" gorm:"many2many:related_resources;ForeignKey:user_id,source_id,source_resource_type,source_resource_id;references:user_id,source_id,source_resource_type,source_resource_id;"`
|
2022-12-02 20:40:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
type ListResourceQueryOptions struct {
|
|
|
|
SourceID string
|
|
|
|
SourceResourceType string
|
2022-12-17 16:10:19 -07:00
|
|
|
SourceResourceID string
|
|
|
|
|
|
|
|
PreloadRelated bool
|
2022-12-02 20:40:58 -07:00
|
|
|
}
|