bertrand russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which...

97
Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain methodology for doing philosophy. The metaphysical view amounts to the claim that the world consists of a plurality of independently existing things exhibiting qualities and standing in relations. According to logical atomism, all truths are ultimately dependent upon a layer of atomic facts, which consist either of a simple particular exhibiting a quality, or multiple simple particulars standing in a relation. The methodological view recommends a process of analysis, whereby one attempts to define or reconstruct more complex notions or vocabularies in terms of simpler ones. According to Russell, at least early on during his logical atomist phase, such an analysis could eventually result in a language containing only words representing simple particulars, the simple properties and relations thereof, and logical constants, which, despite this limited vocabulary, could adequately capture all truths. Russell's logical atomism had a profound influence on analytic philosophy in the first half of the 20th century; indeed, it is arguable that the very name "analytic philosophy" derives from Russell's defense of the method of analysis. Stanford Encyclopedia of Philosophy http://plato.stanford.edu/entries/logical-atomism/

Upload: marybeth-kelly

Post on 01-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view

and a certain methodology for doing philosophy.

The metaphysical view amounts to the claim that the world consists of a plurality of independently existing things exhibiting qualities and standing in relations. According to logical atomism, all truths are

ultimately dependent upon a layer of atomic facts, which consist either of a simple particular exhibiting a quality, or multiple simple particulars

standing in a relation.

The methodological view recommends a process of analysis, whereby one attempts to define or reconstruct more complex notions or vocabularies in terms of simpler ones. According to Russell, at least early on during his

logical atomist phase, such an analysis could eventually result in a language containing only words representing simple particulars, the simple properties and relations thereof, and logical constants, which, despite

this limited vocabulary, could adequately capture all truths.

Russell's logical atomism had a profound influence on analytic philosophy in the first half of the 20th century; indeed, it is arguable that the very name "analytic philosophy" derives from Russell's defense of the

method of analysis.

Stanford Encyclopedia of Philosophyhttp://plato.stanford.edu/entries/logical-atomism/

Page 2: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Part I: Supporting The GDR User

Learn how to help solve a site’s data problems using the GDR in just one

hour!

Page 3: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Our Advanced Objective:

• Make Meaningful Modules

Page 4: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

End with SQL

• Everyone’s First SQL lesson

• In Structured Query Language (SQL) we:– SELECT A comma separated list of columnsFROM A comma separated list of ‘tables’WHERE Two columns are equal (joins) or Some fact about a column is true

Page 5: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

End with SQL: SELECT

• Comma separated list of columns– Practical English: the columns of data which need

to show in the report– Advanced: Columns, always including PATID,

which make a useful module• Patid, name, mrn, dob

• Patid, first fever time

• Patid, delay code, case type (from peri-operative note)

Page 6: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

End with SQL: FROM

• Comma separated list of ‘tables’– Practical English: Essentris data sources,

usually identified in part by FULLNAME, Note Name, or else documented in the GDR manual

– Advanced: Any of the the above plus any of the user-defined or CCI-defined GDR code modules

– FAQ: where is ____ data in the GDR?

Page 7: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

End with SQL: WHERE

• Two columns are equal (joins) or• Some fact about a column is true

– FAQ: How are __ and __ related to each other in the GDR?

– A: Depends…• PATID: same patient, almost always part of a join

• KEY: same ‘time’, part of a join when concurrency is an issue

• MINORIT:same row in Order Entry or on Order Flowsheets

Page 8: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Start with Essentris

• We already know our way around Essentris• Identify GDR related details in Essentris (look

for “SELECT…FROM..WHERE…” patterns) – Admit Notes

– Timed Notes

– Vitals Flowsheets

– Orders and Order Flowsheets

– Admission/Discharge/Transfer functions

Page 9: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes

• User defined template document• Only one copy stored on the patient record• Has labels, checkboxes and text fields

– In EDIT mode, right-click checkboxes and text fields, select “describe item”, then double click the Label “Item Edit History”

– Text fields can be of two types• DATABASE:

– Reference the DBI FULLNAME

• NOTE:– Reference the TAG String (ex: !207.ABC^5.10)

Page 10: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: Notes Describe Item

Page 11: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: Notes Describe Item

Page 12: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes tangent: Consider just One DBI View in the GDR

• 13,000 DBI Views are all the same in these ways:– GDR Database Item VIEWNAME = FULLNAME +

