UPDATE clinical_visits SET care_type = 'Inpatient' WHERE id IN(SELECT visit_id FROM clinical_visit_locations WHERE care_type = 'Inpatient');
UPDATE billing_folios SET subtype = (SELECT clinical_visits.care_type FROM clinical_visits WHERE id = billing_folios.visit_id);

UPDATE clinical_visits
JOIN clinical_visit_locations ON clinical_visit_locations.visit_id = clinical_visits.id
SET clinical_visits.admitted = 1
WHERE clinical_visits.admitted = 0
AND clinical_visit_locations.admitted = 1