import json

data = {
 "topic": "Type 1 Diabetes",
 "slug": "type-1-diabetes",
 "category_id": 15405,
 "summary": "Type 1 diabetes is an autoimmune disease of pancreatic beta-cell destruction leading to absolute insulin deficiency, requiring lifelong exogenous insulin, and is the most common endocrine-metabolic disorder and most common form of diabetes in children.",
 "written_by": "claude-sonnet",
 "references": [
  {"title": "Pediatric Nutrition (Ronald E. Kleinman, Frank R. Greer)", "author": None, "pages": [864]},
  {"title": "CURRENT Diagnosis and Treatment Pediatrics, Twenty-Fourth Edition", "author": "Hay, William W., Levin, Myron J., Deterding, Robin R., Abzug, Mark J.", "pages": [1087]},
  {"title": "Pediatric Board Study Guide", "author": None, "pages": [443]},
  {"title": "The Clinician's Guide to Pediatric Nutrition", "author": "Natalie D. Muth;Mary Tanaka;", "pages": [381]},
  {"title": "Kliegman R. Nelson Textbook of Pediatrics 2-Volume Set 22ed 2024", "author": None, "pages": [3553, 3559]},
  {"title": "Pediatric Nutrition Handbook", "author": "Kleinman, Ronald E.", "pages": [724]},
  {"title": "Gomella's Neonatology: Management, Procedures, On-Call Problems, Diseases, and Drugs, Eighth Edition", "author": "Tricia Lacy Gomella, Fabien G. Eyal and Fayez Bany-Mohammed", "pages": [972]},
  {"title": "MedStudy Pediatrics Core 11th Edition 2024-2025", "author": None, "pages": [662]}
 ],
 "short": [
  {"title": "In short", "content": (
   "- Type 1 diabetes (T1D) is an autoimmune disorder causing destruction of pancreatic beta cells and eventual absolute insulin deficiency; it is the most common form of diabetes and the most common endocrine-metabolic disorder in people under 20\n"
   "- Affects about 0.3% of the US population; an estimated 1.5 million Americans have T1D, including more than 200,000 under age 20, with about 25,000 new pediatric diagnoses annually - incidence is slowly rising\n"
   "- Two incidence peaks: ages 4-6 years and ages 10-14 years (early puberty); boys and girls are affected equally; most common in whites of Northern European descent, uncommon in sub-Saharan African Black populations but more prevalent among US Black children of African descent\n"
   "- T1D subtypes: T1a (autoimmune, ~95% of cases, with autoantibodies to insulin, GAD65, IA-2, and ZnT8, and high-risk HLA haplotypes DR4-DQ8 and DR3-DQ2) and T1b (idiopathic, no identifiable autoimmunity)\n"
   "- Natural history has 3 stages: Stage 1 (≥2 diabetes-related autoantibodies, normal glucose), Stage 2 (dysglycemia without symptoms), Stage 3 (clinical diagnosis)\n"
   "- Classic presentation: polydipsia, polyuria, weight loss, though the patient may be overweight or obese - obesity does not rule out T1D\n"
   "- ADA diagnostic criteria (any one): fasting plasma glucose ≥126 mg/dL (7.0 mmol/L); 2-hour plasma glucose ≥200 mg/dL (11.1 mmol/L) on a 75-g oral glucose tolerance test; random plasma glucose ≥200 mg/dL (11.1 mmol/L) with classic hyperglycemic symptoms/crisis; or HbA1c ≥6.5%\n"
   "- At presentation, clinical overlap with type 2 diabetes exists: about 6% of type 2 diabetes patients can present with DKA and about 33% present with ketones, so autoantibody testing (islet cell antigen 512, insulin, GAD, ZnT8) can help differentiate T1D from other diabetes types when the picture is unclear\n"
   "- Management combines exogenous insulin (long-acting basal plus short-acting bolus doses, or an insulin pump/basal-bolus regimen), medical nutrition therapy, exercise, and blood glucose monitoring; insulin pump or basal-bolus regimens using long-acting basal analogs (glargine, detemir) allow more flexible meal timing since these have no significant peak\n"
   "- Long-term microvascular/macrovascular complications are reduced by maintaining HbA1c below 6.5% (48 mmol/mol); diabetic ketoacidosis carries significant morbidity/mortality risk and requires meticulous management"
  )}
 ],
 "long": [
  {"title": "Definition", "content": (
   "Type 1 diabetes mellitus (T1D) is an autoimmune disorder resulting in destruction of the insulin-producing beta cells of the pancreas, leading to progressive and eventually absolute insulin deficiency. It is distinguished from type 2 diabetes, which results from insulin resistance at the level of skeletal muscle, liver, and adipose tissue with varying degrees of beta-cell impairment, rather than primary autoimmune beta-cell destruction. T1D is further divided into T1a (autoimmune, accounting for roughly 95% of cases, marked by autoantibodies against islet autoantigens) and T1b (idiopathic, without identifiable autoimmune markers)."
  )},
  {"title": "Epidemiology", "content": (
   "T1D affects approximately 0.3% of the US population, and its incidence is slowly increasing both domestically and worldwide. It is estimated that 1.5 million people in the United States have T1D, including more than 200,000 individuals younger than 20 years, with approximately 25,000 new pediatric diagnoses each year. T1D is the most common type of diabetes mellitus in people younger than 20, although it can develop at any age and, notably, most total T1D cases (across all ages) are actually diagnosed after age 20. The disease shows a bimodal age distribution in children, with incidence peaks at 4-6 years of age and again at 10-14 years of age (coinciding with early puberty); boys and girls are affected equally. T1D is most common among white children of Northern European descent; it is uncommon among Black populations living in sub-Saharan Africa but is far more prevalent among Black children of African descent living in the United States."
  )},
  {"title": "Etiology", "content": (
   "T1a (autoimmune) diabetes, which accounts for about 95% of pediatric T1D, is characterized by circulating autoantibodies against islet cell autoantigens - insulin, glutamic acid decarboxylase (GAD65), islet antigen-2 (IA-2), and zinc transporter 8 (ZnT8) - together with high-risk HLA haplotypes, most notably DR4-DQ8 and DR3-DQ2. T1b (idiopathic) diabetes describes beta-cell destruction leading to insulin deficiency without demonstrable autoimmune markers. The natural history of T1D progresses through three recognized stages: Stage 1, marked by the presence of two or more diabetes-related autoantibodies with normal blood glucose; Stage 2, in which dysglycemia is present but the patient remains asymptomatic; and Stage 3, the point of clinical diagnosis with overt hyperglycemia and symptoms."
  )},
  {"title": "Pathophysiology", "content": (
   "Autoimmune destruction of pancreatic beta cells progressively reduces insulin secretion, which can be tracked clinically via fasting or stimulated C-peptide levels, typically low in T1D. As insulin deficiency becomes more complete, the body loses its principal mechanism for suppressing lipolysis and hepatic glucose output, and with complete absence of insulin, unchecked ketogenesis leads to diabetic ketoacidosis (DKA). Because insulin deficiency in T1D is generally severe and progressive (in contrast to the insulin resistance with relative deficiency seen in type 2 diabetes), patients with T1D have an absolute, lifelong requirement for exogenous insulin to prevent both acute metabolic decompensation and long-term vascular complications."
  )},
  {"title": "Clinical features", "content": (
   "The classic presentation includes polydipsia (increased thirst), polyuria, and weight loss; other reported features include hyperglycemia, glycosuria, nonspecific malaise, and symptoms of ketoacidosis in more advanced presentations. Historically, children with T1D were thin at diagnosis, but with the rising prevalence of childhood obesity, an increasing number of children with T1D are overweight or obese at presentation - so obesity no longer excludes the diagnosis. There can be substantial clinical overlap between T1D and type 2 diabetes at presentation: notably, about 6% of patients ultimately diagnosed with type 2 diabetes present with DKA, and roughly 33% present with ketones, so the presence of ketosis alone does not confirm T1D over type 2 diabetes."
  )},
  {"title": "Diagnostics", "content": (
   "Diagnosis follows American Diabetes Association (ADA) criteria, any one of which is sufficient: a fasting plasma glucose (FPG) of 126 mg/dL (7.0 mmol/L) or higher; a 2-hour plasma glucose of 200 mg/dL (11.1 mmol/L) or higher during a 75-g oral glucose tolerance test (OGTT); a random plasma glucose of 200 mg/dL (11.1 mmol/L) or higher in a patient with classic hyperglycemic symptoms or a hyperglycemic crisis; or an HbA1c of 6.5% or higher. When the clinical picture does not clearly distinguish T1D from other forms of diabetes (for example, an overweight adolescent with ketosis), pancreatic autoantibody testing - islet cell antigen 512, insulin autoantibodies, glutamic acid decarboxylase (GAD) antibodies, and zinc transporter 8 (ZnT8) antibodies - can help confirm an autoimmune (T1a) process."
  )},
  {"title": "Differential diagnosis", "content": (
   "Type 2 diabetes is the primary differential, particularly in overweight/obese adolescents, and can be distinguished by the presence of insulin resistance features, typically preserved or elevated C-peptide, and absence of islet autoantibodies, though as noted, ketosis and even DKA can occur in type 2 diabetes and do not rule it in favor of T1D. Monogenic diabetes accounts for an estimated 1-2% of diabetes cases and results from single-gene mutations affecting insulin production or release; it should be suspected with an autosomal dominant inheritance pattern, early onset (under 25 years), insulin independence, a non-obese phenotype inconsistent with type 2 diabetes, or preserved C-peptide despite a diabetes diagnosis - identifying the specific gene can have direct clinical management implications. Other specific diabetes types include genetic defects in beta-cell function or insulin action, diseases of the exocrine pancreas, endocrinopathies, drug- or chemical-induced diabetes, infections, uncommon immune-mediated forms, and genetic syndromes associated with diabetes (e.g., Down, Klinefelter, Turner, or Prader-Willi syndromes). Gestational diabetes is diagnosed in the second or third trimester of pregnancy in the absence of pre-existing overt diabetes."
  )},
  {"title": "Treatment", "content": (
   "Management of T1D requires a lifelong, absolute requirement for exogenous insulin, combined with medical nutrition therapy, regular exercise, and consistent blood glucose monitoring. Regimens typically combine a daily long-acting (basal) insulin with short-acting insulin boluses to cover carbohydrate intake and correct glucose excursions; alternatively, an insulin pump can deliver both basal and bolus insulin. For children on fixed-dose insulin regimens, meals should be timed consistently to coincide with the peak action of the insulin preparation used, with insulin doses adjusted based on food intake, physical activity, and blood glucose readings. In contrast, children using an insulin pump or a basal-bolus regimen with long-acting basal analogs (glargine or detemir) have more flexibility in meal timing, because these basal insulins lack a significant peak. Patient (and family) education to self-manage all components of the regimen - insulin dosing, diet, activity, and monitoring - is essential to achieving good long-term metabolic control, ideally maintaining HbA1c below 6.5% (48 mmol/mol) to reduce the risk of long-term complications."
  )}
 ],
 "clinical": [
  {"title": "Approach at diagnosis and initial management", "content": (
   "In a child presenting with polydipsia, polyuria, and weight loss (with or without overweight/obesity - remember obesity does not rule out T1D), confirm the diagnosis using ADA criteria: fasting glucose ≥126 mg/dL, 2-hour OGTT glucose ≥200 mg/dL, random glucose ≥200 mg/dL with classic symptoms, or HbA1c ≥6.5%. Assess for DKA at presentation given its associated morbidity and mortality, and remember that ketosis alone does not distinguish T1D from type 2 diabetes - about a third of adolescents ultimately diagnosed with type 2 diabetes present with ketones and about 6% present in DKA. If the type of diabetes is unclear (e.g., an overweight or obese adolescent with new hyperglycemia), send pancreatic autoantibodies (islet cell antigen 512, insulin, GAD, ZnT8) to help confirm an autoimmune process, and keep monogenic diabetes on the differential if there is an autosomal dominant family history, early onset, non-obese phenotype, or preserved C-peptide.\n\nOnce T1D is confirmed, initiate insulin therapy - either a basal-bolus regimen (long-acting basal insulin such as glargine or detemir, plus short-acting boluses for meals and correction) or an insulin pump - alongside structured diabetes education covering nutrition, exercise, and self-monitoring of blood glucose. If the family is using a fixed-dose (non-analog basal) regimen, counsel on eating at consistent times aligned with the insulin's peak action; if using a pump or long-acting basal analog, more flexible meal timing is possible. Set the long-term treatment target of HbA1c below 6.5% (48 mmol/mol) to reduce the risk of long-term vascular complications, and build a team approach (medical, nutritional, and psychosocial support) given the lifelong self-management burden T1D places on the child and family."
  )}
 ]
}

with open("/tmp/t1d.article.json", "w") as f:
    json.dump(data, f, indent=1)
print("written")