‘_’ + IT# (kind of)

– Columns• KEY

• MINORIT

• PATID

• DATA

• OLID & NLID

Page 13: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: Single DBI Data

Page 14: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

GDR DBI View Columns: KEY

• “Time of the data”– ADMIT note: KEY = admit datetime– Timed/Prompt Note: KEY = “Note Time”– Flowsheet: KEY = time column– KEY LOGTIME (almost always…)

Page 15: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

GDR DBI View Columns:MINORIT

• In Essentris components which have dynamic or changing rows, MINORIT is like a row number

• Order Entry

• Order Flowsheet

Page 16: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

GDR DBI View Columns:PATID

• Internally generated encounter number

• Unique across installations

• Column that joins a single patient’s data

• NOT visible in Essentris

• Column that is almost never shown in Reports

Page 17: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

GDR DBI View Columns:DATA

• DATA column shows the value that was stored in Essentris.

• Almost always defined as varchar2(4000)– All dates and numbers have to go through a

datatype conversion from text in order to perform any math on the data

• Sometimes defined as Number datatype

Page 18: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

GDR DBI View Columns:OLID & NLID

• Literally: Old Link ID and New Link ID

• The Triple: PATID, OLID, NLID uniquely identify a charting event in Essentris

• All data stored by one person at one time will have the same triple.

• Reference the triple in the LOGTABLE to find the details of the charting event

Page 19: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes: One DBI example SQL

• FULLNAME = Name

• VIEWNAME = NAME_517 • (refer to site/master files, or A_ITCONTRAST in

the GDR)SELECT patid, dataFROM name_517

Page 20: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image Name_517 Data

Page 21: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes: Three DBI example SQL (Patient Details) #1

• VIEWNAMES: NAME_517, MRN_518, DOB_519

Page 22: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes: Three DBI example SQL (Patient Details) #1

• VIEWNAMES: NAME_517, MRN_518, DOB_519

• SELECT NAME_517.patid, NAME_517.data, MRN_518.data, DOB_519.dataFROM NAME_517, MRN_518, DOB_519WHERE NAME_517.patid = MRN_518.patid and NAME_517.patid = DOB_519.patid

Page 23: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: 3 DBIs #1

Page 24: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes: Three DBI example SQL (Patient Details) #2

• SELECT name.patid, name.data, mrn.data, dob.dataFROM NAME_517 name, MRN_518 mrn, DOB_519 dobWHERE name.patid = mrn.patid and name.patid = dob.patid

Page 25: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: 3 DBIs #2

Page 26: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes: Three DBI example SQL (Patient Details) #3

• SELECT name.patid, name.data name, mrn.data mrn, dob.data dobFROM NAME_517 name, MRN_518 mrn, DOB_519 dobWHERE name.patid = mrn.patid and name.patid = dob.patid

Page 27: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: 3 DBIs #3

Page 28: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes: Three DBI example SQL (Patient Details) #4• Without specifying the columns names:

• SELECT *FROM NAME_517 name, MRN_518 mrn, DOB_519 dobWHERE name.patid = mrn.patid and name.patid = dob.patid

Page 29: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes: Note Items

• Reference the TAG string for the Text Prompt (ex: !200.PER^6.2)

• All sites use code like the following which comes from a template to get Note Item data from notes:

Page 30: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain
Page 31: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Admit Notes: Note Items SQL (Real Example: Peri-Operative

data)• Code below yields one record to one patient• SELECT

patid, key, max(decode(tag,497,data)) Delay_Code, max(decode(tag,2 ,data)) Case_Type, max(decode(tag,484,data)) DT_Univ_protocolFROM peri_operativenote_200perGROUP BY

patid, key

Page 32: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: P/O Note Data

Page 33: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Timed Notes: Note Items SQL (Generic Example)

• Code is the same logically, but the result is many records to one patient

• SELECT patid, key, max(decode(tag,1,data)) col_name_for_tag1, max(decode(tag,2,data)) col_name_for_tag2, max(decode(tag,3,data)) col_name_for_tag3FROM timed_note_viewGROUP BY patid, key

Page 34: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Essentris Flowsheets

Page 35: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: Flowsheet

Page 36: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Parameter Flowsheets (Vitals)

• Time driven values• Database items• DBIs have a “many to one” relationship to patient

– Most reports require we find a single value to report:• MIN/MAX(data or key), the value closest to a point in time, a

