tukxdw

package module
v1.3.75 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: GPL-3.0 Imports: 13 Imported by: 4

README

tukxdw

Implementation of IHE XDW Actors XDW Content Creator XDW Content Consumer XDW Content Updator

Requires external Services:- IHE DSUB Broker WSE IHE PIXm or PIXv3 or PDQv3 server WSE MySql DB - connection made using DSN or if url provided by url.

The IHE XDW profile utilises the WS OASIS Human Task standard for the definition of Cross Document Workflow owners, tasks, inputs, outputs, completion behaviours, etc.

XDW requires a workflow definition for each workflow. Workflow definitions are defined using the IHE XDW profile / WS Human Tasks standards. When you use tukxdw to register a XDW definition with the TUK Event Service, the tukxdw transaction creates DSUB Broker Subscriptions for each XDW input and output task that has a type of '$XDSDocumentEntryTypeCode' in the XDW definition. The resulting broker subscription reference, NHS ID, XDW pathway, topic and expression for each subscription is persisted in the tuk event 'subscriptions' DB table. This enables received notifications from a DSUB Broker to be matched to a specific pathway and a specific task in that pathway.

An event for each DSUB notification recieved is created and persisted with the event service. For an example implementation of a DSUB Broker Event Consumer that receives DSUB Broker Notify messages, parses IHE DSUB Notify message and persists the meta data to the TUK Event Service database table 'events', refer to github.com/ipthomas/tukdsub for local deployment and github/ipthomas/tukdsub_lambda for AWS deployment.

To query/update the TUK Event Service Database directly import github.com/ipthomas/tukdbint into your Go project

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Regional_OID = os.Getenv(tukcnst.ENV_REG_OID)

Functions

func Execute

func Execute(i Interface) error

func GetActiveWorkflowNames

func GetActiveWorkflowNames() map[string]string

func GetTaskNotes

func GetTaskNotes(pwy string, nhsid string, taskid int, ver int) string

func GetWorkflowDefinitionNames

func GetWorkflowDefinitionNames(user string) map[string]string

func GetWorkflowXDSMetaNames

func GetWorkflowXDSMetaNames() []string

func IsLatestTaskEvent

func IsLatestTaskEvent(i WorkflowDocument, task int, taskEventName string) bool

Types

type AssignedAuthor

type AssignedAuthor struct {
	ID             ID             `xml:"id" json:"ID"`
	AssignedPerson AssignedPerson `xml:"assignedPerson" json:"AssignedPerson"`
}

type AssignedPerson

type AssignedPerson struct {
	Name Name `xml:"name" json:"Name"`
}

type AttachmentInfo

type AttachmentInfo struct {
	Identifier      string `xml:"identifier" json:"Identifier"`
	Name            string `xml:"name" json:"Name"`
	AccessType      string `xml:"accessType" json:"AccessType"`
	ContentType     string `xml:"contentType" json:"ContentType"`
	ContentCategory string `xml:"contentCategory" json:"ContentCategory"`
	AttachedTime    string `xml:"attachedTime" json:"AttachedTime"`
	AttachedBy      string `xml:"attachedBy" json:"AttachedBy"`
	HomeCommunityId string `xml:"homeCommunityId" json:"HomeCommunityId"`
}

type Author

type Author struct {
	AssignedAuthor AssignedAuthor `xml:"assignedAuthor" json:"AssignedAuthor"`
}

type ConfidentialityCode

type ConfidentialityCode struct {
	Code string `xml:"code,attr" json:"Code"`
}

type Dashboard

type Dashboard struct {
	Total        int
	InProgress   int
	TargetMet    int
	TargetMissed int
	Escalated    int
	Complete     int
}

type DocumentEvent

type DocumentEvent struct {
	EventTime           string `xml:"eventTime" json:"EventTime"`
	EventType           string `xml:"eventType" json:"EventType"`
	TaskEventIdentifier string `xml:"taskEventIdentifier" json:"TaskEventIdentifier"`
	Author              string `xml:"author" json:"Author"`
	PreviousStatus      string `xml:"previousStatus" json:"PreviousStatus"`
	ActualStatus        string `xml:"actualStatus" json:"ActualStatus"`
}

type DocumentEvents

type DocumentEvents []DocumentEvent

sort interface

func (DocumentEvents) Len

func (e DocumentEvents) Len() int

func (DocumentEvents) Less

func (e DocumentEvents) Less(i, j int) bool

func (DocumentEvents) Swap

func (e DocumentEvents) Swap(i, j int)

