View lawprod.MSCM.INSTRUMENT_BY_LOCATION_VIEW Generated by
SchemaSpy
Legend:
Primary key columns
Columns with indexes
Implied relationships
Excluded column relationships
< n > number of related tables
 
Column Type Size Nulls Auto Default Children Parents Comments
TS_STATUS number 22  √  null
COMPANY_NO number 4
COMPANY.COMPANY_NO Implied Constraint R
LOCATION_ID number 22
LOCATION.LOCATION_ID Implied Constraint R
LOCATION_CODE varchar2 5
LOCATION_NAME varchar2 50
ITEM_NO varchar2 32
ITEM_DESCRIPTION varchar2 100  √  null
INSTRUMENT_ID varchar2 32  √  null
STATUS char 1  √  null
ASID varchar2 10  √  null
TRAY_NO varchar2 5  √  null
TRAY.TRAY_NO Implied Constraint R
DESCR varchar2 100  √  null
MOD_DATE date 7
COMPANY_NAME varchar2 30  √  null
PATIENT_ID varchar2 14  √  null
COMMENTS varchar2 40  √  null
USAGE_COUNT number 22  √  null

Analyzed at Wed May 18 12:10 CDT 2011

View Definition:
SELECT TS.STATUS TS_STATUS, L.COMPANY_NO, L.LOCATION_ID, L.LOCATION_CODE, L.NAME LOCATION_NAME, I.ITEM_NO, DECODE(LI.ALT_ITEM_DESCRIPTION, '', I.DESCR, LI.ALT_ITEM_DESCRIPTION) ITEM_DESCRIPTION, IT.INSTRUMENT_ID, IT.STATUS, DECODE(TS.STATUS, 1, '', TS.TS_NO) ASID, DECODE(TS.STATUS, 1, '', TRAY_NO) TRAY_NO, DECODE(TS.STATUS, 1, '', TL.DESCR) DESCR, IT.DT_TIME MOD_DATE, C.DESCRIPTION COMPANY_NAME, (SELECT PATIENT_ID FROM TRANSFER WHERE (TS_NO, END_TIME) = (SELECT TS_NO, MAX(END_TIME) FROM TRANSFER WHERE TS_NO = TS.TS_NO GROUP BY TS_NO) ) PATIENT_ID, (SELECT COMMENTS FROM TRANSFER WHERE (TS_NO, END_TIME) = (SELECT TS_NO, MAX(END_TIME) FROM TRANSFER WHERE TS_NO = TS.TS_NO GROUP BY TS_NO) ) COMMENTS, DECODE(IT.USAGE_COUNT, NULL, 0, IT.USAGE_COUNT) USAGE_COUNT FROM INSTRUMENT_TRACK IT, LOCATION L, LOCATION_ITEM LI, ITEM I, INSTRUMENT_ID_ASSEMBLY_VIEW TITD, TRAYSET TS, TRAY_LIST TL, COMPANY C WHERE L.LOCATION_ID = IT.LOCATION_ID AND L.COMPANY_NO = C.COMPANY_NO AND LI.LOCATION_ITEM_ID = IT.LOCATION_ITEM_ID AND LI.ITEM_ID = I.ITEM_ID AND IT.INSTRUMENT_TRACK_ID = TITD.INSTRUMENT_TRACK_ID(+) AND (TITD.TS_INST_TK_DATA_ID IS NULL OR TITD.TS_INST_TK_DATA_ID = (SELECT MAX(TS_INST_TK_DATA_ID) FROM INSTRUMENT_ID_ASSEMBLY_VIEW WHERE INSTRUMENT_TRACK_ID = TITD.INSTRUMENT_TRACK_ID)) AND TITD.TS_ID = TS.TS_ID(+) AND TS.TL_ID = TL.TL_ID(+) AND IT.STATUS!='D' AND LI.STATUS='A'
 
Possibly Referenced Tables/Views:


Close relationships: