Databases Reference
In-Depth Information
These episode views are the query-side work of defining an
episode datatype. The AVF presents episodes as maintainable
managed objects. These views present episodes as queryable
managed objects.
This is a very important point. Both computer science
research and IT practice have shown the importance of the con-
cept of a string of one or more contiguous clock ticks with a
known location in time. SQL does not directly support this con-
cept; and so instead, we, and others, have to write code to
exclude gaps and overlaps occurring in the timespan between a
pair of dates or timestamps. A PERIOD datatype is the direct
support needed for this concept. This datatype implements this
concept at the correct level of abstraction.
By the same token, our own research and practice has shown
the importance of the concept of an episode, a string of one or
more contiguous and non-overlapping versions of the same
object. Without that concept, and the concepts of objects and
versions on which it depends, there is also no concept of tempo-
ral entity integrity and temporal referential integrity. Without
that concept, collections of rows are defined, as needed, within
each SQL statement. As we can see with both the standard and
alternative temporal models, their SQL insert, update and delete
statements do result in bi-temporal data that satisfies what we
call TEI and TRI. Their SQL queries do find episodes, when they
need them, past assertions when they need them, and so on. But
the level of abstraction is wrong, for the same reason that getting
the same results with a pair of dates that one would get with a
PERIOD datatype is wrong.
So we now have two views which externalize, as queryable
managed objects, the best data we currently have (i.e. our
currently asserted data) about policy episodes and wellness
program episodes. Now, using these two views, we will define
another view that we will use to illustrate each of the Allen
relationships. This is the view V_Allen_Example. This view
will keep the examples as small and easy to understand as possi-
ble, eliminating all extraneous and repetitive detail while focus-
ing on the Allen relationships
themselves. Here is
the
V_Allen_Example view:
CREATE VIEW V_Allen_Example AS
SELECT wp.wellpgm_oid, pol.policy_oid,
wp.epis_beg_dt AS wp_epis_beg_dt,
wp.epis_end_dt AS wp_epis_end_dt,
pol.epis_beg_dt AS pol_epis_beg_dt,
pol.epis_end_dt AS pol_epis_end_dt
Search WWH ::




Custom Search