Documentation ¶
Index ¶
- Constants
- func AllFhirResourceCollectionNames() []string
- func ConvertGoFhirBSONToJSON(bsonDoc []bson.E) (jsonBytes []byte, includedDocsJsons [][]byte, err error)
- func ConvertJsonToGoFhirBSON(jsonBytes []byte, whatToEncrypt WhatToEncrypt, ...) (out bson.D, err error)
- func WalkFHIRjson(jsonBytes []byte, visitor FhirVisitor) (err error)
- type FhirSchemaError
- type FhirVisitor
- type FhirVisitorCollectReferences
- func (v *FhirVisitorCollectReferences) Bool(pos positionInfo, value bool) error
- func (v *FhirVisitorCollectReferences) Date(pos positionInfo, value string) error
- func (v *FhirVisitorCollectReferences) Decimal(pos positionInfo, value string) error
- func (v *FhirVisitorCollectReferences) Extension(pos positionInfo, url string) error
- func (v *FhirVisitorCollectReferences) GetReferences() []string
- func (v *FhirVisitorCollectReferences) Instant(pos positionInfo, value string) error
- func (v *FhirVisitorCollectReferences) Null(pos positionInfo) error
- func (v *FhirVisitorCollectReferences) Number(pos positionInfo, value string) error
- func (v *FhirVisitorCollectReferences) Reference(pos positionInfo, value string) error
- func (v *FhirVisitorCollectReferences) String(pos positionInfo, value string) error
- type Resource
- func (r *Resource) AsShallowBundle(failedRequestsDir string) (bundle *ShallowBundle, err error)
- func (r *Resource) GetBSON() (interface{}, error)
- func (r *Resource) Id() string
- func (r *Resource) JsonBytes() []byte
- func (r *Resource) LastUpdated() string
- func (r *Resource) LastUpdatedTime() time.Time
- func (r *Resource) MarshalBSON() ([]byte, error)
- func (r *Resource) MarshalJSON() ([]byte, error)
- func (r *Resource) ResourceType() string
- func (r *Resource) SearchIncludes() []*Resource
- func (r *Resource) SearchIncludesOfType(resourceType string) []*Resource
- func (r *Resource) SetId(id string)
- func (r *Resource) SetLastUpdated(lastUpdated string)
- func (r *Resource) SetLastUpdatedTime(t time.Time)
- func (r *Resource) SetTransformReferencesMap(transformReferencesMap map[string]string)
- func (r *Resource) SetVersionId(versionId int)
- func (r *Resource) SetWhatToEncrypt(whatToEncrypt WhatToEncrypt)
- func (r *Resource) Unmarshal(v interface{}) error
- func (r *Resource) UnmarshalJSON(data []byte) (err error)
- func (r *Resource) VersionId() string
- type ShallowBundle
- type ShallowBundleEntryComponent
- type WhatToEncrypt
Constants ¶
View Source
const Gofhir__from = "__from"
View Source
const Gofhir__num = "__num"
View Source
const Gofhir__strDate = "__strDate"
View Source
const Gofhir__strNum = "__strNum"
View Source
const Gofhir__to = "__to"
Variables ¶
This section is empty.
Functions ¶
func AllFhirResourceCollectionNames ¶
func AllFhirResourceCollectionNames() []string
func ConvertGoFhirBSONToJSON ¶
func ConvertGoFhirBSONToJSON(bsonDoc []bson.E) (jsonBytes []byte, includedDocsJsons [][]byte, err error)
Reverses transformations done by ConvertJsonToGoFhirBSON
func ConvertJsonToGoFhirBSON ¶
func ConvertJsonToGoFhirBSON(jsonBytes []byte, whatToEncrypt WhatToEncrypt, transformReferencesMap map[string]string) (out bson.D, err error)
Converts a FHIR JSON Resource into BSON for storage in MongoDB Does several transformations:
- re-writes references (for transactions)
- converts id to _id and puts first (_id converted to __id)
- converts extensions from { url, value } to { url: { value } } to enable better MongoDB queries
- converts decimal numbers to { __from, __to, __num, __strNum } for FHIR conformance
- converts dates to { __from, __to, __strDate } for FHIR conformance
- optionally encrypts certain fields
func WalkFHIRjson ¶
func WalkFHIRjson(jsonBytes []byte, visitor FhirVisitor) (err error)
Types ¶
type FhirSchemaError ¶
type FhirSchemaError struct {
// contains filtered or unexported fields
}
func (FhirSchemaError) Error ¶
func (e FhirSchemaError) Error() string
type FhirVisitor ¶
type FhirVisitor interface { String(pos positionInfo, value string) error Reference(pos positionInfo, value string) error Date(pos positionInfo, value string) error Instant(pos positionInfo, value string) error Decimal(pos positionInfo, value string) error Number(pos positionInfo, value string) error Bool(pos positionInfo, value bool) error Null(pos positionInfo) error Extension(pos positionInfo, url string) error }
type FhirVisitorCollectReferences ¶
type FhirVisitorCollectReferences struct {
// contains filtered or unexported fields
}
func NewFhirVisitorCollectReferences ¶
func NewFhirVisitorCollectReferences() *FhirVisitorCollectReferences
func (*FhirVisitorCollectReferences) Bool ¶
func (v *FhirVisitorCollectReferences) Bool(pos positionInfo, value bool) error
func (*FhirVisitorCollectReferences) Date ¶
func (v *FhirVisitorCollectReferences) Date(pos positionInfo, value string) error
func (*FhirVisitorCollectReferences) Decimal ¶
func (v *FhirVisitorCollectReferences) Decimal(pos positionInfo, value string) error
func (*FhirVisitorCollectReferences) Extension ¶
func (v *FhirVisitorCollectReferences) Extension(pos positionInfo, url string) error
func (*FhirVisitorCollectReferences) GetReferences ¶
func (v *FhirVisitorCollectReferences) GetReferences() []string
func (*FhirVisitorCollectReferences) Instant ¶
func (v *FhirVisitorCollectReferences) Instant(pos positionInfo, value string) error
func (*FhirVisitorCollectReferences) Null ¶
func (v *FhirVisitorCollectReferences) Null(pos positionInfo) error
func (*FhirVisitorCollectReferences) Number ¶
func (v *FhirVisitorCollectReferences) Number(pos positionInfo, value string) error
func (*FhirVisitorCollectReferences) Reference ¶
func (v *FhirVisitorCollectReferences) Reference(pos positionInfo, value string) error
func (*FhirVisitorCollectReferences) String ¶
func (v *FhirVisitorCollectReferences) String(pos positionInfo, value string) error
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
func NewResourceFromBSON ¶
func (*Resource) AsShallowBundle ¶
func (r *Resource) AsShallowBundle(failedRequestsDir string) (bundle *ShallowBundle, err error)
func (*Resource) LastUpdated ¶
func (*Resource) LastUpdatedTime ¶
func (*Resource) MarshalBSON ¶
Implements bson2.Marshaler
func (*Resource) MarshalJSON ¶
func (*Resource) ResourceType ¶
func (*Resource) SearchIncludes ¶
func (*Resource) SearchIncludesOfType ¶
func (*Resource) SetLastUpdated ¶
func (*Resource) SetLastUpdatedTime ¶
func (*Resource) SetTransformReferencesMap ¶
func (*Resource) SetVersionId ¶
func (*Resource) SetWhatToEncrypt ¶
func (r *Resource) SetWhatToEncrypt(whatToEncrypt WhatToEncrypt)
func (*Resource) UnmarshalJSON ¶
type ShallowBundle ¶
type ShallowBundle struct { ResourceType string `json:"resourceType,omitempty"` Meta *models.Meta `json:"meta,omitempty"` Type string `json:"type,omitempty"` Id string `json:"id,omitempty"` Total *uint32 `json:"total,omitempty"` Entry []ShallowBundleEntryComponent `json:"entry,omitempty"` Link []models.BundleLinkComponent `json:"link,omitempty"` }
func (*ShallowBundle) GetAllReferences ¶
func (b *ShallowBundle) GetAllReferences() (references []string, err error)
func (*ShallowBundle) MarshalJSON ¶
func (r *ShallowBundle) MarshalJSON() ([]byte, error)
func (*ShallowBundle) SetTransformReferencesMap ¶
func (b *ShallowBundle) SetTransformReferencesMap(transformReferencesMap map[string]string)
func (*ShallowBundle) ToResource ¶
func (r *ShallowBundle) ToResource() (*Resource, error)
type ShallowBundleEntryComponent ¶
type ShallowBundleEntryComponent struct { Resource *Resource `json:"resource,omitempty"` FullUrl string `json:"fullUrl,omitempty"` Search *models.BundleEntrySearchComponent `json:"search,omitempty"` Request *models.BundleEntryRequestComponent `json:"request,omitempty"` Response *models.BundleEntryResponseComponent `json:"response,omitempty"` }
type WhatToEncrypt ¶
type WhatToEncrypt struct {
PatientDetails bool
}
Click to show internal directories.
Click to hide internal directories.