S dispo table: Difference between revisions

From CCMDB Wiki
Jump to navigation Jump to search
Line 62: Line 62:


== Inactivating locations ==
== Inactivating locations ==
Before inactivating a location, make sure that it is not used in any incomplete profiles. Run the following query in CFE:
Before inactivating a location, make sure that it is not used in any incomplete profiles. Run the following query in CFE. It will ask for two parameters, the name of the location and the latest time at which the location would have been available.
<code> coming </code>
 
<code> SELECT L_Log.D_ID, L_Log.RecordStatus, L_Log.Dispo_DtTm, preAdm.location_name AS preAdm, previous.location_name AS Prev, SL.location_name AS SL, dispo.location_name AS dispo
FROM (((L_Log INNER JOIN s_dispo AS preAdm ON L_Log.Pre_admit_Inpatient_Institution = preAdm.dispo_ID) INNER JOIN s_dispo AS previous ON L_Log.Previous_Location = previous.dispo_ID) INNER JOIN s_dispo AS SL ON L_Log.Service_Location = SL.dispo_ID) INNER JOIN s_dispo AS dispo ON L_Log.Dispo = dispo.dispo_ID
WHERE (((L_Log.RecordStatus)="incomplete") AND ((preAdm.location_name)=[the_location_name])) OR (((L_Log.RecordStatus)="incomplete") AND ((previous.location_name)=[the_location_name])) OR (((L_Log.RecordStatus)="incomplete") AND ((SL.location_name)=[the_location_name])) OR (((L_Log.RecordStatus)="incomplete") AND ((dispo.location_name)=[the_location_name])) OR (((L_Log.RecordStatus)="incomplete") AND ((L_Log.Dispo_DtTm)<[end_date]) AND ((preAdm.location_name) Is Null)) OR (((L_Log.RecordStatus)="incomplete") AND ((L_Log.Dispo_DtTm)<[end_date]) AND ((previous.location_name) Is Null)) OR (((L_Log.RecordStatus)="incomplete") AND ((L_Log.Dispo_DtTm)<[end_date]) AND ((SL.location_name) Is Null)) OR (((L_Log.RecordStatus)="incomplete") AND ((L_Log.Dispo_DtTm)<[end_date]) AND ((dispo.location_name) Is Null));
</code>


== Related articles ==
== Related articles ==

Revision as of 09:43, 2021 August 26

The S_dispo table in CCMDB.accdb contains the possible values for the following fields:

Data Structure

field type description
dispo_ID text unique ID
location_name text name as seen by collector
real_collection text unit name as collected by us, e.g. HSC_MICU vs HSC_MICa; this is used to link the Previous Location/Dispo to Service/Location
real_name text unit name as reported, e.g. STB_ICMU vs STB_MICU
site text our short hospital name, eg HSC
ward text ward name only, e.g. A1 for HSC_A1
hospital text hospital if one where we collect
loc_type text S dispo.loc type
geog text geographical area (in town, out of province, etc)
MB_RHA text regional health authority the institution is part of
notes text general notes about record
question text questions while we implement, can be deleted after
inpatient yes/no is an inpatient location, used by Pre-admit Inpatient Institution field drop-down and cross checks
previous_location yes/no can be used as Previous Location field
surgical yes/no is a location where actual surgeries happpen (used by e.g. Check ORDx) (ie not just a surgical ward)
meanLOS3STD integer used by LOS check
s_location yes/no can be used as location
dispo yes/no can be used in Dispo field
active yes/no logical delete from dropdowns
acuity_level yes/no logical delete from dropdowns
program text CC or Med, used for rows where real_name is one of our locations only
colour text colour code for patient list view
service_type text S dispo.service type
center long integer chronological order sequence of the site and ward used in generating report (e.g. teaching hospitals first followed by community hospitals)

Inactivating locations

Before inactivating a location, make sure that it is not used in any incomplete profiles. Run the following query in CFE. It will ask for two parameters, the name of the location and the latest time at which the location would have been available.

SELECT L_Log.D_ID, L_Log.RecordStatus, L_Log.Dispo_DtTm, preAdm.location_name AS preAdm, previous.location_name AS Prev, SL.location_name AS SL, dispo.location_name AS dispo FROM (((L_Log INNER JOIN s_dispo AS preAdm ON L_Log.Pre_admit_Inpatient_Institution = preAdm.dispo_ID) INNER JOIN s_dispo AS previous ON L_Log.Previous_Location = previous.dispo_ID) INNER JOIN s_dispo AS SL ON L_Log.Service_Location = SL.dispo_ID) INNER JOIN s_dispo AS dispo ON L_Log.Dispo = dispo.dispo_ID WHERE (((L_Log.RecordStatus)="incomplete") AND ((preAdm.location_name)=[the_location_name])) OR (((L_Log.RecordStatus)="incomplete") AND ((previous.location_name)=[the_location_name])) OR (((L_Log.RecordStatus)="incomplete") AND ((SL.location_name)=[the_location_name])) OR (((L_Log.RecordStatus)="incomplete") AND ((dispo.location_name)=[the_location_name])) OR (((L_Log.RecordStatus)="incomplete") AND ((L_Log.Dispo_DtTm)<[end_date]) AND ((preAdm.location_name) Is Null)) OR (((L_Log.RecordStatus)="incomplete") AND ((L_Log.Dispo_DtTm)<[end_date]) AND ((previous.location_name) Is Null)) OR (((L_Log.RecordStatus)="incomplete") AND ((L_Log.Dispo_DtTm)<[end_date]) AND ((SL.location_name) Is Null)) OR (((L_Log.RecordStatus)="incomplete") AND ((L_Log.Dispo_DtTm)<[end_date]) AND ((dispo.location_name) Is Null));

Related articles

Related articles: