models

package
v0.0.0-...-48b5071 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Deduplication = "deduplication"
	Query         = "query"
)

Variables

This section is empty.

Functions

func AddCreatedOn

func AddCreatedOn(resource interface{})

func GetCollectionName

func GetCollectionName(resourceName string) string

func InsertResourceFromFile

func InsertResourceFromFile(db *mgo.Database, resourceType string, filePath string) interface{}

func LoadResource

func LoadResource(db *mgo.Database, resourceType string, id bson.ObjectId) (interface{}, error)

LoadResource returns an object from the database that matches the specified resource type and object identifier.

func LoadResourceFromFile

func LoadResourceFromFile(fileName string, resource interface{})

func MapToResource

func MapToResource(resourceMap interface{}, asPointer bool) interface{}

When FHIR JSON is unmarshalled, types that are interface{} just get unmarshaled to map[string]interface{}.

This function converts that unmarshaled map to a specific resource type.

func NewSliceForResourceName

func NewSliceForResourceName(name string, len int, cap int) interface{}

func NewStructForResourceName

func NewStructForResourceName(name string) interface{}

func PersistFhirResource

func PersistFhirResource(db *mgo.Database, resourceType string, resource interface{}) (interface{}, error)

PersistFhirResource persists the given FHIR Resource to the database.

func PersistResource

func PersistResource(db *mgo.Database, resourceType string, resource interface{}) (interface{}, error)

func PluralizeLowerResourceName

func PluralizeLowerResourceName(name string) string

func SliceForResourceName

func SliceForResourceName(name string, len int, cap int) interface{}

func StructForResourceName

func StructForResourceName(name string) interface{}

func ToBsonObjectID

func ToBsonObjectID(idStr string) (bson.ObjectId, error)

func UpdateFhirLastUpdatedDate

func UpdateFhirLastUpdatedDate(resource interface{})

func UpdateLastUpdatedDate

func UpdateLastUpdatedDate(resource interface{})

Types

type Link struct {
	Source string  `json:"source"`
	Target string  `json:"target"`
	Match  string  `json:"match"`
	Score  float64 `json:"score"`
}

Link is not part of FHIR. It is a simplified representation of a suggested link (or lack thereof) between two records.

type LinkSlice

type LinkSlice []Link

LinkSlice is needed as a holder for the functions to work with the sort package

func (LinkSlice) Len

func (ls LinkSlice) Len() int

func (LinkSlice) Less

func (ls LinkSlice) Less(i, j int) bool

func (LinkSlice) Swap

func (ls LinkSlice) Swap(i, j int)

type Meta

type Meta struct {
	VersionId     string               `bson:"versionId,omitempty" json:"versionId,omitempty"`
	CreatedOn     time.Time            `bson:"createdOn,omitempty" json:"createdOn,omitempty"`
	LastUpdatedOn time.Time            `bson:"lastUpdatedOn,omitempty" json:"lastUpdatedOn,omitempty"`
	Security      []fhir_models.Coding `bson:"security,omitempty" json:"security,omitempty"`
	Tag           []fhir_models.Coding `bson:"tag,omitempty" json:"tag,omitempty"`
}

type RecordMatchContext

type RecordMatchContext struct {
	ID   bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"`
	Meta *Meta         `bson:"meta,omitempty" json:"meta,omitempty"`
	// human-friendly name assoc. w/ this record matching context
	Name string `bson:"name,omitempty" json:"name,omitempty"`
	// descriptive remarks assoc. w/ this interface to the record match system
	Description string `bson:"description,omitempty" json:"description,omitempty"`
	// distinguishes bewteen different context types (e.g., benchmark, challenge)
	Type string `bson:"type,omitempty" json:"type,omitempty"`
}

type RecordMatchRequest

type RecordMatchRequest struct {
	ID          bson.ObjectId       `bson:"_id,omitempty" json:"id,omitempty"`
	Meta        *Meta               `bson:"meta,omitempty" json:"meta,omitempty"`
	Message     *fhir_models.Bundle `bson:"message,omitempty" json:"message,omitempty"`
	SubmittedOn time.Time           `bson:"submittedOn,omitempty" json:"submittedOn,omitempty"`
}

type RecordMatchResponse

type RecordMatchResponse struct {
	ID         bson.ObjectId       `bson:"_id,omitempty" json:"id,omitempty"`
	Meta       *Meta               `bson:"meta,omitempty" json:"meta,omitempty"`
	Message    *fhir_models.Bundle `bson:"message,omitempty" json:"message,omitempty"`
	ReceivedOn time.Time           `bson:"receivedOn,omitempty" json:"receivedOn,omitempty"`
}

type RecordMatchRun