single LIST of values, etc

• Turn chronological DBI charting into Start and Stop times for treatment intervals: vent use, restraints, etc

Page 37: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Vitals Flowsheet Database items

• Right-click, select “Describe Item” to find the site-defined FULLNAME

• FULLNAME is the prefix of the GDR VIEWNAME for that data

Page 38: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: Flowsheet Describe Item

Page 39: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

GDR Database Items

• VIEWNAME = FULLNAME + ‘_’ + IT#

• Columns– KEY– MINORIT– PATID– DATA– OLID & NLID

Page 40: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Flowsheet Database Item SQL example: TempF

• FULLNAME: TempF(DegF)

• VIEWNAME: TEMPF_DEGF__163– SELECT patid, dataFROM tempf_degf__163WHERE data > 100

Page 41: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: tempf #1

Page 42: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Flowsheet Database Item SQL example: First Fever (a la

TempF) per patient• SELECT patid, min(key) key

FROM tempf_degf__163WHERE data > 100GROUP BY patid

Page 43: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: tempf #2

Page 44: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

- STOP -

• We’ve already made three modules without even talking about what they are– GDR Modules are Reuseable Blocks of SQL

code which accomplish a specific task• Module1: Patient Details

• Module2: Peri Operative Data

• Module3: Time of First Fever

Page 45: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Putting Modules to work: Easy!

• Best Practices involves identifying a main or “driving list” (DL)– DL is verifiable, simple, and is the left side of all joins

in the WHERE clause– We’ll use patient detail as the driving list

• If this were easy, the code would be:• SELECT * from patient_details,

peri_operative_data, first_fever_timeWHERE patient_details.patid = peri_operative_data.patid andpatient_details.patid = first_fever_time.patid

Page 46: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Putting Modules to Work: Easy…

• With formatting:• SELECT

* -- this * means: all the columnsFROM patient_details, peri_operative_data, first_fever_timeWHERE patient_details.patid = peri_operative_data.patid and patient_details.patid = first_fever_time.patid

Page 47: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Putting Modules to Work: Easy?

• With “stand in” fake code to show the logic:• SELECT

* FROM (select…from…where…) patient_details, (select…from…where…) peri_operative_data, (select…from…where…) first_fever_timeWHERE patient_details.patid = peri_operative_data.patid and patient_details.patid = first_fever_time.patid

Page 48: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Putting Modules to Work: Not Easy To Read

• With REAL code to show the final resulting code: SELECT * FROM --

(SELECT name.patid, name.data name, mrn.data mrn, dob.data dob FROM NAME_517 name, MRN_518 mrn, DOB_519 dob WHERE name.patid = mrn.patid and name.patid = dob.patid ) patient_details,-- (SELECT patid, key, max(decode(tag,497,data)) Delay_Code, max(decode(tag,2 ,data)) Case_Type, max(decode(tag,484,data)) DT_Univ_protocolFROM peri_operativenote_200per GROUP BY patid, key) peri_operative_data,

--- (SELECT patid, min(key) key FROM tempf_degf__163 WHERE data > 100 GROUP BY patid) first_fever_time

-- WHERE patient_details.patid = peri_operative_data.patid and patient_details.patid = first_fever_time.patid

Page 49: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Putting Modules to Work: Easy?

• With “stand in” fake code to show the logic:• SELECT

* FROM (select…from…where…) patient_details, (select…from…where…) peri_operative_data, (select…from…where…) first_fever_timeWHERE patient_details.patid = peri_operative_data.patid

and patient_details.patid = first_fever_time.patid

Page 50: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Flash Back Slide- Admit Notes: Three DBI example SQL (Patient

Details) #4• Without specifying the columns names:• SELECT

*FROM NAME_517 name, MRN_518 mrn, DOB_519 dobWHERE name.patid = mrn.patid and name.patid = dob.patid

Page 51: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Flash Back Slide- Admit Notes: Three DBI example SQL (Patient

Details) #4• To really show the sameness:• SELECT

*FROM (select * from NAME_517) name, (select * from MRN_518) mrn, (select * from DOB_519) dobWHERE name.patid = mrn.patid and name.patid = dob.patid

Page 52: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Getting Back to Essentris….

• Order Entry, Orders Flowsheet– Not a lot of user-defined Names of data objects– “All this code has already been written”

