You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like this could be generated from patient_condition and condition_type tables in star
There will be an many:one relationship so need to think about how to display
But could aggregate to label patient as needing SR?
The text was updated successfully, but these errors were encountered:
Example query below
Suggest build a webpage with a datatable (perhaps cached) that is populated from a generic query
will need some requirements that the query might return 'ward'
and then have a generic 'ward' filter option
Alternatively might want to delegate the 'census' step to the API and then the returned MRNs in a WHERE clause?
WITH icupts AS (
SELECTlv.admission_time--,lo.location_string
,lv.hospital_visit_id--,bed.hl7string--,bed.room_id--,room.hl7string
,room.name--,room.department_id--,department.hl7string
,department.name
,department.specialityFROMstar.location_visit lv
LEFT JOINstar.location lo ONlv.location_id=lo.location_idLEFT JOINstar.bedONlo.bed_id=bed.bed_idLEFT JOINstar.roomONlo.room_id=room.room_idLEFT JOINstar.departmentONroom.department_id=department.department_idWHERE SPLIT_PART(lo.location_string,'^',1) ~ '^(WSCC)'ANDlv.discharge_time IS NULLORDER BYlv.admission_timeDESC--LIMIT 5
)
SELECT
icupts.*
,vo.mrn_id
,vo.patient_class
,vo.arrival_method
,co.condition_type_id
,ct.name
,co.onset_date
,co.statusFROM icupts
LEFT JOIN hospital_visit vo ONicupts.hospital_visit_id=vo.hospital_visit_idINNER JOIN patient_condition co ONco.mrn_id=vo.mrn_idLEFT JOIN condition_type ct ONco.condition_type_id=ct.condition_type_id
;
From dashRep created by docsteveharris: docsteveharris#6
Looks like this could be generated from patient_condition and condition_type tables in star
There will be an many:one relationship so need to think about how to display
But could aggregate to label patient as needing SR?
The text was updated successfully, but these errors were encountered: