Documentation
¶
Overview ¶
Package conceptmap resolves FHIR ConceptMap resources and translates source codings through map groups for StructureMap translate transforms.
Index ¶
- func Canonical(m Map) string
- func ErrNotFound(canonical string) error
- func IsNoMap(err error) bool
- func IsNoTranslation(err error) bool
- func IsNotFound(err error) bool
- type ChainResolver
- type Element
- type Group
- type Map
- type RemoteHTTPClient
- type RemoteTranslateClient
- type Resolver
- type StaticResolver
- type StoreResolver
- type Target
- type TerminologyStoreResolver
- type TranslateRequest
- type Translator
- type Unmapped
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrNotFound ¶
ErrNotFound reports a missing ConceptMap canonical URL.
func IsNoTranslation ¶
IsNoTranslation reports whether err is a missing acceptable translation.
func IsNotFound ¶
IsNotFound reports whether err indicates the ConceptMap canonical URL was not found.
Types ¶
type ChainResolver ¶
type ChainResolver struct {
Resolvers []Resolver
}
ChainResolver tries resolvers in order until one succeeds.
type Map ¶
type Map struct {
ResourceType string `json:"resourceType"`
URL string `json:"url"`
Version string `json:"version,omitempty"`
Status string `json:"status,omitempty"`
Name string `json:"name,omitempty"`
SourceURI string `json:"sourceUri,omitempty"`
Group []Group `json:"group,omitempty"`
}
Map is the JSON representation of a FHIR ConceptMap resource.
func ResolveEnvelope ¶
func ResolveEnvelope(env *types.ResourceEnvelope) (Map, error)
ResolveEnvelope parses a ConceptMap envelope.
type RemoteHTTPClient ¶
type RemoteHTTPClient struct {
BaseURL string
HTTPClient *http.Client
Headers map[string]string
Authorize func(*http.Request) error
}
RemoteHTTPClient calls a FHIR server's ConceptMap/$translate operation.
func (RemoteHTTPClient) Translate ¶
func (c RemoteHTTPClient) Translate(ctx context.Context, req TranslateRequest) ([]map[string]any, error)
Translate performs a remote ConceptMap/$translate request.
type RemoteTranslateClient ¶
type RemoteTranslateClient interface {
Translate(ctx context.Context, req TranslateRequest) ([]map[string]any, error)
}
RemoteTranslateClient performs ConceptMap translation against an external terminology server.
type StaticResolver ¶
StaticResolver resolves maps from an in-memory table.
type StoreResolver ¶
type StoreResolver struct {
Resources store.ResourceStore
Registry store.DefinitionStore
// contains filtered or unexported fields
}
StoreResolver resolves ConceptMaps from ResourceStore with DefinitionStore fallback.
type TerminologyStoreResolver ¶
type TerminologyStoreResolver struct {
Store store.TerminologyStore
ScopeID string
}
TerminologyStoreResolver resolves ConceptMaps from a terminology store projection.
type TranslateRequest ¶
TranslateRequest identifies a source coding and ConceptMap to apply.
type Translator ¶
type Translator struct {
Resolver Resolver
Remote RemoteTranslateClient
}
Translator translates source codings using ConceptMap resources.
func (Translator) Translate ¶
func (t Translator) Translate(ctx context.Context, req TranslateRequest) ([]map[string]any, error)
Translate returns target codings for a source coding.
func (Translator) TranslateResolved ¶
func (t Translator) TranslateResolved(ctx context.Context, req TranslateRequest) ([]map[string]any, Map, error)
TranslateResolved is Translate plus the ConceptMap that was resolved for provenance.