• ADT data– Census Reporting: The Last Frontier

Page 53: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Life Cycle of Orders focusing on GDR data

• ENTERED: – ORDERVDATANEW_6076

• ACK/VERIFIED: – ORDERAPPROVAL_1302,

• then a “Order Definition table” – depending on the order category and– the configured order type (MED, IVD, TRT, INP,OUT –not

OTH)

• DELIVERED: – “Order Delivery Table”

• based on the “Order Definition Table”

Page 54: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Order Entry

• Most of the data seen in OE is found in table 6076, the order entry table– ORDERVDATANEW_6076

• No comment

Page 55: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Order Approval

• PATID and MINORIT join up on ORDERVDATANEW_6076

• PATID, MAJORIT_OA, and MINORIT_OA join up on a “Order Definition Table” (kind of)

• MEDS Example:– MAJORIT_OA = 2225 for MED type orders (where

OE category = ‘Medications”)

– MEDS_FLOW_DEFINITION_2225 gets a record with the name of the MED order upon ACK

Page 56: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain
Page 57: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Order Flowsheets: Meds Flowsheet

• Tables which contains data for Med Orders Flowsheet:– MEDS_FLOW_ANNOTATION_2231

MEDS_FLOW_COMMENT_2267MEDS_FLOW_DEFINITION_2225MEDS_FLOW_DELIVERY_2230MEDS_FLOW_DOSE_2229MEDS_FLOW_FREQUENCY_2226MEDS_FLOW_LABEL_COMMENT_2227MEDS_FLOW_REMARKS_2925MEDS_FLOW_ROUTE_2228

Page 58: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

ADT Data

• Admission/Discharge/Transfer data

Page 59: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

A_ADTHISTORY

• HL7 interface or Staff will add records to the ADTHISTORY table indicating patient location (UNIT, BED)

Page 60: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

A_UNITHISTORY

• Uses logic based on A_ADTHISTORY table to figure out the Enter Times and Exit Times per patient per unit

Page 61: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

A_UNITBEDHISTORY

• Uses logic based on A_ADTHISTORY table to figure out the Enter Times and Exit Times per patient per unit per bed

Page 62: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

A_PATIENTLIST

• Uses logic based on A_ADTHISTORY table to show one representative record per patient. Includes data like: name, mrn, hospno, MD, admtime

• In Practice: A_PATIENTLIST = the patient records that are loaded into the GDR

Page 63: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

A_PATCOMMON

• Based on a script which runs per 10 mins on the ncrontab scheduler, This table list all the active patients in Essentris

Page 64: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

A_ARCHLIST

• Based on a script which runs from the ncrontab scheduler @1 AM

• Lists all the archive records on the filesystem

Page 65: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

EXAMPLES of USEFUL MODULES

• Who got which note when

• OE with Status

• OE to the Order Flowsheet by way of Order Approval

• ADTHISTORY with previous stay data filtered

Page 66: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Who got which note when

selectnd.patid,nt.note_name, nt.note_version, nt.time_flag,lt.time note_creation_time, lt.operator, lt.name staff_name, lt.terminal

fromcci_active.note_definition_2304 nd,cci_active.notetypes nt,cci_active.a_logtable1 lt

where-- Table Joins:substr(nd.name,0,8) = nt.NOTE_type andnd.patid = lt.patid and nd.olid = lt.olid and nd.nlid = lt.nlid

Page 67: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: who got which note when?

Page 68: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

OE with Statusselect

decode(previd,'',decode(nextid,'','Order Entered'))|| decode(previd,'',decode(nextid,'', case when sysdate > starttime then ' Started' when sysdate < starttime then ' Not Started'

end ))||decode(previd,'','',decode(nextid,'','Order to DC Entered'))||

decode(previd,'','',decode(nextid,'', case when sysdate > starttime then ' Started' when sysdate < starttime then ' Not Started'

end ))||decode(nextid,'','',decode(previd,'',

case when sysdate > starttime then 'Order Entered DC-ed'

else ' Order is Active' end)) status,oe.*

from ordervdatanew_6076 oe

Page 69: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: OE with Status

Page 70: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

OE to the Order Flowsheet by way of Order Approval