type RecordMatchRun struct {
	ID                   bson.ObjectId                   `bson:"_id,omitempty" json:"id,omitempty"`
	Meta                 *Meta                           `bson:"meta,omitempty" json:"meta,omitempty"`
	Note                 string                          `bson:"note,omitempty" json:"note,omitempty"`
	RecordMatchContextID bson.ObjectId                   `bson:"recordMatchContextId,omitempty" json:"recordMatchContextId,omitempty"`
	Request              RecordMatchRequest              `bson:"request,omitempty" json:"request,omitempty"`
	Responses            []RecordMatchResponse           `bson:"responses,omitempty" json:"responses,omitempty"`
	Metrics              RecordMatchRunMetrics           `bson:"metrics,omitempty" json:"metrics,omitempty"`
	Status               []RecordMatchRunStatusComponent `bson:"status,omitempty" json:"status,omitempty"`
	// ideally, deduplication or query
	MatchingMode string `bson:"matchingMode,omitempty" json:"matchingMode,omitempty"`
	// fhir resource type of the records being matched (e.g., Patient)
	RecordResourceType string `bson:"recordResourceType,omitempty" json:"recordResourceType,omitempty"`
	// reference to the record matching system interface
	RecordMatchSystemInterfaceID bson.ObjectId `bson:"recordMatchSystemInterfaceId,omitempty" json:"recordMatchSystemInterfaceId,omitempty"`
	MasterRecordSetID            bson.ObjectId `bson:"masterRecordSetId,omitempty" json:"masterRecordSetId,omitempty"`
	QueryRecordSetID             bson.ObjectId `bson:"queryRecordSetId,omitempty" json:"queryRecordSetId,omitempty"`
}
func (rmr *RecordMatchRun) GetBestLinks(count int) []Link
func (rmr *RecordMatchRun) GetLinks() []Link

GetLinks searches all responses to the match run and creates a []Link that is sorted by Score.

func (rmr *RecordMatchRun) GetWorstLinks(count int) []Link

type RecordMatchRunMetrics

type RecordMatchRunMetrics struct {
	F1                 float32 `bson:"f1,omitempty" json:"f1,omitempty"`
	Precision          float32 `bson:"precision,omitempty" json:"precision,omitempty"`
	Recall             float32 `bson:"recall,omitempty" json:"recall,omitempty"`
	MatchCount         int     `bson:"matchCount,omitempty" json:"matchCount,omitempty"`
	TruePositiveCount  int     `bson:"truePositiveCount,omitempty" json:"truePositiveCount,omitempty"`
	FalsePositiveCount int     `bson:"falsePositiveCount,omitempty" json:"falsePositiveCount,omitempty"`
	FRecall            float32 `bson:"FRecall,omitempty" json:"FRecall,omitempty"`
	FPrecision         float32 `bson:"FPrecision,omitempty" json:"FPrecision,omitempty"`
	MAP                float32 `bson:"MAP,omitempty" json:"MAP,omitempty"`
}

RecordMatchRunMetrics contains statistics associated with the results reported by a record matching system.

type RecordMatchRunStatusComponent

type RecordMatchRunStatusComponent struct {
	Message   string    `bson:"message" json:"message"`
	CreatedOn time.Time `bson:"createdOn,omitempty" json:"createdOn,omitempty"`
}

type RecordMatchSystemInterface

type RecordMatchSystemInterface struct {
	ID   bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"`
	Meta *Meta         `bson:"meta,omitempty" json:"meta,omitempty"`
	// human-friendly name assoc. with this record match system interface
	Name string `bson:"name,omitempty" json:"name,omitempty"`
	// descriptive remarks assoc. w/ this interface to the record match system
	Description string `bson:"description,omitempty" json:"description,omitempty"`
	// address to the record match system that will process the request
	DestinationEndpoint string `bson:"destinationEndpoint,omitempty" json:"destinationEndpoint,omitempty"`
	// address to the FHIR Server to which the record-match message should be PUT, may be same or different from ultimate message destination
	ServerEndpoint string `bson:"serverEndpoint,omitempty" json:"serverEndpoint,omitempty"`
	// address to which record match direct response messages
	ResponseEndpoint string `bson:"responseEndpoint,omitempty" json:"responseEndpoint,omitempty"`
}

type RecordSet

type RecordSet struct {
	ID           bson.ObjectId           `bson:"_id,omitempty" json:"id,omitempty"`
	Meta         *Meta                   `bson:"meta,omitempty" json:"meta,omitempty"`
	Name         string                  `bson:"name,omitempty" json:"name,omitempty"`
	Description  string                  `bson:"description,omitempty" json:"description,omitempty"`
	ResourceType string                  `bson:"resourceType,omitempty" json:"resourceType,omitempty"`
	AnswerKey    fhir_models.Bundle      `bson:"answerKey,omitempty" json:"answerKey,omitempty"`
	Parameters   *fhir_models.Parameters `bson:"parameters,omitempty" json:"parameters,omitempty"`
}

Jump to

Keyboard shortcuts

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