Dhruva P Gowda commited on
Commit
2753128
·
1 Parent(s): 87bfc41

Bundle backend seed data for Vercel runtime

Browse files
backend/app/config.py CHANGED
@@ -2,12 +2,33 @@
2
  Configuration management for the PharmaShield backend using Pydantic Settings.
3
  """
4
 
 
5
  import logging
6
- from typing import List
7
  from pathlib import Path
 
 
 
8
  from pydantic_settings import BaseSettings, SettingsConfigDict
9
 
10
- BASE_DIR = Path(__file__).resolve().parent.parent.parent
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
 
13
  class Settings(BaseSettings):
@@ -15,11 +36,12 @@ class Settings(BaseSettings):
15
  Application settings and environment variables.
16
  Defaults are provided where safe; sensitive keys must be provided in .env or environment.
17
  """
 
18
  # API Keys & Endpoints
19
  GEMINI_API_KEY: str = ""
20
  QDRANT_URL: str = ""
21
  QDRANT_API_KEY: str = ""
22
-
23
  # Project Info
24
  FIREBASE_PROJECT_ID: str = ""
25
  BACKEND_URL: str = "http://localhost:8080"
@@ -27,48 +49,66 @@ class Settings(BaseSettings):
27
  "http://localhost:3000",
28
  "http://localhost:5173",
29
  "http://localhost:8080",
30
- "https://pharmashield.web.app"
31
  ]
32
-
33
  # Paths
34
  SEED_DATA_DIR: str = str(BASE_DIR / "data" / "seed")
35
  GNN_WEIGHTS_PATH: str = str(BASE_DIR / "ml" / "weights" / "gnn_v1.pt")
36
  ENABLE_GNN: bool = False
37
  DEMO_MODE: bool = True
38
  DEMO_SCENARIOS_PATH: str = str(BASE_DIR / "data" / "seed" / "demo_scenarios.json")
39
-
40
  # Model & Database Configurations
41
  QDRANT_COLLECTION: str = "pharmashield_kb"
42
  GEMINI_FLASH_MODEL: str = "gemini-2.0-flash"
43
  GEMINI_PRO_MODEL: str = "gemini-2.5-pro"
44
  EMBEDDING_MODEL: str = "models/gemini-embedding-001"
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  model_config = SettingsConfigDict(
47
  env_file=(
48
  BASE_DIR / "backend" / ".env",
49
  BASE_DIR / ".env",
50
  ),
51
  env_file_encoding="utf-8",
52
- extra="ignore"
53
  )
54
 
55
 
56
- # Instantiate settings
57
  try:
58
  settings = Settings()
59
-
60
- # Validation check for critical environment variables
61
  if not settings.GEMINI_API_KEY or not settings.QDRANT_URL:
62
  missing = []
63
- if not settings.GEMINI_API_KEY: missing.append("GEMINI_API_KEY")
64
- if not settings.QDRANT_URL: missing.append("QDRANT_URL")
65
-
 
 
66
  logging.warning(
67
- f"⚠️ Missing non-critical configuration: {', '.join(missing)}. "
68
- "Some features may be disabled."
69
  )
70
  except Exception as e:
71
- # Re-raise if it's already our RuntimeError, otherwise wrap it
72
  if isinstance(e, RuntimeError):
73
  raise e
74
  raise RuntimeError(f"Failed to load application settings: {str(e)}")
 
2
  Configuration management for the PharmaShield backend using Pydantic Settings.
3
  """
4
 
5
+ import json
6
  import logging
 
7
  from pathlib import Path
8
+ from typing import List
9
+
10
+ from pydantic import field_validator
11
  from pydantic_settings import BaseSettings, SettingsConfigDict
12
 
13
+
14
+ def _discover_base_dir() -> Path:
15
+ """
16
+ Find the project base directory by looking for bundled seed data.
17
+
18
+ Local development usually has ``repo_root/data``.
19
+ Backend-only serverless deployments use ``backend/data``.
20
+ """
21
+ config_path = Path(__file__).resolve()
22
+
23
+ for candidate in reversed(config_path.parents):
24
+ if (candidate / "data" / "seed" / "drugs.json").exists():
25
+ return candidate
26
+
27
+ # Fallback to the backend root if no data bundle is found yet.
28
+ return config_path.parent.parent
29
+
30
+
31
+ BASE_DIR = _discover_base_dir()
32
 
33
 
34
  class Settings(BaseSettings):
 
36
  Application settings and environment variables.
37
  Defaults are provided where safe; sensitive keys must be provided in .env or environment.
38
  """
39
+
40
  # API Keys & Endpoints
41
  GEMINI_API_KEY: str = ""
42
  QDRANT_URL: str = ""
43
  QDRANT_API_KEY: str = ""
44
+
45
  # Project Info
46
  FIREBASE_PROJECT_ID: str = ""
47
  BACKEND_URL: str = "http://localhost:8080"
 
49
  "http://localhost:3000",
50
  "http://localhost:5173",
51
  "http://localhost:8080",
52
+ "https://pharmashield.web.app",
53
  ]
54
+
55
  # Paths
56
  SEED_DATA_DIR: str = str(BASE_DIR / "data" / "seed")
57
  GNN_WEIGHTS_PATH: str = str(BASE_DIR / "ml" / "weights" / "gnn_v1.pt")
58
  ENABLE_GNN: bool = False
59
  DEMO_MODE: bool = True
60
  DEMO_SCENARIOS_PATH: str = str(BASE_DIR / "data" / "seed" / "demo_scenarios.json")
61
+
62
  # Model & Database Configurations
63
  QDRANT_COLLECTION: str = "pharmashield_kb"
64
  GEMINI_FLASH_MODEL: str = "gemini-2.0-flash"
65
  GEMINI_PRO_MODEL: str = "gemini-2.5-pro"
66
  EMBEDDING_MODEL: str = "models/gemini-embedding-001"
67
 
68
+ @field_validator("ALLOWED_ORIGINS", mode="before")
69
+ @classmethod
70
+ def parse_allowed_origins(cls, value):
71
+ if isinstance(value, list):
72
+ return value
73
+ if isinstance(value, str):
74
+ text = value.strip()
75
+ if not text:
76
+ return []
77
+ if text.startswith("["):
78
+ try:
79
+ parsed = json.loads(text)
80
+ except json.JSONDecodeError:
81
+ parsed = None
82
+ if isinstance(parsed, list):
83
+ return [str(item).strip() for item in parsed if str(item).strip()]
84
+ return [item.strip() for item in text.split(",") if item.strip()]
85
+ return value
86
+
87
  model_config = SettingsConfigDict(
88
  env_file=(
89
  BASE_DIR / "backend" / ".env",
90
  BASE_DIR / ".env",
91
  ),
92
  env_file_encoding="utf-8",
93
+ extra="ignore",
94
  )
95
 
96
 
 
97
  try:
98
  settings = Settings()
99
+
 
100
  if not settings.GEMINI_API_KEY or not settings.QDRANT_URL:
101
  missing = []
102
+ if not settings.GEMINI_API_KEY:
103
+ missing.append("GEMINI_API_KEY")
104
+ if not settings.QDRANT_URL:
105
+ missing.append("QDRANT_URL")
106
+
107
  logging.warning(
108
+ "Missing non-critical configuration: %s. Some features may be disabled.",
109
+ ", ".join(missing),
110
  )
111
  except Exception as e:
 
112
  if isinstance(e, RuntimeError):
113
  raise e
114
  raise RuntimeError(f"Failed to load application settings: {str(e)}")