select oe_status.*, oa.*, mdef.*, mdel.*from ( SQL for oe_status ) oe_status, -- ORDERAPPROVAL_1302 oa, -- (select '2225' mojorit, def.* from cci.MEDS_FLOW_DEFINITION_2225 def) mdef, -- (select patid, minorit, min(key) first_delivery from cci.MEDS_FLOW_DELIVERY_2230 group by patid, minorit ) mdelwhere oe_status.patid = oa.patid and oe_status.minorit = oa.minorit and oa.majorit_oa = mdef.majorit and oa.minorit_oa = mdef.minorit and oa.patid = mdef.patid and mdef.patid = mdel.patid (+) and mdef.minorit = mdel.minorit (+)

Page 71: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

ADTHISTORY with previous stay data filtered

select adt.* from

a_adthistory adt,(select mrn, patid, begstay, lead_begstay stay_limitfrom (select mrn, lag(patid) over(partition by mrn order by begstay) lag_patid, lead(patid) over(partition by mrn order by begstay) lead_patid, patid, begstay, lag(begstay) over(partition by mrn order by begstay) lag_begstay, lead(begstay) over(partition by mrn order by begstay) lead_begstay from ( select mrn.DATA mrn, Stay_Interval.* from idnumber_518 mrn , (select patid, min(time) BegStay, max(time) EndStay from adthistory group by patid) Stay_Interval where Stay_interval.patid = mrn.patid (+) ) mrn_pat_stays) where lag_patid is null or lead_patid is null or lead_patid <> patid ) lim

whereadt.patid = lim.patid and adt.TIME > = cast(lim.begstay as date) and(lim.stay_limit is null or adt.time < cast(lim.stay_limit as date))

Page 72: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Image: ADTHISTORY2

Page 73: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

We still need code for these issues:

• Conditional Date formatting– Variation in the formats of dates– Typos in dates– Oracle fails in bad way

• Dealing with unexpected data – Comparing numbers– Doing math

Page 74: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

The Most Complicated Report possible

Select * From (SELECT..FROM..WHERE..) DL -- driving list (SELECT..FROM..WHERE..) single_dbi_data, (SELECT..FROM..WHERE..) multi_dbi_data, (SELECT..FROM..WHERE..) admit_note_data, (SELECT..FROM..WHERE..) timed_note_data, (SELECT..FROM..WHERE..) Order_data, (SELECT..FROM..WHERE..) ADT_data,Where DL.patid = single_dbi_data.patid and DL.patid = multi_dbi_data.patid and DL.patid = admit_note_data.patid and DL.patid = timed_note_data.patid and DL.patid = Order data.patid and DL.patid = ADT data.patid

Page 75: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Conditional Date Formatting

• Problem:– Users are typing in dates that are not valid

Page 76: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Conditional Date Formatting

• Cause:– Staff is unaware that validation codes exist– Staff cannot add validation codes to notes, have

to get CCI to do– CCI’s validation codes are not good enough to

prevent bad data

Page 77: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Conditional Date Formatting

• Fix:– Validation Codes need to be emphasized in

training– Users need to be able to add their own

validation codes– CCI’s codes need to be improved

Page 78: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Examples

• Current Validation Codes:ipr_format=– "mandatory, mm/dd/yyyy|^[0-9][0-9]/[0-3][0-9]/[0-9]{4}$”

• This allows 00/39/0000 and 99/00/9999 as dates

– "mandatory, 0000|^[0-2][0-3][0-5][0-9]$“• This doesn’t allow 1400-1900 as a time, which is wrong

Page 79: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Examples, Cont’d

• #please note this should all be one line:ipr_format=

• "mandatory, hhmi ddMonYYYY|^([0-1][0-9][0-5][0-9]|[2][0-3][0-5][0-9]) ([0][1-9]|[1-2][0-9]|[3][0-1]) [JAN]|[Jan]|[jan]|[FEB]|[Feb]|[feb]|[MAR]|[Mar]|[mar]|[APR]|[Apr]|[apr]|[MAY]|[May]|[may]|[JUN]|[Jun]|[jun]|[JUL]|[Jul]|[jul]|[AUG]|[Aug]|[aug]|[SEP]|[Sep]|[sep]|[OCT]|[Oct]|[oct]|[NOV]|[Nov]|[nov]|[DEC]|[Dec]|[dec]) [1-2][0-9][0-9][0-9]$“– for time: 0000-2359 are valid, 2400 and up is invalid– for day of month: only 01-31 are valid– for month: only Jan-Dec in either all CAPITALS, all lower case, or Initial

