
-- Se actualiza el id del estado de investigación
UPDATE appointment_status SET id_appointment_status = 20 where id_appointment_status = 30;

-- Se actualizan los code_name de los estados
UPDATE appointment_status SET code_name =  '05-CANCELADA' where id_appointment_status =0;
UPDATE appointment_status SET code_name =  '10-PENDIENTE DE CONFIRMACIÓN' where id_appointment_status =1;
UPDATE appointment_status SET code_name =  '12-CONFIRMADA' where id_appointment_status =2;
UPDATE appointment_status SET code_name =  '91-PENDIENTE DE ASISTENCIAL' where id_appointment_status =3;
UPDATE appointment_status SET code_name =  '22-EN ASISTENCIAL' where id_appointment_status =4;
UPDATE appointment_status SET code_name =  '30-PENDIENTE DE LECTURA' where id_appointment_status =5;
UPDATE appointment_status SET code_name =  '32-EN LECTURA' where id_appointment_status =6;
UPDATE appointment_status SET code_name =  '40-PENDIENTE DE TRANSCRIPCIÓN' where id_appointment_status =7;
UPDATE appointment_status SET code_name =  '42-EN TRANSCRIPCIÓN' where id_appointment_status =8;
UPDATE appointment_status SET code_name =  '50-PENDIENTE DE VALIDACIÓN' where id_appointment_status =9;
UPDATE appointment_status SET code_name =  '52-EN VALIDACIÓN' where id_appointment_status =10;
UPDATE appointment_status SET code_name =  '54-VALIDADO' where id_appointment_status =11;
UPDATE appointment_status SET code_name =  '60-EN ENTREGA' where id_appointment_status =12;
UPDATE appointment_status SET code_name =  '62-ENTREGADO' where id_appointment_status =13;
UPDATE appointment_status SET code_name =  '92-ORDEN DE FACTURACIÓN' where id_appointment_status =14;
UPDATE appointment_status SET code_name =  '20-REGISTRADO' where id_appointment_status =15;
UPDATE appointment_status SET code_name =  '93-CANCELADA POR INASISTENCIA' where id_appointment_status =16;
UPDATE appointment_status SET code_name =  '08-ARCHIVO CLINICO' where id_appointment_status =17;
UPDATE appointment_status SET code_name =  '94-PENDIENTE DE RECEPCIÓN' where id_appointment_status =18;
UPDATE appointment_status SET code_name =  '64-SIN LECTURA' where id_appointment_status =19;
UPDATE appointment_status SET code_name =  '66-INVESTIGACIÓN' where id_appointment_status =20;