1
# -*- coding: UTF-8 -*-
2
##############################################################################
3
# Copyright (c) 2011 Timothy W. Cook and Contributors.
4
# All Rights Reserved. See CONTRIBUTORS.txt
6
# This software is subject to the provisions of the GNU LESSER GENERAL
7
# PUBLIC LICENSE Version 3, Dated: 29 June 2007 See docs/LICENSE.txt or
8
# http://www.gnu.org/licenses/lgpl.html
9
##############################################################################
11
from zope.interface import Interface, Attribute
12
from zope.schema import Bool, TextLine, Object
13
from zope.i18nmessageid.message import MessageFactory
15
_ = MessageFactory('mlhim.rm')
17
class IContentItem(Interface):
19
Abstract ancestor of all concrete content types.
23
class IEventContext(Interface):
25
The context information of a healthcare event.
26
These include patient contacts or other investigations.
29
healthCareFacility=Object(
30
schema=IPartyIdentified,
31
title=_(u"Healthcare Facility"),
32
description=_(u"Where this event took place."),
38
title=_(u"Start Time"),
39
description=_(u"Start Time"),
46
description=_(u"End Time"),
51
title=_(u"Participations"),
52
description=_(u"List of all parties involved in the event."),
53
value_type=Object(schema=IParticipation),
59
description=_(u"Physical location of this event; ABCLab, home,etc."),
66
description=_(u"The setting of the clinical event."),
71
schema=IItemStructure,
72
title=_(u"Other Context"),
73
description=_(u"Other optional archetyped context."),
78
class IComposition(Interface):
80
One version in a VersionedComposition. A composition is considered the unit of modification in an EHR.
85
description=_(u"Content of this composition."),
86
value_type=Object(schema=IContentItem),
93
description=_(u"The clinical session context."),
100
description=_(u"The party responsible for the content. It may not be the actual person entering the data."),
106
title=_(u"Category"),
107
description=_(u"Defines the broad category of this composition."),
113
title=_(u"Language"),
114
description=_(u"Indicator of the localised language where this composition was created."),
120
title=_(u"Territory"),
121
description=_(u"Territory where this composition was written. ISO 3166."),
126
"""Used to locate items that are of interest to most users."""
128
class ICareEntry(Interface):
130
The abstract parent of all clinical ENTRY subtypes. A CARE_ENTRY defines
131
protocol and guideline attributes for all clinical Entry subtypes.
136
schema=IItemStructure,
137
title=_(u"Protocol"),
138
description=_(u"""Description of the method (i.e. how) the information in this
139
entry was arrived at. For OBSERVATIONs, this is a description of the
140
method or instrument used. For EVALUATIONs, how the evaluation was
141
arrived at. For INSTRUCTIONs, how to execute the Instruction.
142
This may take the form of references to guidelines, including
143
manually followed and executable; knowledge references such as a
144
paper in Medline; clinical reasons within a largercare process."""),
148
guidelineId = Object(
150
title=_(u"guidelineId"),
151
description=_(u"""Optional external identifier of guideline creating this
152
action if relevant."""),
158
class IAdminEntry(Interface):
160
Entry subtype for administrative information, i.e. information about setting up the
161
clinical process, but not itself clinically relevant. Archetypes will define con-
163
Used for admistrative details of admission, episode, ward location, discharge,
164
appointment (if not stored in a practice management or appointments system).
166
Not used for any clinically significant information.
170
schema=IItemStructure,
172
description=u"""The data of the Entry; modelled in archetypes.""",
178
class IEvaluation(Interface):
180
Entry type for evaluation statements.
184
schema=IItemStructure,
186
description=_(u"The data of this evaluation."),
192
class IIsmTransition(Interface):
194
Model of a transition in the Instruction state machine.
199
title=_(u"Current State"),
200
description=_(u"The ISM current state."),
206
title=_(u"Transition"),
207
description=_(u"The ISM transition which occured to arrive at the current state."),
213
title=_(u"Careflow Step"),
214
description=_(u"The step in the careflow process which occured as part of this process."),
220
class IEntry(Interface):
222
The abstract parent of all ENTRY subtypes. An ENTRY is the root of a logical item
223
of "hard" clinical information created in the "clinical statement" context, within a
224
clinical session. There can be numerous such contexts in a clinical session. Obser-
225
vations and other Entry types only ever document information captured/created in
226
the event documented by the enclosing Composition.
227
An ENTRY is also the minimal unit of information any query should return, since a
228
whole ENTRY (including subparts) records spatial structure, timing information,
229
and contextual information, as well as the subject and generator of the informa-
236
title = _(u"language"),
237
description = _(u"""Mandatory indicator of the localised language in which this Entry
238
is written. Coded from openEHR Code Set "languages"."""),
244
title = _(u"encoding"),
245
description = _(u"""Name of character set in which text values in this Entry are encoded.
246
Coded from openEHR Code Set "character sets"."""),
253
title = _(u"subject"),
254
description = _(u"""Id of human subject of this ENTRY, e.g.
255
organ donor, foetus, a family member
256
another clinically relevant person."""),
262
title = _(u"provider"),
263
description = _(u"""Optional identification of provider of the information in this ENTRY, which might be:
265
a patient agent, e.g. parent, guardian
268
Generally only used when the recorder needs to make it explicit. Otherwise, Composition
269
composer and other participants are assumed. """),
273
otherParticipations = List(
274
title = _(u"otherParticipations"),
275
description = _(u"""Other participations at ENTRY level."""),
276
value_type=Object(schema=IParticipation),
282
title = _(u"workflowId"),
283
description = _(u"""Identifier of externally held workflow engine data for this
284
workflow execution, for this subject of care."""),
290
u"""Returns True if this Entry is about the subject of the EHR, in which case the
291
subject attribute is of type PARTY_SELF. """
296
class IInstructionDetails(Interface):
298
Used to record the details of an Instruction causing an Action.
301
instructionId=Object(
302
schema=ILocatableRef,
303
title=_(u"Instruction Id"),
304
description=_(u"Reference to causing Instruction."),
309
title=_(u"Activity Id"),
310
description=_(u"Indentifier of Activity within Instruction."),
315
schema=IItemStructure,
316
title=_(u"WF Details"),
317
description=_(u"Various workflow engine state details."),
324
class IAction(Interface):
326
Used to record a clinical action that has been performed.
332
description=_(u"Point in time of completion of this action."),
336
schema=IItemStructure,
337
title=_(u"Description"),
338
description=_(u"Description of the activity in ItemStructure form."),
341
ismTransition=Object(
342
schema=IIsmTransition,
343
title=_(u"ISM Transition"),
344
description=_(u"Details of the transition of the Instruction state."),
347
instructionDetails=Object(
348
schema=IInstructionDetails,
349
title=_(u"Instruction Details"),
350
description=_(u"Details of the Instruction causing this Action."),
355
class IActivity(Interface):
357
A single activity within an instruction.
361
schema=IItemStructure,
362
title=_(u"Description"),
363
description=_(u"Description of the activity."),
370
description=_(u"Timing of the activity in a format such as ISO8601."),
374
actionArchetypeId=TextLine(
375
title=_(u"Action ArchetypeId"),
376
description=_(u"re pattern enclosed in '//' delimiters."),
381
class IInstruction(Interface):
383
Used to specify future actions and includes a workflow form.
388
title=_(u"Narrative"),
389
description=_(u"Human readable version of the Instructions."),
394
value_type = Object(schema = IActivity),
395
title=_(u"Activities"),
396
description=_(u"List of all activities in the Instruction."),
402
title=_(u"Expiry Time"),
403
description=_(u"Data/time when this Instruction can be assumed to have expired."),
409
title=_(u"Workflow Definition"),
410
description=_(u"Workflow engine executable expression of the Instruction."),
416
class IObservation(Interface):
417
u"""Entry subtype for all clinical data in the past or present, i.e. which (by the time it
418
is recorded) has already occurred. OBSERVATION data is expressed using the class
419
HISTORY<T>, which guarantees that it is situated in time.
420
OBSERVATION is used for all notionally objective (i.e. measured in some way)
421
observations of phenomena, and patient-reported phenomena, e.g. pain.
422
Not used for recording opinion or future statements of any kind, including instructions,
423
intentions, plans etc."""
428
description=_(u"""The data of this observation, in the form of a history of
429
values which may be of any complexity."""),
436
description=_(u"""Optional recording of the state of subject of this
437
observation during the observation process, in the form of
438
a separate history of values which may be of any complexity.
439
State may also be recorded within the History of the data attribute."""),
444
class ISection(Interface):
446
Represents a heading in a heading structure or 'section tree'.
451
description=_(u"Ordered list of content items that may include more SECTIONs or ENTRYs."),
452
value_type=Object(schema=IContentItem),