Clinical Assessment Unit: Difference between revisions

PTorres (talk | contribs)
m Inconsistencies between Previous Location and Previous Service: All inconsistencies have been cleared up so removing this section.
 
(3 intermediate revisions by 2 users not shown)
Line 16: Line 16:


On discussion with Julie it was decided to keep the s_dispo entries around and not convert them. The loc type is Ward in s_dispo which is enough when reporting - usually being  combined as <site> ward.
On discussion with Julie it was decided to keep the s_dispo entries around and not convert them. The loc type is Ward in s_dispo which is enough when reporting - usually being  combined as <site> ward.
== Inconsistencies between previous and pre-admit ==
Done [[User:PTorres|PTorres]] 17:22, 2022 June 21 (CDT)
}}
Done [[User:PTorres|PTorres]] 17:22, 2022 June 21 (CDT)
}}
== Inconsistencies between [[Previous Location]] and [[Previous Service]] ==
Julie requested that, when a pt has a CAU as [[Previous Location]] or [[Pre-admit Inpatient Institution]], profiles that have "Medicine" as [[Previous Service]] should have this changed to "Family Medicine".
{{Todo
| who = Pagasa 
| question =
The following query shows profiles that have inconsistent previous service and previous location for CAUs.
  SELECT L_Log.D_ID, s_dispo.location_name AS pre_admit, s_dispo_1.location_name AS previous, s_previous_service.previous_service
FROM ((L_Log LEFT JOIN s_dispo ON L_Log.Pre_admit_Inpatient_Institution = s_dispo.dispo_ID) LEFT JOIN s_dispo AS s_dispo_1 ON L_Log.Previous_Location = s_dispo_1.dispo_ID) INNER JOIN s_previous_service ON L_Log.Previous_Service = s_previous_service.previous_service_ID
WHERE (((s_dispo.location_name) Like "*CAU") AND ((s_previous_service.previous_service)<>"Family Medicine")) OR (((s_dispo_1.location_name) Like "*CAU") AND ((s_previous_service.previous_service)<>"Family Medicine"))
ORDER BY s_previous_service.previous_service;
The following query will update these to "Family Medicine" as they should be:
UPDATE ((L_Log LEFT JOIN s_dispo ON L_Log.Pre_admit_Inpatient_Institution = s_dispo.dispo_ID) LEFT JOIN s_dispo AS s_dispo_1 ON L_Log.Previous_Location = s_dispo_1.dispo_ID) INNER JOIN s_previous_service ON L_Log.Previous_Service = s_previous_service.previous_service_ID SET s_previous_service.previous_service = "Family Medicine"
WHERE (((s_dispo.location_name) Like "*CAU") AND ((s_previous_service.previous_service)<>"Family Medicine")) OR (((s_dispo_1.location_name) Like "*CAU") AND ((s_previous_service.previous_service)<>"Family Medicine"));
Could you please run the first query, which should list 60-some records, then the second query to fix them, and then the first again to make sure they are gone? Thanks!
| todo_added = 2022-02-17
}}


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