type EffectiveTime

type EffectiveTime struct {
	Value string `xml:"value,attr" json:"Value"`
}

type ID

type ID struct {
	Root                   string `xml:"root,attr" json:"Root"`
	Extension              string `xml:"extension,attr" json:"Extension"`
	AssigningAuthorityName string `xml:"assigningAuthorityName,attr" json:"AssigningAuthorityName"`
}

type Input

type Input struct {
	Part Part `xml:"part" json:"Part"`
}

type Interface

type Interface interface {
	// contains filtered or unexported methods
}

type Name

type Name struct {
	Family string `xml:"family" json:"Family"`
	Prefix string `xml:"prefix" json:"Prefix"`
}

type Output

type Output struct {
	Part Part `xml:"part" json:"Part"`
}

type Part

type Part struct {
	Name           string         `xml:"name,attr" json:"Name"`
	AttachmentInfo AttachmentInfo `xml:"attachmentInfo" json:"AttachmentInfo"`
}

type ServiceURL added in v1.3.39

type ServiceURL struct {
	DSUB_Broker      string
	DSUB_Consumer    string
	Event_Consumer   string
	Event_Subscriber string
	Event_Notifier   string
	XDW_Consumer     string
	XDW_Creator      string
	HTML_Creator     string
	Service_Admin    string
}

type TaskData

type TaskData struct {
	TaskDetails TaskDetails `xml:"taskDetails" json:"TaskDetails"`
	Description string      `xml:"description" json:"Description"`
	Input       []Input     `xml:"input" json:"Input"`
	Output      []Output    `xml:"output" json:"Output"`
}

type TaskDetails

type TaskDetails struct {
	ID                    string `xml:"id" json:"ID"`
	TaskType              string `xml:"taskType" json:"TaskType"`
	Name                  string `xml:"name" json:"Name"`
	Status                string `xml:"status" json:"Status"`
	ActualOwner           string `xml:"actualOwner" json:"ActualOwner"`
	CreatedTime           string `xml:"createdTime" json:"CreatedTime"`
	CreatedBy             string `xml:"createdBy" json:"CreatedBy"`
	ActivationTime        string `xml:"activationTime" json:"ActivationTime"`
	LastModifiedTime      string `xml:"lastModifiedTime" json:"LastModifiedTime"`
	RenderingMethodExists string `xml:"renderingMethodExists" json:"RenderingMethodExists"`
}

type TaskEvent

type TaskEvent struct {
	ID         string `xml:"id" json:"ID"`
	EventTime  string `xml:"eventTime" json:"EventTime"`
	Identifier string `xml:"identifier" json:"Identifier"`
	EventType  string `xml:"eventType" json:"EventType"`
	Status     string `xml:"status" json:"Status"`
}

type TaskEventHistory

type TaskEventHistory struct {
	TaskEvent []TaskEvent `xml:"taskEvent" json:"TaskEvent"`
}

func (TaskEventHistory) Len added in v1.3.61

func (e TaskEventHistory) Len() int

func (TaskEventHistory) Less added in v1.3.61

func (e TaskEventHistory) Less(i, j int) bool

func (TaskEventHistory) Swap added in v1.3.61

func (e TaskEventHistory) Swap(i, j int)

type TaskList

type TaskList struct {
	XDWTask []XDWTask `xml:"XDWTask" json:"Task"`
}

type Transaction

type Transaction struct {
	Actor              string
	User               string
	Org                string
	Role               string
	Pathway            string
	Expression         string
	NHS_ID             string
	XDS_ID             string
	Task_ID            int
	XDWVersion         int
	Status             string
	AttachmentInfo     string
	Request            []byte
	Response           []byte
	ServiceURL         ServiceURL
	Dashboard          Dashboard
	WorkflowDefinition WorkflowDefinition
	XDSDocumentMeta    XDSDocumentMeta
	WorkflowDocument   WorkflowDocument
	XDWState           tukdbint.WorkflowStates
	Workflows          tukdbint.Workflows
	OpenWorkflows      tukdbint.Workflows
	ClosedWorkflows    tukdbint.Workflows
	MetWorkflows       tukdbint.Workflows
	OverdueWorkflows   tukdbint.Workflows
	EscalatedWorkflows tukdbint.Workflows
	XDWEvents          tukdbint.Events
	Subscriptions      tukdbint.Subscriptions
}

func (*Transaction) ContentConsumer added in v1.3.27

func (i *Transaction) ContentConsumer() error

IHE XDW Content Consumer