backend/data/seed/.gitkeep ADDED
@@ -0,0 +1 @@
 
 
1
+
backend/data/seed/alerts.json ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "alert_paracetamol_2024_q1",
4
+ "created_at": "2024-01-17T08:30:00Z",
5
+ "severity": "CRITICAL",
6
+ "source": "HEBEI_EPB",
7
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/2024/01/15/api-plant-shutdown",
8
+ "summary": "Hebei API plant production halt — paracetamol supply at risk",
9
+ "affected_drugs": ["paracetamol"],
10
+ "expected_weeks_to_shortage": 3,
11
+ "gemini_explainer": "A para-aminophenol production facility in Hebei Province was issued a full environmental compliance shutdown order on January 15, 2024. This factory supplies an estimated 30% of India's paracetamol API. Based on historical inventory cycles, Indian retail prices typically respond 3 weeks after such disruptions.",
12
+ "evidence_snippet": "石家庄市某制药企业因环保不达标停产 / Shijiazhuang pharmaceutical enterprise halted for environmental non-compliance"
13
+ },
14
+ {
15
+ "id": "alert_amoxicillin_2026_04_15",
16
+ "created_at": "2026-04-15T10:15:00Z",
17
+ "severity": "HIGH",
18
+ "source": "NEWS",
19
+ "source_url": "https://reuters.com/business/pharma/jiangsu-industrial-accident-impacts-pharma",
20
+ "summary": "Industrial accident in Jiangsu impacts 6-APA precursors",
21
+ "affected_drugs": ["amoxicillin", "penicillin_g"],
22
+ "expected_weeks_to_shortage": 4,
23
+ "gemini_explainer": "A major chemical explosion in a Jiangsu industrial park has forced the evacuation of three 6-APA manufacturing lines. This region accounts for 20% of the global beta-lactam core supply. Lead times for antibiotic finished dosages in India are expected to increase by 30 days.",
24
+ "evidence_snippet": "Jiangsu industrial park evacuated following chemical storage fire; production lines halted indefinitely."
25
+ },
26
+ {
27
+ "id": "alert_azithromycin_2026_04_18",
28
+ "created_at": "2026-04-18T14:45:00Z",
29
+ "severity": "HIGH",
30
+ "source": "FDA_WARNING_LETTER",
31
+ "source_url": "https://fda.gov/warning-letters/2026/china-api-inspection-fail",
32
+ "summary": "FDA Warning Letter for Jiangsu Macrolide Facility",
33
+ "affected_drugs": ["azithromycin"],
34
+ "expected_weeks_to_shortage": 6,
35
+ "gemini_explainer": "The FDA has issued a Warning Letter to a major azithromycin dihydrate exporter following data integrity violations. While production continues, several US and EU buyers are shifting orders to alternative sites, increasing demand pressure on secondary Indian manufacturers.",
36
+ "evidence_snippet": "Observations regarding the failure to maintain complete data from testing performed to ensure API quality and purity."
37
+ },
38
+ {
39
+ "id": "alert_ceftriaxone_2026_04_20",
40
+ "created_at": "2026-04-20T09:00:00Z",
41
+ "severity": "HIGH",
42
+ "source": "HEBEI_EPB",
43
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/winter-curtailment-2026",
44
+ "summary": "Hebei winter heating production cuts affect 7-ACA",
45
+ "affected_drugs": ["ceftriaxone"],
46
+ "expected_weeks_to_shortage": 2,
47
+ "gemini_explainer": "Emergency winter heating measures in Hebei have mandated a 40% reduction in coal-powered pharmaceutical synthesis output. Ceftriaxone dependencies on 7-ACA are directly hit, with immediate price spikes observed in the North Indian wholesale markets.",
48
+ "evidence_snippet": "重点行业企业大气污染减排措施公告 / Announcement of emission reduction measures for key industrial enterprises."
49
+ },
50
+ {
51
+ "id": "alert_metformin_2026_04_21",
52
+ "created_at": "2026-04-21T11:20:00Z",
53
+ "severity": "MEDIUM",
54
+ "source": "TRADE_ANOMALY",
55
+ "source_url": null,
56
+ "summary": "Sudden drop in Metformin HCl import volumes from China",
57
+ "affected_drugs": ["metformin"],
58
+ "expected_weeks_to_shortage": 8,
59
+ "gemini_explainer": "DGCI&S port data indicates a 25% month-on-month decline in Metformin HCl arrivals from Jiangsu. While buffer stocks are available for 2 months, the sustained anomaly suggests potential logistical bottlenecks or strategic stock-holding by suppliers.",
60
+ "evidence_snippet": "Inbound container tracking at Mundra Port shows zero arrivals for registered Metformin exporters over 14 consecutive days."
61
+ },
62
+ {
63
+ "id": "alert_penicillin_2026_04_22",
64
+ "created_at": "2026-04-22T16:00:00Z",
65
+ "severity": "MEDIUM",
66
+ "source": "HEBEI_EPB",
67
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/inspect-2026-04",
68
+ "summary": "Random inspection wave at Hebei Penicillin fermentation sites",
69
+ "affected_drugs": ["penicillin_g"],
70
+ "expected_weeks_to_shortage": null,
71
+ "gemini_explainer": "Government inspectors are conducting unannounced audits of fermentation waste-water management in Shijiazhuang. This is causing minor operational delays but has not yet resulted in formal shutdown orders for the Penicillin G lines.",
72
+ "evidence_snippet": "Random audit phase 4 initiated for pharmaceutical fermentation clusters in the High-Tech District."
73
+ },
74
+ {
75
+ "id": "alert_atorvastatin_2026_04_23",
76
+ "created_at": "2026-04-23T08:30:00Z",
77
+ "severity": "MEDIUM",
78
+ "source": "NEWS",
79
+ "source_url": "https://pharmabiz.com/news/api-price-monitoring-report-april",
80
+ "summary": "Atorvastatin API price anomaly detected in Mumbai wholesale",
81
+ "affected_drugs": ["atorvastatin"],
82
+ "expected_weeks_to_shortage": 12,
83
+ "gemini_explainer": "Wholesale price of Atorvastatin Calcium has spiked 15% in 48 hours without a corresponding raw material cost increase. This speculative behavior often precedes reported supply tightness from Chinese exporters.",
84
+ "evidence_snippet": "Mumbai-Ahmedabad corridor reporting limited availability of premium grade Atorvastatin for immediate delivery."
85
+ },
86
+ {
87
+ "id": "alert_insulin_2026_04_24",
88
+ "created_at": "2026-04-24T17:15:00Z",
89
+ "severity": "LOW",
90
+ "source": "MANUAL",
91
+ "source_url": null,
92
+ "summary": "Single-source concentration risk identified for recombinant insulin",
93
+ "affected_drugs": ["insulin"],
94
+ "expected_weeks_to_shortage": null,
95
+ "gemini_explainer": "Supply chain mapping reveals that 65% of recombinant insulin precursors for a major Indian brand now originate from a single Jiangsu facility. While currently stable, this lack of diversification represents a long-term strategic vulnerability.",
96
+ "evidence_snippet": "Vendor concentration audit shows loss of secondary sourcing capability for recombinant yeast strains."
97
+ }
98
+ ]
backend/data/seed/apis.json ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "para_aminophenol",
4
+ "name": "Para-Aminophenol",
5
+ "china_share": 0.85,
6
+ "primary_provinces": ["Hebei", "Hubei"],
7
+ "top_3_factories": ["Hebei Jiheng Group", "Anhui Bayi Chemical", "Liaoning Shixian"],
8
+ "monthly_import_value_usd_millions": 45.0
9
+ },
10
+ {
11
+ "id": "6_apa",
12
+ "name": "6-APA",
13
+ "china_share": 0.90,
14
+ "primary_provinces": ["Hebei", "Jiangsu"],
15
+ "top_3_factories": ["United Laboratories", "CSPC Pharmaceutical", "North China Pharmaceutical"],
16
+ "monthly_import_value_usd_millions": 85.0
17
+ },
18
+ {
19
+ "id": "7_aca",
20
+ "name": "7-ACA",
21
+ "china_share": 0.92,
22
+ "primary_provinces": ["Shandong", "Hebei"],
23
+ "top_3_factories": ["Shandong Lukang", "Hebei Welcome", "CSPC Ouyi"],
24
+ "monthly_import_value_usd_millions": 110.0
25
+ },
26
+ {
27
+ "id": "ampicillin_trihydrate",
28
+ "name": "Ampicillin Trihydrate",
29
+ "china_share": 0.88,
30
+ "primary_provinces": ["Hebei"],
31
+ "top_3_factories": ["Shijiazhuang Pharmaceutical", "North China Pharma", "Hebei Jiheng"],
32
+ "monthly_import_value_usd_millions": 30.0
33
+ },
34
+ {
35
+ "id": "azithromycin_dihydrate",
36
+ "name": "Azithromycin Dihydrate",
37
+ "china_share": 0.85,
38
+ "primary_provinces": ["Jiangsu"],
39
+ "top_3_factories": ["Yangzhou Pharmaceutical", "Jiangsu Nhwa", "Wuxi AppTec"],
40
+ "monthly_import_value_usd_millions": 60.0
41
+ },
42
+ {
43
+ "id": "penicillin_g_potassium",
44
+ "name": "Penicillin G Potassium",
45
+ "china_share": 0.95,
46
+ "primary_provinces": ["Hebei", "Hubei"],
47
+ "top_3_factories": ["CSPC Group", "North China Pharmaceutical", "Hubei Huashu"],
48
+ "monthly_import_value_usd_millions": 120.0
49
+ },
50
+ {
51
+ "id": "metformin_hcl",
52
+ "name": "Metformin HCl",
53
+ "china_share": 0.78,
54
+ "primary_provinces": ["Jiangsu", "Zhejiang"],
55
+ "top_3_factories": ["Zhejiang Starry", "Jiangsu Wanbang", "Changzhou Pharmaceutical"],
56
+ "monthly_import_value_usd_millions": 40.0
57
+ },
58
+ {
59
+ "id": "atorvastatin_calcium",
60
+ "name": "Atorvastatin Calcium",
61
+ "china_share": 0.82,
62
+ "primary_provinces": ["Zhejiang"],
63
+ "top_3_factories": ["Zhejiang Hisun", "Zhejiang Medicine", "Zhejiang Xianju"],
64
+ "monthly_import_value_usd_millions": 55.0
65
+ },
66
+ {
67
+ "id": "amlodipine_besylate",
68
+ "name": "Amlodipine Besylate",
69
+ "china_share": 0.80,
70
+ "primary_provinces": ["Jiangsu"],
71
+ "top_3_factories": ["Jiangsu Hansoh", "Jiangsu Hengrui", "Chia Tai Tianqing"],
72
+ "monthly_import_value_usd_millions": 35.0
73
+ },
74
+ {
75
+ "id": "losartan_potassium",
76
+ "name": "Losartan Potassium",
77
+ "china_share": 0.83,
78
+ "primary_provinces": ["Zhejiang"],
79
+ "top_3_factories": ["Zhejiang Huahai", "Zhejiang Jingxin", "Zhejiang Yongning"],
80
+ "monthly_import_value_usd_millions": 25.0
81
+ },
82
+ {
83
+ "id": "omeprazole_api",
84
+ "name": "Omeprazole API",
85
+ "china_share": 0.85,
86
+ "primary_provinces": ["Jiangsu"],
87
+ "top_3_factories": ["Jiangsu Yahong", "Jiangsu Aoyuan", "Changzhou Siyao"],
88
+ "monthly_import_value_usd_millions": 42.0
89
+ },
90
+ {
91
+ "id": "ranitidine_hcl",
92
+ "name": "Ranitidine HCl",
93
+ "china_share": 0.80,
94
+ "primary_provinces": ["Hubei"],
95
+ "top_3_factories": ["Wuhan Wuyao", "Hubei Hongyuan", "Wuhan Zhongzhi"],
96
+ "monthly_import_value_usd_millions": 18.0
97
+ },
98
+ {
99
+ "id": "ibuprofen_api",
100
+ "name": "Ibuprofen API",
101
+ "china_share": 0.82,
102
+ "primary_provinces": ["Hebei", "Shandong"],
103
+ "top_3_factories": ["Shandong Xinhua", "Hubei Biocause", "Hebei Jiheng"],
104
+ "monthly_import_value_usd_millions": 70.0
105
+ },
106
+ {
107
+ "id": "diclofenac_sodium",
108
+ "name": "Diclofenac Sodium",
109
+ "china_share": 0.78,
110
+ "primary_provinces": ["Zhejiang"],
111
+ "top_3_factories": ["Zhejiang Anglikang", "Zhejiang Sanmen", "Zhejiang Jixing"],
112
+ "monthly_import_value_usd_millions": 22.0
113
+ },
114
+ {
115
+ "id": "acetylsalicylic_acid",
116
+ "name": "Acetylsalicylic Acid",
117
+ "china_share": 0.65,
118
+ "primary_provinces": ["Hubei"],
119
+ "top_3_factories": ["Wuhan Grand", "Hubei Maxun", "Wuhan Fortune"],
120
+ "monthly_import_value_usd_millions": 15.0
121
+ },
122
+ {
123
+ "id": "gentamicin_sulfate",
124
+ "name": "Gentamicin Sulfate",
125
+ "china_share": 0.90,
126
+ "primary_provinces": ["Hebei"],
127
+ "top_3_factories": ["North China Pharmaceutical", "Hebei Welcome", "Shijiazhuang Pharma"],
128
+ "monthly_import_value_usd_millions": 12.0
129
+ },
130
+ {
131
+ "id": "fluconazole_api",
132
+ "name": "Fluconazole API",
133
+ "china_share": 0.85,
134
+ "primary_provinces": ["Jiangsu"],
135
+ "top_3_factories": ["Jiangsu Nhwa", "Jiangsu Hengrui", "Changzhou Pharma"],
136
+ "monthly_import_value_usd_millions": 28.0
137
+ },
138
+ {
139
+ "id": "ciprofloxacin_hcl",
140
+ "name": "Ciprofloxacin HCl",
141
+ "china_share": 0.83,
142
+ "primary_provinces": ["Zhejiang"],
143
+ "top_3_factories": ["Zhejiang Hisun", "Zhejiang Medicine", "Zhejiang East-Asia"],
144
+ "monthly_import_value_usd_millions": 48.0
145
+ },
146
+ {
147
+ "id": "levofloxacin_hemihydrate",
148
+ "name": "Levofloxacin Hemihydrate",
149
+ "china_share": 0.85,
150
+ "primary_provinces": ["Zhejiang"],
151
+ "top_3_factories": ["Zhejiang Hisun", "Zhejiang Jingxin", "Zhejiang Starry"],
152
+ "monthly_import_value_usd_millions": 32.0
153
+ },
154
+ {
155
+ "id": "insulin_recombinant",
156
+ "name": "Insulin Recombinant",
157
+ "china_share": 0.45,
158
+ "primary_provinces": ["Jiangsu"],
159
+ "top_3_factories": ["Jiangsu Wanbang", "Gan & Lee Pharma", "Tonghua Dongbao"],
160
+ "monthly_import_value_usd_millions": 90.0
161
+ },
162
+ {
163
+ "id": "salbutamol_sulfate",
164
+ "name": "Salbutamol Sulfate",
165
+ "china_share": 0.80,
166
+ "primary_provinces": ["Hubei"],
167
+ "top_3_factories": ["Wuhan Wuyao", "Hubei Kexing", "Wuhan Fortune"],
168
+ "monthly_import_value_usd_millions": 14.0
169
+ },
170
+ {
171
+ "id": "clavulanic_acid",
172
+ "name": "Clavulanic Acid",
173
+ "china_share": 0.88,
174
+ "primary_provinces": ["Shandong"],
175
+ "top_3_factories": ["Shandong Lukang", "CSPC Group", "United Laboratories"],
176
+ "monthly_import_value_usd_millions": 65.0
177
+ },
178
+ {
179
+ "id": "erythromycin_thiocyanate",
180
+ "name": "Erythromycin Thiocyanate",
181
+ "china_share": 0.92,
182
+ "primary_provinces": ["Hebei"],
183
+ "top_3_factories": ["Ningxia Qiyuan", "Hebei Welcome", "CSPC Pharma"],
184
+ "monthly_import_value_usd_millions": 50.0
185
+ },
186
+ {
187
+ "id": "sodium_dichloroisocyanurate",
188
+ "name": "Sodium Dichloroisocyanurate",
189
+ "china_share": 0.75,
190
+ "primary_provinces": ["Hebei"],
191
+ "top_3_factories": ["Hebei Jiheng", "Shandong Daming", "Shijiazhuang Pharma"],
192
+ "monthly_import_value_usd_millions": 8.0
193
+ },
194
+ {
195
+ "id": "heparin_sodium",
196
+ "name": "Heparin Sodium",
197
+ "china_share": 0.88,
198
+ "primary_provinces": ["Jiangsu"],
199
+ "top_3_factories": ["Hepalink", "Jiangsu Wanbang", "Changzhou Qianhong"],
200
+ "monthly_import_value_usd_millions": 180.0
201
+ }
202
+ ]
backend/data/seed/demo_scenarios.json ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "demo_hebei_factory_shutdown_2026_04_26",
4
+ "scenario_label": "Hebei analgesic stress",
5
+ "sector": "pharma",
6
+ "title": "Hebei factory shutdown disrupts para-aminophenol and 7-ACA output",
7
+ "summary": "Environmental inspectors halted two Hebei synthesis lines supplying para-aminophenol and 7-ACA intermediates. Indian buyers are expected to feel pressure on paracetamol and ceftriaxone contracts within 8 to 12 days if output does not resume.",
8
+ "province": "Hebei",
9
+ "severity": "CRITICAL",
10
+ "event_type": "factory_shutdown",
11
+ "keyword_trigger": "factory shutdown",
12
+ "source": "HEBEI_EPB",
13
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/2026/04/hebei-pharma-curtailment",
14
+ "published_at": "2026-04-26T04:30:00Z",
15
+ "detected_at": "2026-04-26T04:45:00Z",
16
+ "gdelt_sources": 6,
17
+ "extraction_method": "demo_scenario",
18
+ "confidence": 0.88,
19
+ "affected_entities": [
20
+ "paracetamol",
21
+ "ceftriaxone",
22
+ "para_aminophenol",
23
+ "7_aca"
24
+ ],
25
+ "query_clues": [
26
+ "hebei",
27
+ "paracetamol",
28
+ "ceftriaxone",
29
+ "factory shutdown",
30
+ "api",
31
+ "buffer stock",
32
+ "critical medicines"
33
+ ],
34
+ "demo_citations": [
35
+ {
36
+ "source": "Hebei EPB Curtailed Production Notice",
37
+ "snippet": "Two bulk-drug precursor lines in Shijiazhuang were ordered offline pending emissions remediation and wastewater treatment review.",
38
+ "url": "https://hbsthjt.hebei.gov.cn/notice/2026/04/hebei-pharma-curtailment"
39
+ },
40
+ {
41
+ "source": "ShockMap Demo Procurement Note",
42
+ "snippet": "North India paracetamol buyers have under 12 days of cover against contracted April demand if Hebei output stays offline.",
43
+ "url": null
44
+ }
45
+ ],
46
+ "structured_plan": {
47
+ "summary": "Protect paracetamol and ceftriaxone cover before distributor allocations begin in North and West India.",
48
+ "immediate_actions": [
49
+ "Lock 40 MT para-aminophenol equivalent from Divi's Laboratories and Granules India within 72 hours; target spend cap USD 2.4M.",
50
+ "Reallocate 12 MT ceftriaxone intermediate cover from low-velocity institutional accounts to state tender commitments.",
51
+ "Freeze non-essential export commitments for paracetamol tablets until stock cover is back above 18 days."
52
+ ],
53
+ "medium_term_actions": [
54
+ "Raise safety stock for paracetamol and ceftriaxone APIs from 14 days to 30 days for the next procurement cycle.",
55
+ "Qualify one non-Hebei backup source for para-aminophenol and 7-ACA with pre-approved QA release windows."
56
+ ],
57
+ "policy_escalation_trigger": "Escalate to Department of Pharmaceuticals if weighted stock cover drops below 10 days or wholesale price rises above 12% week on week.",
58
+ "estimated_impact": "Paracetamol syrup and ceftriaxone vial lines could enter controlled allocation in 8 to 12 days.",
59
+ "confidence": 0.86
60
+ }
61
+ },
62
+ {
63
+ "id": "demo_jiangsu_contamination_2026_04_26",
64
+ "scenario_label": "Jiangsu beta-lactam contamination",
65
+ "sector": "pharma",
66
+ "title": "Jiangsu contamination event hits 6-APA fermentation cluster",
67
+ "summary": "A contamination incident in Jiangsu forced batch destruction across a major 6-APA cluster. The disruption raises near-term risk for amoxicillin and penicillin supply into Indian hospital tenders.",
68
+ "province": "Jiangsu",
69
+ "severity": "HIGH",
70
+ "event_type": "contamination",
71
+ "keyword_trigger": "contamination",
72
+ "source": "NEWS",
73
+ "source_url": "https://reuters.com/world/china/jiangsu-chemical-contamination-beta-lactam-cluster",
74
+ "published_at": "2026-04-26T02:15:00Z",
75
+ "detected_at": "2026-04-26T02:28:00Z",
76
+ "gdelt_sources": 4,
77
+ "extraction_method": "demo_scenario",
78
+ "confidence": 0.81,
79
+ "affected_entities": [
80
+ "amoxicillin",
81
+ "penicillin_g",
82
+ "6_apa",
83
+ "ampicillin_trihydrate"
84
+ ],
85
+ "query_clues": [
86
+ "jiangsu",
87
+ "amoxicillin",
88
+ "penicillin",
89
+ "contamination",
90
+ "antibiotic",
91
+ "hospital tender"
92
+ ],
93
+ "demo_citations": [
94
+ {
95
+ "source": "Jiangsu Industrial Incident Wire",
96
+ "snippet": "Batch contamination in a Jiangsu beta-lactam fermentation park forced destruction of in-process 6-APA inventory and paused dispatches.",
97
+ "url": "https://reuters.com/world/china/jiangsu-chemical-contamination-beta-lactam-cluster"
98
+ },
99
+ {
100
+ "source": "ShockMap Demo QA Note",
101
+ "snippet": "Amoxicillin lines serving public tenders have roughly 14 days of API cover under normal offtake assumptions.",
102
+ "url": null
103
+ }
104
+ ],
105
+ "structured_plan": {
106
+ "summary": "Preserve antibiotic tender fulfillment while contaminated Jiangsu lots are quarantined.",
107
+ "immediate_actions": [
108
+ "Advance-buy 18 MT 6-APA from approved non-Jiangsu sources and reserve QA release slots; keep spend under USD 1.1M.",
109
+ "Prioritize amoxicillin and penicillin hospital packs over private-channel SKUs for the next 10 days.",
110
+ "Require inbound lot segregation and accelerated micro testing for all beta-lactam APIs received this week."
111
+ ],
112
+ "medium_term_actions": [
113
+ "Re-balance antibiotic procurement so no single Jiangsu cluster covers more than 35% of 6-APA demand.",
114
+ "Build a 21-day emergency buffer for penicillin G and amoxicillin tender formulations."
115
+ ],
116
+ "policy_escalation_trigger": "Escalate if any additional contamination notice lands or if tender fill-rate drops below 95%.",
117
+ "estimated_impact": "Hospital amoxicillin dispatch reliability could degrade within 10 to 14 days without emergency replenishment.",
118
+ "confidence": 0.8
119
+ }
120
+ },
121
+ {
122
+ "id": "demo_inner_mongolia_export_ban_2026_04_26",
123
+ "scenario_label": "Inner Mongolia magnet materials ban",
124
+ "sector": "rare_earth",
125
+ "title": "Inner Mongolia export ban tightens dysprosium and neodymium shipments",
126
+ "summary": "A temporary export control notice from Inner Mongolia has frozen new customs clearances for dysprosium and neodymium concentrate. EV motor, magnet, and defense alloy supply chains are expected to absorb immediate pricing pressure.",
127
+ "province": "Inner Mongolia",
128
+ "severity": "CRITICAL",
129
+ "event_type": "export_ban",
130
+ "keyword_trigger": "export ban",
131
+ "source": "CUSTOMS_NOTICE",
132
+ "source_url": "https://customs.gov.cn/inner-mongolia/export-control-rare-earths-apr-2026",
133
+ "published_at": "2026-04-26T05:10:00Z",
134
+ "detected_at": "2026-04-26T05:18:00Z",
135
+ "gdelt_sources": 5,
136
+ "extraction_method": "demo_scenario",
137
+ "confidence": 0.9,
138
+ "affected_entities": [
139
+ "neodymium",
140
+ "dysprosium",
141
+ "praseodymium",
142
+ "terbium"
143
+ ],
144
+ "query_clues": [
145
+ "rare earth",
146
+ "inner mongolia",
147
+ "export ban",
148
+ "ev",
149
+ "magnet",
150
+ "vietnam",
151
+ "dysprosium",
152
+ "neodymium"
153
+ ],
154
+ "demo_citations": [
155
+ {
156
+ "source": "Inner Mongolia Customs Circular",
157
+ "snippet": "New export declarations for selected magnet rare earth oxides are suspended pending strategic review and quota verification.",
158
+ "url": "https://customs.gov.cn/inner-mongolia/export-control-rare-earths-apr-2026"
159
+ },
160
+ {
161
+ "source": "ShockMap Demo Materials Brief",
162
+ "snippet": "Indian magnet processors hold less than 20 days of dysprosium cover in the base-case inventory model.",
163
+ "url": null
164
+ }
165
+ ],
166
+ "structured_plan": {
167
+ "summary": "Protect high-value magnet and defense allocations while export controls remain active.",
168
+ "immediate_actions": [
169
+ "Pull 12 MT NdPr oxide and 1.8 MT dysprosium oxide from strategic and approved private stock; reserve it for traction motor and missile guidance programs.",
170
+ "Issue emergency RFQs to IREL-linked and approved non-China traders for 6 weeks of replacement cover; budget USD 4.8M for spot execution.",
171
+ "Pause low-margin magnet exports and re-sequence domestic deliveries by strategic priority."
172
+ ],
173
+ "medium_term_actions": [
174
+ "Shift long-cycle procurement to diversified sources and lock quarterly offtake options before quota windows reopen.",
175
+ "Increase strategic stock targets for dysprosium and terbium from 15 days to 45 days."
176
+ ],
177
+ "policy_escalation_trigger": "Escalate immediately if customs hold extends beyond 72 hours or if NdPr spot prices gap above 18%.",
178
+ "estimated_impact": "Domestic EV motor and precision magnet programs could face component rationing within 2 to 3 weeks.",
179
+ "confidence": 0.89
180
+ }
181
+ },
182
+ {
183
+ "id": "demo_shandong_port_closure_2026_04_26",
184
+ "scenario_label": "Shandong port closure",
185
+ "sector": "pharma",
186
+ "title": "Shandong port closure delays outbound API containers",
187
+ "summary": "Severe weather and customs congestion at a Shandong port have delayed API container departures. Metformin, omeprazole, and atorvastatin buyers in India face elongated inbound ETAs and near-term spot price pressure.",
188
+ "province": "Shandong",
189
+ "severity": "HIGH",
190
+ "event_type": "port_closure",
191
+ "keyword_trigger": "port closure",
192
+ "source": "PORT_BULLETIN",
193
+ "source_url": "https://port.shandong.gov.cn/bulletins/2026-04-weather-closure",
194
+ "published_at": "2026-04-25T23:40:00Z",
195
+ "detected_at": "2026-04-26T00:05:00Z",
196
+ "gdelt_sources": 3,
197
+ "extraction_method": "demo_scenario",
198
+ "confidence": 0.76,
199
+ "affected_entities": [
200
+ "metformin",
201
+ "omeprazole",
202
+ "atorvastatin",
203
+ "metformin_hcl",
204
+ "omeprazole_api"
205
+ ],
206
+ "query_clues": [
207
+ "shandong",
208
+ "port closure",
209
+ "metformin",
210
+ "omeprazole",
211
+ "atorvastatin",
212
+ "logistics"
213
+ ],
214
+ "demo_citations": [
215
+ {
216
+ "source": "Shandong Port Operations Bulletin",
217
+ "snippet": "Bulk chemical berths remain closed while customs and weather backlogs are cleared; pharma outbound containers face 5 to 7 day slippage.",
218
+ "url": "https://port.shandong.gov.cn/bulletins/2026-04-weather-closure"
219
+ },
220
+ {
221
+ "source": "ShockMap Demo Shipping Assumption",
222
+ "snippet": "A seven-day slip in Shandong dispatches is enough to push metformin spot procurement into premium pricing for import-dependent buyers.",
223
+ "url": null
224
+ }
225
+ ],
226
+ "structured_plan": {
227
+ "summary": "Mitigate logistics-driven stockouts by resequencing inbound allocations and switching urgent lifts away from the closed port.",
228
+ "immediate_actions": [
229
+ "Move the next 22 MT of metformin and omeprazole liftings to alternate sailings through Zhejiang; reserve USD 0.6M for freight premium.",
230
+ "Hold distributor promotions on atorvastatin and metformin until inbound ETAs stabilize.",
231
+ "Trigger customer communication for any orders projected to slip beyond 5 days."
232
+ ],
233
+ "medium_term_actions": [
234
+ "Spread outbound routing across at least two Chinese ports for all top-10 APIs with high India dependency.",
235
+ "Increase port-disruption buffer assumptions in procurement planning from 3 days to 10 days for monsoon and customs surge periods."
236
+ ],
237
+ "policy_escalation_trigger": "Escalate if alternate routings fail to restore 95% on-time dispatch within 5 days.",
238
+ "estimated_impact": "Metformin and omeprazole contracts will be most exposed to freight premium and ETA slippage over the next week.",
239
+ "confidence": 0.75
240
+ }
241
+ },
242
+ {
243
+ "id": "demo_jiangxi_factory_shutdown_2026_04_26",
244
+ "scenario_label": "Jiangxi separation outage",
245
+ "sector": "rare_earth",
246
+ "title": "Jiangxi factory shutdown disrupts terbium and yttrium separation",
247
+ "summary": "A power outage and safety shutdown in Jiangxi has paused terbium and yttrium separation lines used in phosphors, lasers, and high-performance electronics. The disruption is less severe than the Inner Mongolia case but still meaningful for thin-stock importers.",
248
+ "province": "Jiangxi",
249
+ "severity": "MEDIUM",
250
+ "event_type": "factory_shutdown",
251
+ "keyword_trigger": "factory shutdown",
252
+ "source": "LOCAL_NEWS",
253
+ "source_url": "https://jiangxi.news.cn/industry/rare-earth-safety-shutdown-apr-2026",
254
+ "published_at": "2026-04-25T18:50:00Z",
255
+ "detected_at": "2026-04-25T19:05:00Z",
256
+ "gdelt_sources": 2,
257
+ "extraction_method": "demo_scenario",
258
+ "confidence": 0.68,
259
+ "affected_entities": [
260
+ "yttrium",
261
+ "terbium",
262
+ "erbium"
263
+ ],
264
+ "query_clues": [
265
+ "jiangxi",
266
+ "factory shutdown",
267
+ "terbium",
268
+ "yttrium",
269
+ "electronics",
270
+ "phosphor"
271
+ ],
272
+ "demo_citations": [
273
+ {
274
+ "source": "Jiangxi Industrial Safety Bulletin",
275
+ "snippet": "Power and safety remediation has stopped separation activity at one Jiangxi rare-earth processor pending inspection clearance.",
276
+ "url": "https://jiangxi.news.cn/industry/rare-earth-safety-shutdown-apr-2026"
277
+ }
278
+ ],
279
+ "structured_plan": {
280
+ "summary": "Contain medium-term specialty materials risk while Jiangxi separation capacity is restored.",
281
+ "immediate_actions": [
282
+ "Freeze non-priority terbium and yttrium draws and preserve current stock for high-value domestic customers.",
283
+ "Validate substitute formulations for lower-priority phosphor and specialty alloy demand."
284
+ ],
285
+ "medium_term_actions": [
286
+ "Rebuild a 30-day buffer on terbium and yttrium once the Jiangxi line clears inspection.",
287
+ "Map secondary traders and recycled-material flows that can backfill specialty rare-earth demand."
288
+ ],
289
+ "policy_escalation_trigger": "Escalate only if outage extends beyond 10 days or if customer allocation requests accelerate.",
290
+ "estimated_impact": "Specialty electronics and phosphor supply chains may face selective rationing after 3 to 4 weeks.",
291
+ "confidence": 0.67
292
+ }
293
+ }
294
+ ]
backend/data/seed/dependencies.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {"source": "paracetamol", "target": "para_aminophenol", "weight": 1.0, "edge_type": "drug_uses_api"},
3
+ {"source": "amoxicillin", "target": "6_apa", "weight": 0.6, "edge_type": "drug_uses_api"},
4
+ {"source": "amoxicillin", "target": "ampicillin_trihydrate", "weight": 0.4, "edge_type": "drug_uses_api"},
5
+ {"source": "azithromycin", "target": "azithromycin_dihydrate", "weight": 1.0, "edge_type": "drug_uses_api"},
6
+ {"source": "ceftriaxone", "target": "7_aca", "weight": 1.0, "edge_type": "drug_uses_api"},
7
+ {"source": "metformin", "target": "metformin_hcl", "weight": 1.0, "edge_type": "drug_uses_api"},
8
+ {"source": "atorvastatin", "target": "atorvastatin_calcium", "weight": 1.0, "edge_type": "drug_uses_api"},
9
+ {"source": "amlodipine", "target": "amlodipine_besylate", "weight": 1.0, "edge_type": "drug_uses_api"},
10
+ {"source": "losartan", "target": "losartan_potassium", "weight": 1.0, "edge_type": "drug_uses_api"},
11
+ {"source": "omeprazole", "target": "omeprazole_api", "weight": 1.0, "edge_type": "drug_uses_api"},
12
+ {"source": "ranitidine", "target": "ranitidine_hcl", "weight": 1.0, "edge_type": "drug_uses_api"},
13
+ {"source": "ibuprofen", "target": "ibuprofen_api", "weight": 1.0, "edge_type": "drug_uses_api"},
14
+ {"source": "diclofenac", "target": "diclofenac_sodium", "weight": 1.0, "edge_type": "drug_uses_api"},
15
+ {"source": "aspirin", "target": "acetylsalicylic_acid", "weight": 1.0, "edge_type": "drug_uses_api"},
16
+ {"source": "penicillin_g", "target": "6_apa", "weight": 0.5, "edge_type": "drug_uses_api"},
17
+ {"source": "penicillin_g", "target": "penicillin_g_potassium", "weight": 0.5, "edge_type": "drug_uses_api"},
18
+ {"source": "gentamicin", "target": "gentamicin_sulfate", "weight": 1.0, "edge_type": "drug_uses_api"},
19
+ {"source": "fluconazole", "target": "fluconazole_api", "weight": 1.0, "edge_type": "drug_uses_api"},
20
+ {"source": "ciprofloxacin", "target": "ciprofloxacin_hcl", "weight": 1.0, "edge_type": "drug_uses_api"},
21
+ {"source": "levofloxacin", "target": "levofloxacin_hemihydrate", "weight": 1.0, "edge_type": "drug_uses_api"},
22
+ {"source": "insulin", "target": "insulin_recombinant", "weight": 1.0, "edge_type": "drug_uses_api"},
23
+ {"source": "salbutamol", "target": "salbutamol_sulfate", "weight": 1.0, "edge_type": "drug_uses_api"},
24
+
25
+ {"source": "para_aminophenol", "target": "Hebei", "weight": 0.85, "edge_type": "api_from_province"},
26
+ {"source": "para_aminophenol", "target": "Hubei", "weight": 0.85, "edge_type": "api_from_province"},
27
+ {"source": "6_apa", "target": "Hebei", "weight": 0.90, "edge_type": "api_from_province"},
28
+ {"source": "6_apa", "target": "Jiangsu", "weight": 0.90, "edge_type": "api_from_province"},
29
+ {"source": "7_aca", "target": "Shandong", "weight": 0.92, "edge_type": "api_from_province"},
30
+ {"source": "7_aca", "target": "Hebei", "weight": 0.92, "edge_type": "api_from_province"},
31
+ {"source": "ampicillin_trihydrate", "target": "Hebei", "weight": 0.88, "edge_type": "api_from_province"},
32
+ {"source": "azithromycin_dihydrate", "target": "Jiangsu", "weight": 0.85, "edge_type": "api_from_province"},
33
+ {"source": "penicillin_g_potassium", "target": "Hebei", "weight": 0.95, "edge_type": "api_from_province"},
34
+ {"source": "penicillin_g_potassium", "target": "Hubei", "weight": 0.95, "edge_type": "api_from_province"},
35
+ {"source": "metformin_hcl", "target": "Jiangsu", "weight": 0.78, "edge_type": "api_from_province"},
36
+ {"source": "metformin_hcl", "target": "Zhejiang", "weight": 0.78, "edge_type": "api_from_province"},
37
+ {"source": "atorvastatin_calcium", "target": "Zhejiang", "weight": 0.82, "edge_type": "api_from_province"},
38
+ {"source": "amlodipine_besylate", "target": "Jiangsu", "weight": 0.80, "edge_type": "api_from_province"},
39
+ {"source": "losartan_potassium", "target": "Zhejiang", "weight": 0.83, "edge_type": "api_from_province"},
40
+ {"source": "omeprazole_api", "target": "Jiangsu", "weight": 0.85, "edge_type": "api_from_province"},
41
+ {"source": "ranitidine_hcl", "target": "Hubei", "weight": 0.80, "edge_type": "api_from_province"},
42
+ {"source": "ibuprofen_api", "target": "Hebei", "weight": 0.82, "edge_type": "api_from_province"},
43
+ {"source": "ibuprofen_api", "target": "Shandong", "weight": 0.82, "edge_type": "api_from_province"},
44
+ {"source": "diclofenac_sodium", "target": "Zhejiang", "weight": 0.78, "edge_type": "api_from_province"},
45
+ {"source": "acetylsalicylic_acid", "target": "Hubei", "weight": 0.65, "edge_type": "api_from_province"},
46
+ {"source": "gentamicin_sulfate", "target": "Hebei", "weight": 0.90, "edge_type": "api_from_province"},
47
+ {"source": "fluconazole_api", "target": "Jiangsu", "weight": 0.85, "edge_type": "api_from_province"},
48
+ {"source": "ciprofloxacin_hcl", "target": "Zhejiang", "weight": 0.83, "edge_type": "api_from_province"},
49
+ {"source": "levofloxacin_hemihydrate", "target": "Zhejiang", "weight": 0.85, "edge_type": "api_from_province"},
50
+ {"source": "insulin_recombinant", "target": "Jiangsu", "weight": 0.45, "edge_type": "api_from_province"},
51
+ {"source": "salbutamol_sulfate", "target": "Hubei", "weight": 0.80, "edge_type": "api_from_province"},
52
+ {"source": "clavulanic_acid", "target": "Shandong", "weight": 0.88, "edge_type": "api_from_province"},
53
+ {"source": "erythromycin_thiocyanate", "target": "Hebei", "weight": 0.92, "edge_type": "api_from_province"},
54
+ {"source": "sodium_dichloroisocyanurate", "target": "Hebei", "weight": 0.75, "edge_type": "api_from_province"},
55
+ {"source": "heparin_sodium", "target": "Jiangsu", "weight": 0.88, "edge_type": "api_from_province"}
56
+ ]
backend/data/seed/drugs.json ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "paracetamol",
4
+ "name": "Paracetamol",
5
+ "generic_name": "Paracetamol",
6
+ "nlem_tier": "TIER_1",
7
+ "patient_population_estimate": 200000000,
8
+ "primary_apis": ["para_aminophenol"],
9
+ "has_substitute": false,
10
+ "therapeutic_class": "analgesic-antipyretic",
11
+ "criticality_score": null,
12
+ "current_risk": null
13
+ },
14
+ {
15
+ "id": "amoxicillin",
16
+ "name": "Amoxicillin",
17
+ "generic_name": "Amoxicillin",
18
+ "nlem_tier": "TIER_1",
19
+ "patient_population_estimate": 80000000,
20
+ "primary_apis": ["6_apa", "ampicillin_trihydrate"],
21
+ "has_substitute": false,
22
+ "therapeutic_class": "beta-lactam antibiotic",
23
+ "criticality_score": null,
24
+ "current_risk": null
25
+ },
26
+ {
27
+ "id": "azithromycin",
28
+ "name": "Azithromycin",
29
+ "generic_name": "Azithromycin",
30
+ "nlem_tier": "TIER_1",
31
+ "patient_population_estimate": 60000000,
32
+ "primary_apis": ["azithromycin_dihydrate"],
33
+ "has_substitute": true,
34
+ "therapeutic_class": "macrolide antibiotic",
35
+ "criticality_score": null,
36
+ "current_risk": null
37
+ },
38
+ {
39
+ "id": "ceftriaxone",
40
+ "name": "Ceftriaxone",
41
+ "generic_name": "Ceftriaxone",
42
+ "nlem_tier": "TIER_1",
43
+ "patient_population_estimate": 40000000,
44
+ "primary_apis": ["7_aca"],
45
+ "has_substitute": false,
46
+ "therapeutic_class": "cephalosporin antibiotic",
47
+ "criticality_score": null,
48
+ "current_risk": null
49
+ },
50
+ {
51
+ "id": "metformin",
52
+ "name": "Metformin",
53
+ "generic_name": "Metformin",
54
+ "nlem_tier": "TIER_1",
55
+ "patient_population_estimate": 90000000,
56
+ "primary_apis": ["metformin_hcl"],
57
+ "has_substitute": true,
58
+ "therapeutic_class": "antidiabetic biguanide",
59
+ "criticality_score": null,
60
+ "current_risk": null
61
+ },
62
+ {
63
+ "id": "atorvastatin",
64
+ "name": "Atorvastatin",
65
+ "generic_name": "Atorvastatin",
66
+ "nlem_tier": "TIER_1",
67
+ "patient_population_estimate": 70000000,
68
+ "primary_apis": ["atorvastatin_calcium"],
69
+ "has_substitute": true,
70
+ "therapeutic_class": "statin",
71
+ "criticality_score": null,
72
+ "current_risk": null
73
+ },
74
+ {
75
+ "id": "amlodipine",
76
+ "name": "Amlodipine",
77
+ "generic_name": "Amlodipine",
78
+ "nlem_tier": "TIER_1",
79
+ "patient_population_estimate": 75000000,
80
+ "primary_apis": ["amlodipine_besylate"],
81
+ "has_substitute": true,
82
+ "therapeutic_class": "calcium channel blocker",
83
+ "criticality_score": null,
84
+ "current_risk": null
85
+ },
86
+ {
87
+ "id": "losartan",
88
+ "name": "Losartan",
89
+ "generic_name": "Losartan",
90
+ "nlem_tier": "TIER_2",
91
+ "patient_population_estimate": 50000000,
92
+ "primary_apis": ["losartan_potassium"],
93
+ "has_substitute": true,
94
+ "therapeutic_class": "ARB antihypertensive",
95
+ "criticality_score": null,
96
+ "current_risk": null
97
+ },
98
+ {
99
+ "id": "omeprazole",
100
+ "name": "Omeprazole",
101
+ "generic_name": "Omeprazole",
102
+ "nlem_tier": "TIER_1",
103
+ "patient_population_estimate": 65000000,
104
+ "primary_apis": ["omeprazole_api"],
105
+ "has_substitute": true,
106
+ "therapeutic_class": "proton pump inhibitor",
107
+ "criticality_score": null,
108
+ "current_risk": null
109
+ },
110
+ {
111
+ "id": "ranitidine",
112
+ "name": "Ranitidine",
113
+ "generic_name": "Ranitidine",
114
+ "nlem_tier": "TIER_2",
115
+ "patient_population_estimate": 30000000,
116
+ "primary_apis": ["ranitidine_hcl"],
117
+ "has_substitute": true,
118
+ "therapeutic_class": "H2 blocker",
119
+ "criticality_score": null,
120
+ "current_risk": null
121
+ },
122
+ {
123
+ "id": "ibuprofen",
124
+ "name": "Ibuprofen",
125
+ "generic_name": "Ibuprofen",
126
+ "nlem_tier": "TIER_1",
127
+ "patient_population_estimate": 100000000,
128
+ "primary_apis": ["ibuprofen_api"],
129
+ "has_substitute": true,
130
+ "therapeutic_class": "NSAID",
131
+ "criticality_score": null,
132
+ "current_risk": null
133
+ },
134
+ {
135
+ "id": "diclofenac",
136
+ "name": "Diclofenac",
137
+ "generic_name": "Diclofenac",
138
+ "nlem_tier": "TIER_2",
139
+ "patient_population_estimate": 60000000,
140
+ "primary_apis": ["diclofenac_sodium"],
141
+ "has_substitute": true,
142
+ "therapeutic_class": "NSAID",
143
+ "criticality_score": null,
144
+ "current_risk": null
145
+ },
146
+ {
147
+ "id": "aspirin",
148
+ "name": "Aspirin",
149
+ "generic_name": "Aspirin",
150
+ "nlem_tier": "TIER_1",
151
+ "patient_population_estimate": 80000000,
152
+ "primary_apis": ["acetylsalicylic_acid"],
153
+ "has_substitute": true,
154
+ "therapeutic_class": "salicylate",
155
+ "criticality_score": null,
156
+ "current_risk": null
157
+ },
158
+ {
159
+ "id": "penicillin_g",
160
+ "name": "Penicillin G",
161
+ "generic_name": "Penicillin G",
162
+ "nlem_tier": "TIER_1",
163
+ "patient_population_estimate": 25000000,
164
+ "primary_apis": ["6_apa", "penicillin_g_potassium"],
165
+ "has_substitute": false,
166
+ "therapeutic_class": "beta-lactam antibiotic",
167
+ "criticality_score": null,
168
+ "current_risk": null
169
+ },
170
+ {
171
+ "id": "gentamicin",
172
+ "name": "Gentamicin",
173
+ "generic_name": "Gentamicin",
174
+ "nlem_tier": "TIER_2",
175
+ "patient_population_estimate": 15000000,
176
+ "primary_apis": ["gentamicin_sulfate"],
177
+ "has_substitute": false,
178
+ "therapeutic_class": "aminoglycoside antibiotic",
179
+ "criticality_score": null,
180
+ "current_risk": null
181
+ },
182
+ {
183
+ "id": "fluconazole",
184
+ "name": "Fluconazole",
185
+ "generic_name": "Fluconazole",
186
+ "nlem_tier": "TIER_2",
187
+ "patient_population_estimate": 20000000,
188
+ "primary_apis": ["fluconazole_api"],
189
+ "has_substitute": true,
190
+ "therapeutic_class": "antifungal",
191
+ "criticality_score": null,
192
+ "current_risk": null
193
+ },
194
+ {
195
+ "id": "ciprofloxacin",
196
+ "name": "Ciprofloxacin",
197
+ "generic_name": "Ciprofloxacin",
198
+ "nlem_tier": "TIER_1",
199
+ "patient_population_estimate": 55000000,
200
+ "primary_apis": ["ciprofloxacin_hcl"],
201
+ "has_substitute": true,
202
+ "therapeutic_class": "fluoroquinolone",
203
+ "criticality_score": null,
204
+ "current_risk": null
205
+ },
206
+ {
207
+ "id": "levofloxacin",
208
+ "name": "Levofloxacin",
209
+ "generic_name": "Levofloxacin",
210
+ "nlem_tier": "TIER_2",
211
+ "patient_population_estimate": 35000000,
212
+ "primary_apis": ["levofloxacin_hemihydrate"],
213
+ "has_substitute": true,
214
+ "therapeutic_class": "fluoroquinolone",
215
+ "criticality_score": null,
216
+ "current_risk": null
217
+ },
218
+ {
219
+ "id": "insulin",
220
+ "name": "Insulin",
221
+ "generic_name": "Insulin",
222
+ "nlem_tier": "TIER_1",
223
+ "patient_population_estimate": 80000000,
224
+ "primary_apis": ["insulin_recombinant"],
225
+ "has_substitute": false,
226
+ "therapeutic_class": "antidiabetic hormone",
227
+ "criticality_score": null,
228
+ "current_risk": null
229
+ },
230
+ {
231
+ "id": "salbutamol",
232
+ "name": "Salbutamol",
233
+ "generic_name": "Salbutamol",
234
+ "nlem_tier": "TIER_1",
235
+ "patient_population_estimate": 35000000,
236
+ "primary_apis": ["salbutamol_sulfate"],
237
+ "has_substitute": true,
238
+ "therapeutic_class": "beta-2 agonist bronchodilator",
239
+ "criticality_score": null,
240
+ "current_risk": null
241
+ }
242
+ ]
backend/data/seed/epb_notices.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "factory_name_zh": "石家庄药业集团有限公司",
4
+ "factory_name_en": "CSPC Pharmaceutical Group",
5
+ "industry": "pharma",
6
+ "violation_type": "Environmental Compliance Audit",
7
+ "severity": "CRITICAL",
8
+ "duration_days": 30,
9
+ "issued_date": "2024-01-15",
10
+ "summary_en": "Mandatory production halt for environmental remediation and audit.",
11
+ "linked_apis": ["6_apa", "penicillin_g_potassium", "para_aminophenol"],
12
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/2024/01/15/cspc-halt"
13
+ },
14
+ {
15
+ "factory_name_zh": "华北制药股份有限公司",
16
+ "factory_name_en": "North China Pharmaceutical Co.",
17
+ "industry": "pharma",
18
+ "violation_type": "Air Quality Restriction",
19
+ "severity": "HIGH",
20
+ "duration_days": 14,
21
+ "issued_date": "2026-04-10",
22
+ "summary_en": "Reduced capacity mandate during severe smog event.",
23
+ "linked_apis": ["7_aca", "gentamicin_sulfate"],
24
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/ncpc-reduction"
25
+ },
26
+ {
27
+ "factory_name_zh": "石家庄冀衡集团有限公司",
28
+ "factory_name_en": "Hebei Jiheng Group",
29
+ "industry": "pharma",
30
+ "violation_type": "Water Treatment Upgrade",
31
+ "severity": "MEDIUM",
32
+ "duration_days": 7,
33
+ "issued_date": "2026-04-20",
34
+ "summary_en": "Partial shutdown for secondary water treatment facility integration.",
35
+ "linked_apis": ["para_aminophenol", "ampicillin_trihydrate", "ibuprofen_api"],
36
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/jiheng-water"
37
+ },
38
+ {
39
+ "factory_name_zh": "河北威远生物化工股份有限公司",
40
+ "factory_name_en": "Hebei Veyong Bio-Chemical",
41
+ "industry": "chemical",
42
+ "violation_type": "Safety Inspection",
43
+ "severity": "HIGH",
44
+ "duration_days": 21,
45
+ "issued_date": "2026-04-12",
46
+ "summary_en": "Site-wide safety audit following minor storage leak.",
47
+ "linked_apis": ["erythromycin_thiocyanate"],
48
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/veyong-safety"
49
+ },
50
+ {
51
+ "factory_name_zh": "唐山钢铁集团",
52
+ "factory_name_en": "Tangshan Steel Group",
53
+ "industry": "other",
54
+ "violation_type": "Carbon Cap",
55
+ "severity": "LOW",
56
+ "duration_days": 5,
57
+ "issued_date": "2026-04-18",
58
+ "summary_en": "Minor curtailment to meet quarterly carbon intensity targets.",
59
+ "linked_apis": [],
60
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/tangshan-steel"
61
+ }
62
+ ]
backend/data/seed/fda_alerts.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "alert_number": "66-40",
4
+ "alert_name": "Detention Without Physical Examination of Drugs From Firms Not Operating in Conformity With CGMP",
5
+ "country": "China",
6
+ "industry_code": "54",
7
+ "issued_date": "2026-02-15",
8
+ "firms_listed": ["Jiangsu Nhwa Pharmaceutical Co Ltd"],
9
+ "products_affected": ["Azithromycin Dihydrate", "Fluconazole"],
10
+ "linked_apis": ["azithromycin_dihydrate", "fluconazole_api"],
11
+ "summary": "Firm failed to meet minimum CGMP requirements during distant site inspection.",
12
+ "source_url": "https://www.accessdata.fda.gov/cms_ia/importalert_189.html"
13
+ },
14
+ {
15
+ "alert_number": "99-32",
16
+ "alert_name": "Detention Without Physical Examination of Products from Firms on the Red List",
17
+ "country": "China",
18
+ "industry_code": "54",
19
+ "issued_date": "2025-11-20",
20
+ "firms_listed": ["Zhejiang Hisun Pharmaceutical Co Ltd"],
21
+ "products_affected": ["Atorvastatin Calcium", "Ciprofloxacin"],
22
+ "linked_apis": ["atorvastatin_calcium", "ciprofloxacin_hcl"],
23
+ "summary": "Continued inclusion on Red List due to persistent impurity issues in statin precursors.",
24
+ "source_url": "https://www.accessdata.fda.gov/cms_ia/importalert_99-32.html"
25
+ }
26
+ ]
backend/data/seed/historical_disruptions.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "date": "2020-03-03",
4
+ "source_event": "Wuhan/Hubei lockdown halts API production",
5
+ "affected_drugs": ["paracetamol", "amoxicillin", "azithromycin"],
6
+ "lead_time_days": 14,
7
+ "indian_consumer_price_impact_pct": 30.0,
8
+ "citation_url": "https://www.thelancet.com/journals/langlo/article/PIIS2214-109X(20)30115-4/fulltext"
9
+ },
10
+ {
11
+ "date": "2020-03-25",
12
+ "source_event": "India bans export of 26 drugs to ensure domestic availability",
13
+ "affected_drugs": ["paracetamol", "tinidazole", "metronidazole", "vitamin_b12"],
14
+ "lead_time_days": 21,
15
+ "indian_consumer_price_impact_pct": 50.0,
16
+ "citation_url": "https://www.bbc.com/news/world-asia-india-51727271"
17
+ },
18
+ {
19
+ "date": "2023-06-15",
20
+ "source_event": "Heparin shortage due to China supply chain contamination disruption",
21
+ "affected_drugs": ["heparin"],
22
+ "lead_time_days": 28,
23
+ "indian_consumer_price_impact_pct": 120.0,
24
+ "citation_url": "https://www.fda.gov/drugs/drug-safety-and-availability/drug-shortages"
25
+ },
26
+ {
27
+ "date": "2024-01-15",
28
+ "source_event": "Hebei pharma plant environmental inspection wave",
29
+ "affected_drugs": ["paracetamol", "ibuprofen"],
30
+ "lead_time_days": 23,
31
+ "indian_consumer_price_impact_pct": 100.0,
32
+ "citation_url": "https://pharmashield.ai/historical/hebei-2024-report"
33
+ },
34
+ {
35
+ "date": "2025-01-10",
36
+ "source_event": "Red Sea shipping disruption increases transit times for raw materials",
37
+ "affected_drugs": ["amoxicillin", "ciprofloxacin", "ceftriaxone"],
38
+ "lead_time_days": 35,
39
+ "indian_consumer_price_impact_pct": 15.0,
40
+ "citation_url": "https://www.reuters.com/business/logistics/red-sea-disruptions-hit-pharma-supply-chains-2025-01-12/"
41
+ }
42
+ ]
backend/data/seed/live_shocks.json ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "seed_alert_insulin_2026_04_24",
4
+ "sector": "pharma",
5
+ "title": "Single-source concentration risk identified for recombinant insulin",
6
+ "summary": "Single-source concentration risk identified for recombinant insulin",
7
+ "province": "Jiangsu",
8
+ "keyword_trigger": "seed_fallback",
9
+ "event_type": "seed_fallback",
10
+ "severity": "LOW",
11
+ "source": "MANUAL",
12
+ "source_url": null,
13
+ "published_at": "2026-04-24T17:15:00Z",
14
+ "detected_at": "2026-04-24T17:15:00Z",
15
+ "gdelt_query": "seed_fallback_alerts",
16
+ "gdelt_sources": 1,
17
+ "extraction_method": "seed_fallback"
18
+ },
19
+ {
20
+ "id": "seed_alert_atorvastatin_2026_04_23",
21
+ "sector": "pharma",
22
+ "title": "Atorvastatin API price anomaly detected in Mumbai wholesale",
23
+ "summary": "Atorvastatin API price anomaly detected in Mumbai wholesale",
24
+ "province": null,
25
+ "keyword_trigger": "seed_fallback",
26
+ "event_type": "seed_fallback",
27
+ "severity": "MEDIUM",
28
+ "source": "NEWS",
29
+ "source_url": "https://pharmabiz.com/news/api-price-monitoring-report-april",
30
+ "published_at": "2026-04-23T08:30:00Z",
31
+ "detected_at": "2026-04-23T08:30:00Z",
32
+ "gdelt_query": "seed_fallback_alerts",
33
+ "gdelt_sources": 1,
34
+ "extraction_method": "seed_fallback"
35
+ },
36
+ {
37
+ "id": "seed_alert_penicillin_2026_04_22",
38
+ "sector": "pharma",
39
+ "title": "Random inspection wave at Hebei Penicillin fermentation sites",
40
+ "summary": "Random inspection wave at Hebei Penicillin fermentation sites",
41
+ "province": "Hebei",
42
+ "keyword_trigger": "seed_fallback",
43
+ "event_type": "seed_fallback",
44
+ "severity": "MEDIUM",
45
+ "source": "HEBEI_EPB",
46
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/inspect-2026-04",
47
+ "published_at": "2026-04-22T16:00:00Z",
48
+ "detected_at": "2026-04-22T16:00:00Z",
49
+ "gdelt_query": "seed_fallback_alerts",
50
+ "gdelt_sources": 1,
51
+ "extraction_method": "seed_fallback"
52
+ },
53
+ {
54
+ "id": "seed_alert_metformin_2026_04_21",
55
+ "sector": "pharma",
56
+ "title": "Sudden drop in Metformin HCl import volumes from China",
57
+ "summary": "Sudden drop in Metformin HCl import volumes from China",
58
+ "province": "Jiangsu",
59
+ "keyword_trigger": "seed_fallback",
60
+ "event_type": "seed_fallback",
61
+ "severity": "MEDIUM",
62
+ "source": "TRADE_ANOMALY",
63
+ "source_url": null,
64
+ "published_at": "2026-04-21T11:20:00Z",
65
+ "detected_at": "2026-04-21T11:20:00Z",
66
+ "gdelt_query": "seed_fallback_alerts",
67
+ "gdelt_sources": 1,
68
+ "extraction_method": "seed_fallback"
69
+ },
70
+ {
71
+ "id": "seed_alert_ceftriaxone_2026_04_20",
72
+ "sector": "pharma",
73
+ "title": "Hebei winter heating production cuts affect 7-ACA",
74
+ "summary": "Hebei winter heating production cuts affect 7-ACA",
75
+ "province": "Hebei",
76
+ "keyword_trigger": "seed_fallback",
77
+ "event_type": "seed_fallback",
78
+ "severity": "HIGH",
79
+ "source": "HEBEI_EPB",
80
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/winter-curtailment-2026",
81
+ "published_at": "2026-04-20T09:00:00Z",
82
+ "detected_at": "2026-04-20T09:00:00Z",
83
+ "gdelt_query": "seed_fallback_alerts",
84
+ "gdelt_sources": 1,
85
+ "extraction_method": "seed_fallback"
86
+ },
87
+ {
88
+ "id": "seed_alert_azithromycin_2026_04_18",
89
+ "sector": "pharma",
90
+ "title": "FDA Warning Letter for Jiangsu Macrolide Facility",
91
+ "summary": "FDA Warning Letter for Jiangsu Macrolide Facility",
92
+ "province": "Jiangsu",
93
+ "keyword_trigger": "seed_fallback",
94
+ "event_type": "seed_fallback",
95
+ "severity": "HIGH",
96
+ "source": "FDA_WARNING_LETTER",
97
+ "source_url": "https://fda.gov/warning-letters/2026/china-api-inspection-fail",
98
+ "published_at": "2026-04-18T14:45:00Z",
99
+ "detected_at": "2026-04-18T14:45:00Z",
100
+ "gdelt_query": "seed_fallback_alerts",
101
+ "gdelt_sources": 1,
102
+ "extraction_method": "seed_fallback"
103
+ },
104
+ {
105
+ "id": "seed_alert_amoxicillin_2026_04_15",
106
+ "sector": "pharma",
107
+ "title": "Industrial accident in Jiangsu impacts 6-APA precursors",
108
+ "summary": "Industrial accident in Jiangsu impacts 6-APA precursors",
109
+ "province": "Jiangsu",
110
+ "keyword_trigger": "seed_fallback",
111
+ "event_type": "seed_fallback",
112
+ "severity": "HIGH",
113
+ "source": "NEWS",
114
+ "source_url": "https://reuters.com/business/pharma/jiangsu-industrial-accident-impacts-pharma",
115
+ "published_at": "2026-04-15T10:15:00Z",
116
+ "detected_at": "2026-04-15T10:15:00Z",
117
+ "gdelt_query": "seed_fallback_alerts",
118
+ "gdelt_sources": 1,
119
+ "extraction_method": "seed_fallback"
120
+ },
121
+ {
122
+ "id": "seed_alert_paracetamol_2024_q1",
123
+ "sector": "pharma",
124
+ "title": "Hebei API plant production halt — paracetamol supply at risk",
125
+ "summary": "Hebei API plant production halt — paracetamol supply at risk",
126
+ "province": "Hebei",
127
+ "keyword_trigger": "seed_fallback",
128
+ "event_type": "seed_fallback",
129
+ "severity": "CRITICAL",
130
+ "source": "HEBEI_EPB",
131
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/2024/01/15/api-plant-shutdown",
132
+ "published_at": "2024-01-17T08:30:00Z",
133
+ "detected_at": "2024-01-17T08:30:00Z",
134
+ "gdelt_query": "seed_fallback_alerts",
135
+ "gdelt_sources": 1,
136
+ "extraction_method": "seed_fallback"
137
+ }
138
+ ]
backend/data/seed/policy_snippets.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "orf_api_dependency_01",
4
+ "source": "ORF - Time to end the battle of Indian pharmaceutical players and Chinese key ingredients",
5
+ "source_url": "https://www.orfonline.org/expert-speak/time-to-end-the-battle-of-indian-pharmaceutical-players-and-chinese-key-ingredients",
6
+ "text": "ORF notes that India's formulation strength still sits on top of heavy bulk-drug and API dependence on China, with import exposure often cited in the 65-70% range. That concentration leaves Indian supply vulnerable to price spikes and sudden export or production shocks.",
7
+ "keywords": ["dependency", "API", "China", "import", "vulnerability"]
8
+ },
9
+ {
10
+ "id": "orf_pharma_cluster_02",
11
+ "source": "ORF - Understanding the coming challenges to India's pharma sector",
12
+ "source_url": "https://www.orfonline.org/expert-speak/understanding-the-coming-challenges-to-indias-pharma-sector-66556",
13
+ "text": "ORF highlights that major Chinese raw-material clusters such as Hubei, Zhejiang and Jiangsu are deeply tied to global pharmaceutical supply. Disruption in those manufacturing centres can quickly tighten API availability for Indian producers.",
14
+ "keywords": ["cluster", "Hubei", "Zhejiang", "Jiangsu", "API", "supply shock"]
15
+ },
16
+ {
17
+ "id": "orf_trade_security_03",
18
+ "source": "ORF - Tariffs and Health Security: The Future of US-India Pharma Trade",
19
+ "source_url": "https://www.orfonline.org/expert-speak/tariffs-and-health-security-the-future-of-us-india-pharma-trade",
20
+ "text": "ORF argues that India still imports a large share of its API requirement from China and that trade or production disruptions can undermine health security. The case for de-risking depends on diversifying KSM and API sourcing before the next shock hits.",
21
+ "keywords": ["health security", "API", "trade", "de-risking", "China"]
22
+ },
23
+ {
24
+ "id": "nlem_2022_01",
25
+ "source": "CDSCO - Essential Medicines",
26
+ "source_url": "https://cdsco.gov.in/opencms/opencms/en/consumer/Essential-Medicines/",
27
+ "text": "The National List of Essential Medicines is meant to support continuous availability of priority medicines in functioning health systems. Tier 1 medicines should be prioritized for monitoring because stockouts have broad and immediate public-health effects.",
28
+ "keywords": ["NLEM", "essential medicines", "availability", "public health", "tier 1"]
29
+ },
30
+ {
31
+ "id": "nlem_2022_02",
32
+ "source": "CDSCO - National List of Essential Medicines 2022",
33
+ "source_url": "https://cdsco.gov.in/opencms/resources/UploadCDSCOWeb/2018/UploadPublic_NoticesFiles/nlem2022.pdf",
34
+ "text": "NLEM 2022 covers both widely used medicines and specialized therapies where failure of supply still harms care delivery for specific patient groups. Buffer policies and procurement planning should account for Tier 2 and Tier 3 exposure as well, not just the highest-volume products.",
35
+ "keywords": ["NLEM", "tier 2", "tier 3", "buffer stock", "procurement"]
36
+ },
37
+ {
38
+ "id": "niti_pli_01",
39
+ "source": "NITI Aayog - Public Finance and Policy Analysis Division",
40
+ "source_url": "https://niti.gov.in/divisions/division/public-finance-and-policy-analysis",
41
+ "text": "NITI Aayog states that it helped shape the contours of the Production Linked Incentive schemes for active pharmaceutical ingredients and other strategic sectors. The policy direction is to build domestic capacity in inputs that create national import vulnerability.",
42
+ "keywords": ["NITI Aayog", "PLI", "API", "domestic manufacturing", "capacity"]
43
+ },
44
+ {
45
+ "id": "who_eml_01",
46
+ "source": "WHO Model List of Essential Medicines - 23rd list, 2023",
47
+ "source_url": "https://www.who.int/publications/i/item/WHO-MHP-HPS-EML-2023.02",
48
+ "text": "WHO states that essential medicines should be available in functioning health systems at all times, in the right dosage forms, with assured quality and affordable pricing. That makes supply continuity a core operational requirement rather than a policy afterthought.",
49
+ "keywords": ["WHO", "EML", "essential medicines", "availability", "stockouts"]
50
+ },
51
+ {
52
+ "id": "fda_shortage_01",
53
+ "source": "FDA Drug Shortages Database",
54
+ "source_url": "https://www.accessdata.fda.gov/scripts/drugshortages/",
55
+ "text": "The FDA describes shortages as situations where supply does not meet current or projected demand, often driven by manufacturing quality problems, raw-material delays, or sudden demand changes. Drugs with no therapeutic substitute require tighter monitoring and earlier escalation.",
56
+ "keywords": ["FDA", "shortage", "manufacturing", "raw materials", "substitute"]
57
+ },
58
+ {
59
+ "id": "dop_pli_01",
60
+ "source": "Department of Pharmaceuticals - PLI Scheme for Bulk Drugs Guidelines",
61
+ "source_url": "https://pharmaceuticals.gov.in/sites/default/files/Guidelines%20for%20the%20Production%20Linked%20Incentive%20%28PLI%29%20Scheme%20for%20promotion%20of_0.pdf",
62
+ "text": "The Department of Pharmaceuticals says uninterrupted supply of quality bulk drugs is critical for drug security and explicitly frames reduction of import dependence in KSMs, drug intermediates, and APIs as a core objective of the PLI scheme for bulk drugs.",
63
+ "keywords": ["DoP", "PLI", "bulk drugs", "KSM", "API", "import dependence"]
64
+ },
65
+ {
66
+ "id": "dop_api_ksm_02",
67
+ "source": "Department of Pharmaceuticals - Bulk Drug Parks Guidelines",
68
+ "source_url": "https://pharmaceuticals.gov.in/sites/default/files/Guidelines%20of%20the%20Scheme%20Promotion%20of%20Bulk%20Drug%20Parks.pdf",
69
+ "text": "The Bulk Drug Parks guidelines define an API as a substance used in manufacturing that becomes the active ingredient of the final drug, and position KSM and intermediate production as core infrastructure targets. That makes upstream input visibility essential for early-warning systems.",
70
+ "keywords": ["API", "KSM", "bulk drug park", "intermediates", "definitions"]
71
+ }
72
+ ]
backend/data/seed/rare_earths.json ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "neodymium",
4
+ "name": "Neodymium (Nd)",
5
+ "sector": "rare_earth",
6
+ "type": "input",
7
+ "china_share": 0.94,
8
+ "primary_provinces": ["Jiangsu", "Inner Mongolia", "Sichuan"],
9
+ "top_3_producers": ["China Northern Rare Earth", "Shenghe Resources", "China Minmetals"],
10
+ "monthly_import_value_usd_millions": 210.0,
11
+ "end_use_sectors": ["EV motors", "wind turbines", "defence electronics"],
12
+ "india_stockpile_days": 12,
13
+ "criticality": 0.91,
14
+ "hs_code": "280530"
15
+ },
16
+ {
17
+ "id": "dysprosium",
18
+ "name": "Dysprosium (Dy)",
19
+ "sector": "rare_earth",
20
+ "type": "input",
21
+ "china_share": 0.97,
22
+ "primary_provinces": ["Jiangsu", "Guangdong", "Fujian"],
23
+ "top_3_producers": ["China Northern Rare Earth", "China Southern Rare Earth", "Xiamen Tungsten"],
24
+ "monthly_import_value_usd_millions": 85.0,
25
+ "end_use_sectors": ["NdFeB magnets", "EV traction motors", "hard drives"],
26
+ "india_stockpile_days": 8,
27
+ "criticality": 0.95,
28
+ "hs_code": "280530"
29
+ },
30
+ {
31
+ "id": "terbium",
32
+ "name": "Terbium (Tb)",
33
+ "sector": "rare_earth",
34
+ "type": "input",
35
+ "china_share": 0.99,
36
+ "primary_provinces": ["Jiangsu", "Guangdong"],
37
+ "top_3_producers": ["China Southern Rare Earth", "Xiamen Tungsten", "Shenghe Resources"],
38
+ "monthly_import_value_usd_millions": 40.0,
39
+ "end_use_sectors": ["solid-state drives", "sonar", "EV motors"],
40
+ "india_stockpile_days": 5,
41
+ "criticality": 0.97,
42
+ "hs_code": "280530"
43
+ },
44
+ {
45
+ "id": "lanthanum",
46
+ "name": "Lanthanum (La)",
47
+ "sector": "rare_earth",
48
+ "type": "input",
49
+ "china_share": 0.85,
50
+ "primary_provinces": ["Inner Mongolia", "Sichuan"],
51
+ "top_3_producers": ["China Northern Rare Earth", "China Minmetals", "CMOC Group"],
52
+ "monthly_import_value_usd_millions": 55.0,
53
+ "end_use_sectors": ["petroleum refining catalysts", "hybrid batteries", "optics"],
54
+ "india_stockpile_days": 30,
55
+ "criticality": 0.72,
56
+ "hs_code": "280530"
57
+ },
58
+ {
59
+ "id": "cerium",
60
+ "name": "Cerium (Ce)",
61
+ "sector": "rare_earth",
62
+ "type": "input",
63
+ "china_share": 0.83,
64
+ "primary_provinces": ["Inner Mongolia", "Jiangsu"],
65
+ "top_3_producers": ["China Northern Rare Earth", "Shenghe Resources", "Lynas (Australia)"],
66
+ "monthly_import_value_usd_millions": 48.0,
67
+ "end_use_sectors": ["auto catalytic converters", "glass polishing", "LED phosphors"],
68
+ "india_stockpile_days": 45,
69
+ "criticality": 0.65,
70
+ "hs_code": "280530"
71
+ },
72
+ {
73
+ "id": "praseodymium",
74
+ "name": "Praseodymium (Pr)",
75
+ "sector": "rare_earth",
76
+ "type": "input",
77
+ "china_share": 0.91,
78
+ "primary_provinces": ["Inner Mongolia", "Jiangsu", "Sichuan"],
79
+ "top_3_producers": ["China Northern Rare Earth", "Shenghe Resources", "China Minmetals"],
80
+ "monthly_import_value_usd_millions": 95.0,
81
+ "end_use_sectors": ["NdPr alloy for EV magnets", "aircraft engines", "wind generators"],
82
+ "india_stockpile_days": 10,
83
+ "criticality": 0.88,
84
+ "hs_code": "280530"
85
+ },
86
+ {
87
+ "id": "europium",
88
+ "name": "Europium (Eu)",
89
+ "sector": "rare_earth",
90
+ "type": "input",
91
+ "china_share": 0.96,
92
+ "primary_provinces": ["Guangdong", "Jiangxi"],
93
+ "top_3_producers": ["China Southern Rare Earth", "Jiangxi Rare Earth", "Ganzhou Rare Earth"],
94
+ "monthly_import_value_usd_millions": 22.0,
95
+ "end_use_sectors": ["LED/LCD displays", "fluorescent lamps", "euro banknote security"],
96
+ "india_stockpile_days": 20,
97
+ "criticality": 0.81,
98
+ "hs_code": "280530"
99
+ },
100
+ {
101
+ "id": "yttrium",
102
+ "name": "Yttrium (Y)",
103
+ "sector": "rare_earth",
104
+ "type": "input",
105
+ "china_share": 0.89,
106
+ "primary_provinces": ["Guangdong", "Jiangxi", "Hunan"],
107
+ "top_3_producers": ["China Southern Rare Earth", "Jiangxi Rare Earth", "Hunan RE"],
108
+ "monthly_import_value_usd_millions": 35.0,
109
+ "end_use_sectors": ["OLED displays", "superconductors", "medical imaging"],
110
+ "india_stockpile_days": 18,
111
+ "criticality": 0.78,
112
+ "hs_code": "280530"
113
+ }
114
+ ]
backend/data/shocks.json ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "seed_alert_insulin_2026_04_24",
4
+ "sector": "pharma",
5
+ "title": "Single-source concentration risk identified for recombinant insulin",
6
+ "summary": "Single-source concentration risk identified for recombinant insulin",
7
+ "province": "Jiangsu",
8
+ "keyword_trigger": "seed_fallback",
9
+ "event_type": "seed_fallback",
10
+ "severity": "LOW",
11
+ "source": "MANUAL",
12
+ "source_url": null,
13
+ "published_at": "2026-04-24T17:15:00Z",
14
+ "detected_at": "2026-04-24T17:15:00Z",
15
+ "gdelt_query": "seed_fallback_alerts",
16
+ "gdelt_sources": 1,
17
+ "extraction_method": "seed_fallback"
18
+ },
19
+ {
20
+ "id": "seed_alert_atorvastatin_2026_04_23",
21
+ "sector": "pharma",
22
+ "title": "Atorvastatin API price anomaly detected in Mumbai wholesale",
23
+ "summary": "Atorvastatin API price anomaly detected in Mumbai wholesale",
24
+ "province": null,
25
+ "keyword_trigger": "seed_fallback",
26
+ "event_type": "seed_fallback",
27
+ "severity": "MEDIUM",
28
+ "source": "NEWS",
29
+ "source_url": "https://pharmabiz.com/news/api-price-monitoring-report-april",
30
+ "published_at": "2026-04-23T08:30:00Z",
31
+ "detected_at": "2026-04-23T08:30:00Z",
32
+ "gdelt_query": "seed_fallback_alerts",
33
+ "gdelt_sources": 1,
34
+ "extraction_method": "seed_fallback"
35
+ },
36
+ {
37
+ "id": "seed_alert_penicillin_2026_04_22",
38
+ "sector": "pharma",
39
+ "title": "Random inspection wave at Hebei Penicillin fermentation sites",
40
+ "summary": "Random inspection wave at Hebei Penicillin fermentation sites",
41
+ "province": "Hebei",
42
+ "keyword_trigger": "seed_fallback",
43
+ "event_type": "seed_fallback",
44
+ "severity": "MEDIUM",
45
+ "source": "HEBEI_EPB",
46
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/inspect-2026-04",
47
+ "published_at": "2026-04-22T16:00:00Z",
48
+ "detected_at": "2026-04-22T16:00:00Z",
49
+ "gdelt_query": "seed_fallback_alerts",
50
+ "gdelt_sources": 1,
51
+ "extraction_method": "seed_fallback"
52
+ },
53
+ {
54
+ "id": "seed_alert_metformin_2026_04_21",
55
+ "sector": "pharma",
56
+ "title": "Sudden drop in Metformin HCl import volumes from China",
57
+ "summary": "Sudden drop in Metformin HCl import volumes from China",
58
+ "province": "Jiangsu",
59
+ "keyword_trigger": "seed_fallback",
60
+ "event_type": "seed_fallback",
61
+ "severity": "MEDIUM",
62
+ "source": "TRADE_ANOMALY",
63
+ "source_url": null,
64
+ "published_at": "2026-04-21T11:20:00Z",
65
+ "detected_at": "2026-04-21T11:20:00Z",
66
+ "gdelt_query": "seed_fallback_alerts",
67
+ "gdelt_sources": 1,
68
+ "extraction_method": "seed_fallback"
69
+ },
70
+ {
71
+ "id": "seed_alert_ceftriaxone_2026_04_20",
72
+ "sector": "pharma",
73
+ "title": "Hebei winter heating production cuts affect 7-ACA",
74
+ "summary": "Hebei winter heating production cuts affect 7-ACA",
75
+ "province": "Hebei",
76
+ "keyword_trigger": "seed_fallback",
77
+ "event_type": "seed_fallback",
78
+ "severity": "HIGH",
79
+ "source": "HEBEI_EPB",
80
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/winter-curtailment-2026",
81
+ "published_at": "2026-04-20T09:00:00Z",
82
+ "detected_at": "2026-04-20T09:00:00Z",
83
+ "gdelt_query": "seed_fallback_alerts",
84
+ "gdelt_sources": 1,
85
+ "extraction_method": "seed_fallback"
86
+ },
87
+ {
88
+ "id": "seed_alert_azithromycin_2026_04_18",
89
+ "sector": "pharma",
90
+ "title": "FDA Warning Letter for Jiangsu Macrolide Facility",
91
+ "summary": "FDA Warning Letter for Jiangsu Macrolide Facility",
92
+ "province": "Jiangsu",
93
+ "keyword_trigger": "seed_fallback",
94
+ "event_type": "seed_fallback",
95
+ "severity": "HIGH",
96
+ "source": "FDA_WARNING_LETTER",
97
+ "source_url": "https://fda.gov/warning-letters/2026/china-api-inspection-fail",
98
+ "published_at": "2026-04-18T14:45:00Z",
99
+ "detected_at": "2026-04-18T14:45:00Z",
100
+ "gdelt_query": "seed_fallback_alerts",
101
+ "gdelt_sources": 1,
102
+ "extraction_method": "seed_fallback"
103
+ },
104
+ {
105
+ "id": "seed_alert_amoxicillin_2026_04_15",
106
+ "sector": "pharma",
107
+ "title": "Industrial accident in Jiangsu impacts 6-APA precursors",
108
+ "summary": "Industrial accident in Jiangsu impacts 6-APA precursors",
109
+ "province": "Jiangsu",
110
+ "keyword_trigger": "seed_fallback",
111
+ "event_type": "seed_fallback",
112
+ "severity": "HIGH",
113
+ "source": "NEWS",
114
+ "source_url": "https://reuters.com/business/pharma/jiangsu-industrial-accident-impacts-pharma",
115
+ "published_at": "2026-04-15T10:15:00Z",
116
+ "detected_at": "2026-04-15T10:15:00Z",
117
+ "gdelt_query": "seed_fallback_alerts",
118
+ "gdelt_sources": 1,
119
+ "extraction_method": "seed_fallback"
120
+ },
121
+ {
122
+ "id": "seed_alert_paracetamol_2024_q1",
123
+ "sector": "pharma",
124
+ "title": "Hebei API plant production halt — paracetamol supply at risk",
125
+ "summary": "Hebei API plant production halt — paracetamol supply at risk",
126
+ "province": "Hebei",
127
+ "keyword_trigger": "seed_fallback",
128
+ "event_type": "seed_fallback",
129
+ "severity": "CRITICAL",
130
+ "source": "HEBEI_EPB",
131
+ "source_url": "https://hbsthjt.hebei.gov.cn/notice/2024/01/15/api-plant-shutdown",
132
+ "published_at": "2024-01-17T08:30:00Z",
133
+ "detected_at": "2024-01-17T08:30:00Z",
134
+ "gdelt_query": "seed_fallback_alerts",
135
+ "gdelt_sources": 1,
136
+ "extraction_method": "seed_fallback"
137
+ }
138
+ ]