pkg

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const ConfigSchemaPath = "schemapath"

--schemapath config flag

View Source
const ConfigSchemaPathDefault = ""

default use Asset

Variables

This section is empty.

Functions

func CustodianFrom

func CustodianFrom(jsonq *gojsonq.JSONQ) string

CustodianFrom extracts the organization from a given Consent json jsonq source

func DataClassesFrom

func DataClassesFrom(jsonq *gojsonq.JSONQ) []string

DataClassesFrom extracts the consent provision classes from some fhir json, replaces ResourcesFrom It combines the system and code field to a single string using the correct divider (: or #) based on the type of system

func PeriodFrom

func PeriodFrom(jsonq *gojsonq.JSONQ) []*time.Time

PeriodFrom returns a tuple of time pointers (validFrom, validTo) extracted from FHIR where the validTo may be nil

func ResourcesFrom

func ResourcesFrom(jsonq *gojsonq.JSONQ) []string

ResourcesFrom extracts the consent resources from some fhir json, deprecated, replaced by DataClassesFrom

func SubjectFrom

func SubjectFrom(jsonq *gojsonq.JSONQ) string

SubjectFrom extracts the patient from a given Consent json jsonq source

func VersionFrom

func VersionFrom(jsonq *gojsonq.JSONQ) string

Types

type Identifier

type Identifier string

Identifier is a synonym for string

func ActorsFrom

func ActorsFrom(jsonq *gojsonq.JSONQ) []Identifier

ActorsFrom extracts the consent actors from some fhir json

type Validator

type Validator struct {
	Config struct {
		Schemapath string
	}
	// contains filtered or unexported fields
}

Validator holds the config and schemaLoader for the validator

func ValidatorInstance

func ValidatorInstance() *Validator

ValidatorInstance returns the singleton Validator

func (*Validator) Configure

func (vb *Validator) Configure() error

Configure loads the given configurations in the engine.

func (*Validator) ValidateAgainstSchema

func (ve *Validator) ValidateAgainstSchema(json []byte) (bool, []string, error)

Validate the consent record against the schema

func (*Validator) ValidateAgainstSchemaConsentAt

func (ve *Validator) ValidateAgainstSchemaConsentAt(source string) (bool, []string, error)

Validate the consent record at the given location (on disk)

type ValidatorClient

type ValidatorClient interface {
	// ValidateAgainstSchemaConsentAt validates the consent record at the given location (on disk)
	ValidateAgainstSchemaConsentAt(source string) (bool, []string, error)

	// ValidateAgainstSchema Validates the given consent record against the schema
	ValidateAgainstSchema(json []byte) (bool, []string, error)
}

ValidatorClient is the main interface for the Validator

func NewValidatorClient

func NewValidatorClient() ValidatorClient

NewValidatorClient returns the default Validator client, either a Local- or RemoteClient

Jump to

Keyboard shortcuts

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