Caps are valid– for year: 1000-2999 are valid

Page 80: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Conditional Date Formatting • create or replace function to_date2(strDate varchar2) return date as• ret date;• begin• if REGEXP_LIKE(strDate,'^([0]{01}[1-9]|[1-2][0-9]|[3][0-1])(jan|mar|may|jul|aug|oct|dec)\d{2,4}$','i') THEN • RETURN TO_DATE(strDate, 'ddmonrr');• elsif REGEXP_LIKE(strDate,'^([0]{01}[1-9]|[1][0-9]|[2][0-8])feb\d{2,4}$','i') THEN • RETURN TO_DATE(strDate, 'ddmonrr');• elsif REGEXP_LIKE(strDate,'^29feb(1992|1996|2000|2004|2008)$','i') THEN • RETURN TO_DATE(strDate, 'ddmonrr');• elsif REGEXP_LIKE(strDate,'^([0]{01}[1-9]|[1-2][0-9]|[3][0])(apr|jun|sep|nov)\d{2,4}$','i') THEN • RETURN TO_DATE(strDate, 'ddmonrr');• elsif REGEXP_LIKE(strDate,'^(01|1|03|3|05|5|07|7|08|8|10|12)/(01|1|02|2|03|3|04|4|05|5|06|6|07|7|08|8|09|9|10|11|12|

13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)/\d{2,4}$','i') THEN • RETURN TO_DATE(strDate, 'mm/dd/rr');• elsif REGEXP_LIKE(strDate,'^(02|2)/(01|1|02|2|03|3|04|4|05|5|06|6|07|7|08|8|09|9|10|11|12|13|14|15|16|17|18|19|20|

21|22|23|24|25|26|27|28)/\d{2,4}$','i') THEN • RETURN TO_DATE(strDate, 'mm/dd/rr');• elsif REGEXP_LIKE(strDate,'^(04|4|06|6|09|9|11|)/(01|1|02|2|03|3|04|4|05|5|06|6|07|7|08|8|09|9|10|11|12|13|14|15|16|

17|18|19|20|21|22|23|24|25|26|27|28|29|30)/\d{2,4}$','i') THEN • RETURN TO_DATE(strDate, 'mm/dd/rr');• elsif REGEXP_LIKE(strDate,'^(01|1|03|3|05|5|07|7|08|8|10|12)/(01|1|02|2|03|3|04|4|05|5|06|6|07|7|08|8|09|9|10|11|12|

13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)/\d{2,4} (0[0-9][0-9][0-9]|1[0-9][0-9][0-9]|2[0-3][0-9][0-9])$','i') THEN

• RETURN TO_DATE(strDate, 'mm/dd/rr hh24mi');• elsif REGEXP_LIKE(strDate,'^(02|2)/(01|1|02|2|03|3|04|4|05|5|06|6|07|7|08|8|09|9|10|11|12|13|14|15|16|17|18|19|20|

21|22|23|24|25|26|27|28)/\d{2,4} (0[0-9][0-9][0-9]|1[0-9][0-9][0-9]|2[0-3][0-9][0-9])$','i') THEN • RETURN TO_DATE(strDate, 'mm/dd/rr hh24mi');• elsif REGEXP_LIKE(strDate,'^(04|4|06|6|09|9|11|)/(01|1|02|2|03|3|04|4|05|5|06|6|07|7|08|8|09|9|10|11|12|13|14|15|16|

17|18|19|20|21|22|23|24|25|26|27|28|29|30)/\d{2,4} (0[0-9][0-9][0-9]|1[0-9][0-9][0-9]|2[0-3][0-9][0-9])$','i') THEN • RETURN TO_DATE(strDate, 'mm/dd/rr hh24mi');• elsif REGEXP_LIKE(strDate,'^(02|2)/29/(1876|1880|1884|1888|1892|1896|1900|1904|1908|1912|1916|1920|1924|1928|1932|

1936|1940|1944|1948|1952|1956|1960|1964|1968|1972|1976|1980|1984|1988|1992|1996|2000|2004|2008|2012|2016|2020|2024|2028|2032|2036|2040|2044|2048|2052|2056|2060|2064|2068|2072|2076|2080|2084|2088|2092|2096|2100|2104|2108|2112|2116|2120|2124|2128|2132|2136) (0[0-9][0-9][0-9]|1[0-9][0-9][0-9]|2[0-3][0-9][0-9])$','i') THEN