func (*Transaction) ContentCreator added in v1.3.27

func (i *Transaction) ContentCreator() error

IHE XDW Content Creator

func (*Transaction) ContentUpdater added in v1.3.27

func (i *Transaction) ContentUpdater() error

func (*Transaction) GetLatestWorkflowEventTime added in v1.3.27

func (i *Transaction) GetLatestWorkflowEventTime() time.Time

func (*Transaction) GetRegisteredWorkflows added in v1.3.52

func (i *Transaction) GetRegisteredWorkflows() map[string]string

func (*Transaction) GetTaskCompleteByDate

func (i *Transaction) GetTaskCompleteByDate() time.Time

func (*Transaction) GetTaskDuration

func (i *Transaction) GetTaskDuration() string

func (*Transaction) GetTaskTimeRemaining

func (i *Transaction) GetTaskTimeRemaining() string

func (*Transaction) GetWorkflowCompleteByDate

func (i *Transaction) GetWorkflowCompleteByDate() time.Time

func (*Transaction) GetWorkflowDuration added in v1.3.27

func (i *Transaction) GetWorkflowDuration() string

func (*Transaction) GetWorkflowTimeRemaining

func (i *Transaction) GetWorkflowTimeRemaining() string

func (*Transaction) IsTaskCompleteBehaviorMet

func (i *Transaction) IsTaskCompleteBehaviorMet() bool

func (*Transaction) IsTaskOverdue

func (i *Transaction) IsTaskOverdue() bool

func (*Transaction) IsWorkflowCompleteBehaviorMet

func (i *Transaction) IsWorkflowCompleteBehaviorMet() (bool, string)

func (*Transaction) IsWorkflowEscalated

func (i *Transaction) IsWorkflowEscalated() bool

func (*Transaction) IsWorkflowOverdue added in v1.3.27

func (i *Transaction) IsWorkflowOverdue() bool

func (*Transaction) PersistXDWDefinition

func (i *Transaction) PersistXDWDefinition() error

func (*Transaction) RegisterWorkflowDefinition

func (i *Transaction) RegisterWorkflowDefinition(ismeta bool) error

func (*Transaction) SetXDWStates added in v1.3.27

func (i *Transaction) SetXDWStates() error

func (*Transaction) UpdateWorkflowDocument added in v1.3.73

func (i *Transaction) UpdateWorkflowDocument() error

type WorkflowDefinition

type WorkflowDefinition struct {
	Ref                 string `json:"ref"`
	Name                string `json:"name"`
	Confidentialitycode string `json:"confidentialitycode"`
	StartByTime         string `json:"startbytime"`
	CompleteByTime      string `json:"completebytime"`
	ExpirationTime      string `json:"expirationtime"`
	CompletionBehavior  []struct {
		Completion struct {
			Condition string `json:"condition"`
		} `json:"completion"`
	} `json:"completionBehavior"`
	Tasks []struct {
		ID              string `json:"id"`
		Tasktype        string `json:"tasktype"`
		Name            string `json:"name"`
		Description     string `json:"description"`
		ActualOwner     string `json:"actualowner"`
		ExpirationTime  string `json:"expirationtime,omitempty"`
		StartByTime     string `json:"startbytime,omitempty"`
		CompleteByTime  string `json:"completebytime"`
		IsSkipable      bool   `json:"isskipable,omitempty"`
		PotentialOwners []struct {
			OrganizationalEntity struct {
				User string `json:"user"`
			} `json:"organizationalEntity"`
		} `json:"potentialOwners,omitempty"`
		CompletionBehavior []struct {
			Completion struct {
				Condition string `json:"condition"`
			} `json:"completion"`
		} `json:"completionBehavior"`
		Input []struct {
			Name        string `json:"name"`
			Contenttype string `json:"contenttype"`
			AccessType  string `json:"accesstype"`
		} `json:"input,omitempty"`
		Output []struct {
			Name        string `json:"name"`
			Contenttype string `json:"contenttype"`
			AccessType  string `json:"accesstype"`
		} `json:"output,omitempty"`
	} `json:"tasks"`
}

type WorkflowDocument added in v1.3.40

