getDiseaseById method
Retrieves a specific disease by ID for a specific language.
Returns a single disease with localized information and associated mosquito vectors, or null if not found.
@param id The unique identifier of the disease @param languageCode The language code (e.g., 'en', 'es') @return A Future that completes with a Disease or null
Implementation
Future<Disease?> getDiseaseById(String id, String languageCode) async {
final db = await database;
final List<Map<String, dynamic>> maps = await db.rawQuery('''
SELECT
d.id, d.image_url,
t.name, t.description, t.symptoms, t.treatment, t.prevention, t.prevalence
FROM diseases d
LEFT JOIN disease_translations t ON d.id = t.disease_id
WHERE d.id = ? AND t.language_code = ?
''', [id, languageCode]);
if (maps.isEmpty) return null;
final map = maps.first;
final vectorNames = await _getVectorNamesForDisease(db, map['id']);
return Disease(
id: map['id'],
name: map['name'],
description: map['description'],
symptoms: map['symptoms'],
treatment: map['treatment'],
prevention: map['prevention'],
vectors: vectorNames,
prevalence: map['prevalence'],
imageUrl: map['image_url'],
);
}