• RETURN TO_DATE(strDate, 'mm/dd/rr hh24mi');• else return to_date('31-jan-1492','dd-mon-rr');• End if;• End;

Page 81: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

To_date2( ) in use

Page 82: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Part II: Supporting the GDR tool

• ncrontab failures• Transactional data failures• Partition space fills up• Indexes’ statistics get old• User accounts expire/ get locked• User permissions don’t allow a certain desired

actions• Users write monster reports or logical circles

Page 83: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Supporting the GDR: ncrontab

• ncron jobs (UCLA GDR1)ucla5 %10 * * * * Perms gdr1; exit 0

ucla5 %5 * * * * patCommon -c gdr1 2>&1; exit 0

ucla5 0 4 * * * dbshm gdr1;staffm gdr1;notetypes gdr1>/dev/null 2>&1;notetypesAndtmplate gdr1; conDef gdr1;exit 0

ucla5 0 1 * * * archlist $CCSYSDIR/ccarch gdr1;exit 0

ucla5 0 5 * * * CmdCreateView -c gdr1 -s active >/dev/null; CmdCreateView -c gdr1 -s archive >/dev/null ; CmdCreateView -c gdr1 -s view >/dev/null; GDR_STATIC_VIEWS ; CmdCreateIndex -o Create -c gdr1 -s active ; CmdCreateIndex -o Create -c gdr1 -s archive; exit 0

Page 84: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Supporting the GDR: ncrontab

• Perms gdr1• patCommon -c gdr1 2>&1• dbshm gdr1• staffm gdr1• notetypes gdr1>/dev/null 2>&1• notetypesAndtmplate gdr1• conDef gdr1• archlist $CCSYSDIR/ccarch gdr1• CmdCreateView -c gdr1 -s active >/dev/null• CmdCreateView -c gdr1 -s archive >/dev/null• CmdCreateView -c gdr1 -s view >/dev/null• GDR_STATIC_VIEWS• CmdCreateIndex -o Create -c gdr1 -s active • CmdCreateIndex -o Create -c gdr1 -s archive

Page 85: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

Perms gdr1

• Usually set to run every 5 or 20 mins

• Checks which Essentris users have “modify” access to the GDR (Perm #75)

• Creates or updates accounts in the GDR

Page 86: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

patCommon -c gdr1 2>&1

• Runs every 10 mins

• Creates A_PATCOMMON table which lists all the active patients in Essentris

Page 87: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

dbshm gdr1

• Creates MASTERDBSHM and SITEDBSHM tables from the config files

Page 88: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

staffm gdr1

• Creates A_STAFFM table from the staff.m config file

Page 89: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

notetypes gdr1>/dev/null 2>&1

• Creates the A_NOTETYPES table from notetypes config file

Page 90: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

notetypesAndtmplate gdr1

• Creates all the views for notes

Page 91: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

conDef gdr1

• Creates SIDDEF, DIDDEF, AIDDEF tables

• Not sure what it’s for

Page 92: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

archlist $CCSYSDIR/ccarch gdr1

• Usually runs once a night

• Creates A_ARCHLIST table which list all the archived patients in Essentris

Page 93: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

CmdCreateView -c gdr1 -s active >/dev/null

• Usually runs once a day

• Creates all the database item views in the ACTIVE schema

Page 94: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

CmdCreateView -c gdr1 -s archive >/dev/null

• Usually runs once a day

• Creates all the database item views in the ARCHIVE schema

Page 95: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

CmdCreateView -c gdr1 -s view >/dev/null

• Usually runs once a day

• Creates all the database item views in the CCI or VIEW or Union or Combo schema

Page 96: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

GDR_STATIC_VIEWS

• Creates several helpful views

– A_LOGTABLE1

• Logtable with staff names

– A_PATIENTLIST

• List of patients loaded in the GDR

– A_ITCONTRAST

• Join of site file and master file

– A_UNITHISTORY

• Unit level summary of patient location data

– A_UNITBEDHISTORY

• Bed level summary of patient location data

Page 97: Bertrand Russell (1872-1970) described his philosophy as a kind of “logical atomism”, by which he meant to endorse both a metaphysical view and a certain

These jobs create/updates indexes in Oracle

• CmdCreateIndex -o Create -c gdr1 -s active

• CmdCreateIndex -o Create -c gdr1 -s archive