UPDATE patient
SET type_area = "4"
WHERE chwpart = "31" AND amppart = "11" AND tmbpart = "02"
AND moopart NOT IN("02","03","04","05","06","08","10","11","13","14","15","18","21","23","24") AND type_area IS null
UPDATE patient
SET type_area = "4"
WHERE chwpart <> "31" AND type_area IS null
UPDATE patient
SET type_area = "4"
WHERE type_area IS null