type WorkflowDocument struct {
	XMLName                        xml.Name              `xml:"XDW.WorkflowDocument" json:"XMLName"`
	Hl7                            string                `xml:"hl7,attr" json:"Hl7"`
	WsHt                           string                `xml:"ws-ht,attr" json:"WsHt"`
	Xdw                            string                `xml:"xdw,attr" json:"Xdw"`
	Xsi                            string                `xml:"xsi,attr" json:"Xsi"`
	SchemaLocation                 string                `xml:"schemaLocation,attr" json:"SchemaLocation"`
	ID                             ID                    `xml:"id" json:"ID"`
	EffectiveTime                  EffectiveTime         `xml:"effectiveTime" json:"EffectiveTime"`
	ConfidentialityCode            ConfidentialityCode   `xml:"confidentialityCode" json:"ConfidentialityCode"`
	Patient                        ID                    `xml:"patient" json:"Patient"`
	Author                         Author                `xml:"author" json:"Author"`
	WorkflowInstanceId             string                `xml:"workflowInstanceId" json:"WorkflowInstanceId"`
	WorkflowDocumentSequenceNumber string                `xml:"workflowDocumentSequenceNumber" json:"WorkflowDocumentSequenceNumber"`
	WorkflowStatus                 string                `xml:"workflowStatus" json:"WorkflowStatus"`
	WorkflowStatusHistory          WorkflowStatusHistory `xml:"workflowStatusHistory" json:"WorkflowStatusHistory"`
	WorkflowDefinitionReference    string                `xml:"workflowDefinitionReference" json:"WorkflowDefinitionReference"`
	TaskList                       TaskList              `xml:"TaskList" json:"TaskList"`
}

type WorkflowStatusHistory

type WorkflowStatusHistory struct {
	DocumentEvent []DocumentEvent `xml:"documentEvent" json:"DocumentEvent"`
}

func (WorkflowStatusHistory) Len added in v1.3.61

func (e WorkflowStatusHistory) Len() int

func (WorkflowStatusHistory) Less added in v1.3.61

func (e WorkflowStatusHistory) Less(i, j int) bool

func (WorkflowStatusHistory) Swap added in v1.3.61

func (e WorkflowStatusHistory) Swap(i, j int)

type XDSDocumentMeta

type XDSDocumentMeta struct {
	ID                    string `json:"id"`
	DateUtc               string `json:"dateUtc"`
	BinaryId              string `json:"binaryId"`
	Data                  string `json:"data"`
	NhsId                 string `json:"nhsId"`
	Pid                   string `json:"pid"`
	PidOid                string `json:"pidOid"`
	RegId                 string `json:"regId"`
	RegOid                string `json:"regOid"`
	PatientFamily         string `json:"patientFamily"`
	PatientGiven          string `json:"patientGiven"`
	Gender                string `json:"gender"`
	Dob                   string `json:"dob"`
	PractitionerFamily    string `json:"practitionerFamily"`
	PractitionerGiven     string `json:"practitionerGiven"`
	Organization          string `json:"organization"`
	Repositoryuniqueid    string `json:"repositoryuniqueid"`
	Registryoid           string `json:"registryoid"`
	Languagecode          string `json:"languagecode"`
	Docname               string `json:"docname"`
	Docdesc               string `json:"docdesc"`
	DocID                 string `json:"docid"`
	Authorinstitution     string `json:"authorinstitution"`
	Authorperson          string `json:"authorperson"`
	Classcode             string `json:"classcode"`
	Classcodescheme       string `json:"classcodescheme"`
	Classcodevalue        string `json:"classcodevalue"`
	Typecode              string `json:"typecode"`
	Typecodescheme        string `json:"typecodescheme"`
	Typecodevalue         string `json:"typecodevalue"`
	Practicesettingcode   string `json:"practicesettingcode"`
	Practicesettingscheme string `json:"practicesettingscheme"`
	Practicesettingvalue  string `json:"practicesettingvalue"`
	Confcode              string `json:"confcode"`
	Confcodescheme        string `json:"confcodescheme"`
	Confcodevalue         string `json:"confcodevalue"`
	Facilitycode          string `json:"facilitycode"`
	Facilitycodescheme    string `json:"facilitycodescheme"`
	Facilitycodevalue     string `json:"facilitycodevalue"`
	Formatcode            string `json:"formatcode"`
	Formatcodescheme      string `json:"formatcodescheme"`
	Formatcodevalue       string `json:"formatcodevalue"`
	Mimetype              string `json:"mimetype"`
	Objecttype            string `json:"objecttype"`
}

type XDWTask

type XDWTask struct {
	TaskData         TaskData         `xml:"taskData" json:"TaskData"`
	TaskEventHistory TaskEventHistory `xml:"taskEventHistory" json:"TaskEventHistory"`
}

Jump to

Keyboard shortcuts

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