Skip to content

Commit

Permalink
CDD-2458: Update metric validation for ingestion
Browse files Browse the repository at this point in the history
  • Loading branch information
phill-stanley committed Jan 31, 2025
1 parent f3c5e91 commit 294ffa0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
11 changes: 11 additions & 0 deletions ingestion/utils/enums/theme_and_topic_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class _ExtremeEventChildTheme(Enum):
WEATHER_ALERT = "weather_alert"


class _NonCommunicableChildTheme(Enum):
RESPIRATORY = "respiratory"


class _VaccinePreventableTopic(Enum):
MEASLES = "Measles"

Expand All @@ -24,12 +28,17 @@ class _WeatherAlertTopic(Enum):

class _RespiratoryTopic(Enum):
COVID_19 = "COVID-19"
COVID_19_LIKE = "COVID-19-like"
INFLUENZA = "Influenza"
INFLUENZA_LIKE = "influenza-like"
RSV = "RSV"
ACUTE_BRONCHIOLITIS = "acute-bronchiolitis"
ACUTE_RESPIRATORY_INFECTION = "acute-respiratory-infection"
HMPV = "hMPV"
PARAINFLUENZA = "Parainfluenza"
RHINOVIRUS = "Rhinovirus"
ADENOVIRUS = "Adenovirus"
ASTHMA = "asthma"


class _BloodstreamInfectionTopic(Enum):
Expand All @@ -56,11 +65,13 @@ def return_list(self):
class ParentTheme(Enum):
INFECTIOUS_DISEASE = "infectious_disease"
EXTREME_EVENT = "extreme_event"
NON_COMMUNICABLE = "non-communicable"


class ChildTheme(BaseEnum):
INFECTIOUS_DISEASE = _InfectiousDiseaseChildTheme
EXTREME_EVENT = _ExtremeEventChildTheme
NON_COMMUNICABLE = _NonCommunicableChildTheme


class Topic(BaseEnum):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.1.5 on 2025-01-31 14:24

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("data", "0033_remove_rounding_column_from_metric_table"),
]

operations = [
migrations.RemoveConstraint(
model_name="subtheme",
name="`SubTheme` name should be unique",
),
]
3 changes: 0 additions & 3 deletions metrics/data/models/core_models/supporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class SubTheme(models.Model):

class Meta:
constraints = [
models.UniqueConstraint(
fields=["name"], name="`SubTheme` name should be unique"
),
models.UniqueConstraint(
fields=["name", "theme"],
name="`SubTheme` and `Theme` should be a unique combination",
Expand Down
1 change: 1 addition & 0 deletions metrics/domain/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class DataSourceFileType(Enum):
healthcare = "healthcare"
testing = "testing"
vaccinations = "vaccinations"
syndromic = "syndromic"

@property
def is_headline(self) -> bool:
Expand Down

0 comments on commit 294ffa0

Please sign in to comment.