-- =====================================================
-- SCRIPT: anamnesi_v2_translations_en.sql
-- Aggiunta traduzioni inglesi per domande anamnesi V2
-- Data: 2026-01-20
-- =====================================================

-- Inserimento traduzioni inglesi
INSERT INTO CaseHistoryQuestionText (QuestionID, LanguageCode, QuestionText)
VALUES
    (1, 'EN', 'Do you suffer from allergies?'),
    (2, 'EN', 'Do you take medications regularly?'),
    (3, 'EN', 'Have you had surgical operations?'),
    (4, 'EN', 'Do you suffer from chronic conditions?'),
    (5, 'EN', 'Do you smoke?'),
    (6, 'EN', 'Do you consume alcohol?'),
    (7, 'EN', 'Do you practice physical activity?'),
    (8, 'EN', 'Weight (kg)'),
    (9, 'EN', 'Height (cm)'),
    (10, 'EN', 'Additional notes'),
    (11, 'EN', 'Do you have heart problems?'),
    (12, 'EN', 'Do you take anticoagulants?'),
    (13, 'EN', 'Are you allergic to medications?'),
    (14, 'EN', 'Are you allergic to latex?'),
    (15, 'EN', 'Do you have diabetes?'),
    (16, 'EN', 'Are you pregnant?'),
    (17, 'EN', 'When was your last dental visit?'),
    (18, 'EN', 'Do you have bleeding problems?'),
    (19, 'EN', 'Do you have heart problems?'),
    (20, 'EN', 'Do you take anticoagulants?'),
    (21, 'EN', 'Are you allergic to medications?'),
    (22, 'EN', 'Are you allergic to latex?'),
    (23, 'EN', 'Do you have diabetes?'),
    (24, 'EN', 'Are you pregnant?'),
    (25, 'EN', 'When was your last dental visit?'),
    (26, 'EN', 'Do you have bleeding problems?')
ON DUPLICATE KEY UPDATE QuestionText = VALUES(QuestionText);

-- Verifica risultato
SELECT
    v2.ID,
    v2.AnswerType,
    it.QuestionText as ITA,
    en.QuestionText as ENG
FROM CaseHistoryQuestion_V2 v2
LEFT JOIN CaseHistoryQuestionText it ON it.QuestionID = v2.ID AND it.LanguageCode = 'IT'
LEFT JOIN CaseHistoryQuestionText en ON en.QuestionID = v2.ID AND en.LanguageCode = 'EN'
ORDER BY v2.ID;

SELECT CONCAT('Totale traduzioni EN: ', COUNT(*)) AS Status
FROM CaseHistoryQuestionText WHERE LanguageCode = 'EN';
