Back to godoc.org

Package api

v0.15.0
Latest Go to latest

The latest major version is .

Published: Sep 30, 2020 | License: GPL3 | Module: github.com/nuts-foundation/nuts-consent-logic

Overview

Package api provides primitives to interact the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.

Index

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

type ConsentRecord

type ConsentRecord struct {
	ConsentProof DocumentReference    `json:"consentProof"`
	DataClass    []DataClassification `json:"dataClass"`
	Period       Period               `json:"period"`

	// Optional parameter. If provided, the previous consentRecord will be replaced by this new ConsentRecord. This is the computed hash of the fhir record.
	PreviousRecordHash *string `json:"previousRecordHash,omitempty"`
}

ConsentRecord defines model for ConsentRecord.

type CreateConsentRequest

type CreateConsentRequest struct {

	// URI identitying an entity (organization or person). Can either be a: - Performer: The person who administers the consent (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000007) - Actor: Usually a practitioner (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000007) - Custodian: Usually the custodian or actor (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000000) - Subject: Usually the patient (e.g.: urn:oid:2.16.840.1.113883.2.4.6.3:999999990)
	Actor IdentifierURI `json:"actor"`

	// URI identitying an entity (organization or person). Can either be a: - Performer: The person who administers the consent (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000007) - Actor: Usually a practitioner (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000007) - Custodian: Usually the custodian or actor (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000000) - Subject: Usually the patient (e.g.: urn:oid:2.16.840.1.113883.2.4.6.3:999999990)
	Custodian IdentifierURI `json:"custodian"`

	// URI identitying an entity (organization or person). Can either be a: - Performer: The person who administers the consent (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000007) - Actor: Usually a practitioner (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000007) - Custodian: Usually the custodian or actor (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000000) - Subject: Usually the patient (e.g.: urn:oid:2.16.840.1.113883.2.4.6.3:999999990)
	Performer *IdentifierURI  `json:"performer,omitempty"`
	Records   []ConsentRecord `json:"records"`

	// URI identitying an entity (organization or person). Can either be a: - Performer: The person who administers the consent (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000007) - Actor: Usually a practitioner (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000007) - Custodian: Usually the custodian or actor (e.g.: urn:oid:2.16.840.1.113883.2.4.6.1:00000000) - Subject: Usually the patient (e.g.: urn:oid:2.16.840.1.113883.2.4.6.3:999999990)
	Subject IdentifierURI `json:"subject"`
}

CreateConsentRequest defines model for CreateConsentRequest.

type CreateOrUpdateConsentJSONBody

type CreateOrUpdateConsentJSONBody CreateConsentRequest

CreateOrUpdateConsentJSONBody defines parameters for CreateOrUpdateConsent.

type CreateOrUpdateConsentJSONRequestBody

type CreateOrUpdateConsentJSONRequestBody CreateOrUpdateConsentJSONBody

CreateOrUpdateConsentRequestBody defines body for CreateOrUpdateConsent for application/json ContentType.

type DataClassification

type DataClassification string

DataClassification defines model for DataClassification.

type DocumentReference

type DocumentReference struct {

	// unique identifier useable for retrieving the proof when contacting the care provider (technical or on paper)
	ID string `json:"ID"`

	// location where the proof document can be found, should accept Nuts based authentication
	URL         *string `json:"URL,omitempty"`
	ContentType *string `json:"contentType,omitempty"`

	// base64 encoded sha256 of the document
	Hash *string `json:"hash,omitempty"`

	// human readable identifier for consent proof, eg: document name
	Title string `json:"title"`
}

DocumentReference defines model for DocumentReference.

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type IdentifierURI

type IdentifierURI string

IdentifierURI defines model for IdentifierURI.

func (IdentifierURI) PartyID

func (i IdentifierURI) PartyID() core.PartyID

func (*IdentifierURI) UnmarshalJSON

func (i *IdentifierURI) UnmarshalJSON(bytes []byte) error

type JobCreatedResponse

type JobCreatedResponse struct {
	JobId      *string `json:"jobId,omitempty"`
	ResultCode string  `json:"resultCode"`
}

JobCreatedResponse defines model for JobCreatedResponse.

type Period

type Period struct {
	End   *time.Time `json:"end,omitempty"`
	Start time.Time  `json:"start"`
}

Period defines model for Period.

type ServerInterface

type ServerInterface interface {
	// Create or update a new consent.
	// (POST /api/consent)
	CreateOrUpdateConsent(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateOrUpdateConsent

func (w *ServerInterfaceWrapper) CreateOrUpdateConsent(ctx echo.Context) error

CreateOrUpdateConsent converts echo context to params.

type Wrapper

type Wrapper struct {
	Cl *pkg.ConsentLogic
}

Wrapper provides the implementation of the generated ServerInterface

func (Wrapper) CreateOrUpdateConsent

func (wrapper Wrapper) CreateOrUpdateConsent(ctx echo.Context) error

NutsConsentLogicCreateConsent Creates the consent FHIR resource, validate it and sends it to the consent-bridge.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier