{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://askcalculators.com/calculator/pregnancy-calculator/schema.json",
  "title": "Pregnancy Calculator inputs",
  "description": "Estimate due date, conception date, gestational age, trimester, term window, and pregnancy milestones from five dating methods.",
  "type": "object",
  "properties": {
    "method": {
      "title": "Dating method",
      "type": "string",
      "default": "lmp",
      "enum": [
        "due",
        "lmp",
        "conception",
        "ultrasound",
        "ivf"
      ],
      "x-optionLabels": {
        "due": "Known due date",
        "lmp": "Last menstrual period",
        "conception": "Conception date",
        "ultrasound": "Ultrasound dating",
        "ivf": "IVF embryo transfer"
      }
    },
    "dueDate": {
      "title": "Known due date",
      "type": "string",
      "default": "2027-03-08",
      "format": "date",
      "x-showWhen": {
        "field": "method",
        "equals": "due"
      }
    },
    "lmpDate": {
      "title": "First day of last menstrual period",
      "type": "string",
      "default": "2026-06-01",
      "format": "date",
      "x-showWhen": {
        "field": "method",
        "equals": "lmp"
      }
    },
    "cycleLength": {
      "title": "Average cycle length",
      "type": "number",
      "default": 28,
      "minimum": 20,
      "maximum": 45,
      "x-step": 1,
      "multipleOf": 1,
      "x-suffix": "days",
      "x-showWhen": {
        "field": "method",
        "equals": "lmp"
      }
    },
    "conceptionDate": {
      "title": "Known conception date",
      "type": "string",
      "default": "2026-06-15",
      "format": "date",
      "x-showWhen": {
        "field": "method",
        "equals": "conception"
      }
    },
    "ultrasoundDate": {
      "title": "Ultrasound date",
      "type": "string",
      "default": "2026-08-24",
      "format": "date",
      "x-showWhen": {
        "field": "method",
        "equals": "ultrasound"
      }
    },
    "ultrasoundWeeks": {
      "title": "Gestational age at ultrasound: weeks",
      "type": "number",
      "default": 12,
      "minimum": 0,
      "maximum": 42,
      "x-step": 1,
      "multipleOf": 1,
      "x-showWhen": {
        "field": "method",
        "equals": "ultrasound"
      }
    },
    "ultrasoundDays": {
      "title": "Additional days",
      "type": "number",
      "default": 0,
      "minimum": 0,
      "maximum": 6,
      "x-step": 1,
      "multipleOf": 1,
      "x-showWhen": {
        "field": "method",
        "equals": "ultrasound"
      }
    },
    "transferDate": {
      "title": "Embryo transfer date",
      "type": "string",
      "default": "2026-06-20",
      "format": "date",
      "x-showWhen": {
        "field": "method",
        "equals": "ivf"
      }
    },
    "embryoAgeDays": {
      "title": "Embryo age at transfer",
      "type": "number",
      "default": 5,
      "enum": [
        3,
        5,
        6
      ],
      "x-optionLabels": {
        "3": "Day 3 embryo",
        "5": "Day 5 embryo",
        "6": "Day 6 embryo"
      },
      "x-showWhen": {
        "field": "method",
        "equals": "ivf"
      }
    },
    "asOfDate": {
      "title": "Calculate pregnancy progress as of",
      "type": "string",
      "x-defaultToday": true,
      "format": "date"
    }
  },
  "required": [
    "method",
    "asOfDate"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "method": {
            "const": "due"
          }
        },
        "required": [
          "method"
        ]
      },
      "then": {
        "required": [
          "dueDate"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "method": {
            "const": "lmp"
          }
        },
        "required": [
          "method"
        ]
      },
      "then": {
        "required": [
          "lmpDate"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "method": {
            "const": "lmp"
          }
        },
        "required": [
          "method"
        ]
      },
      "then": {
        "required": [
          "cycleLength"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "method": {
            "const": "conception"
          }
        },
        "required": [
          "method"
        ]
      },
      "then": {
        "required": [
          "conceptionDate"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "method": {
            "const": "ultrasound"
          }
        },
        "required": [
          "method"
        ]
      },
      "then": {
        "required": [
          "ultrasoundDate"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "method": {
            "const": "ultrasound"
          }
        },
        "required": [
          "method"
        ]
      },
      "then": {
        "required": [
          "ultrasoundWeeks"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "method": {
            "const": "ultrasound"
          }
        },
        "required": [
          "method"
        ]
      },
      "then": {
        "required": [
          "ultrasoundDays"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "method": {
            "const": "ivf"
          }
        },
        "required": [
          "method"
        ]
      },
      "then": {
        "required": [
          "transferDate"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "method": {
            "const": "ivf"
          }
        },
        "required": [
          "method"
        ]
      },
      "then": {
        "required": [
          "embryoAgeDays"
        ]
      }
    }
  ],
  "additionalProperties": false,
  "x-askcalculators": {
    "version": "2.0.0",
    "calculatorUrl": "https://askcalculators.com/calculator/pregnancy-calculator/",
    "queryExample": "https://askcalculators.com/calculator/pregnancy-calculator/?method=lmp&lmpDate=2026-06-01&cycleLength=28",
    "migrationStatus": "migrated",
    "reviewStatus": "pending",
    "pageStatus": "live",
    "workStatus": "pending",
    "migratedDate": "2026-08-25",
    "formula": {
      "expression": "LMP due date = LMP + 280 days + cycle adjustment; conception = due − 266 days; ultrasound and IVF modes subtract measured gestational or embryo age from 266–280 days."
    },
    "quality": {
      "availability": "live",
      "technicalReviewRecord": "/reviews/pregnancy-calculator.json",
      "qualifiedReview": "pending",
      "qualifiedReviewer": null,
      "qualifiedReviewDate": null,
      "formulaVersion": "2.0.0",
      "referenceCoverage": "references-listed",
      "releaseTestScope": "Catalog and regression checks are not a professional formula audit; consult release evidence.",
      "historicalMetadataDate": "2026-08-25",
      "historicalMetadataNotice": "The imported date is not evidence of a completed human review."
    },
    "outputs": {
      "dueDateResult": {
        "title": "Estimated due date",
        "type": "string",
        "x-format": "date",
        "format": "date",
        "x-primary": true
      },
      "gestationalAge": {
        "title": "Gestational age",
        "type": "string",
        "x-format": "text"
      },
      "trimester": {
        "title": "Trimester",
        "type": "string",
        "x-format": "text"
      },
      "conceptionDateResult": {
        "title": "Estimated conception date",
        "type": "string",
        "x-format": "date",
        "format": "date"
      },
      "lmpDateResult": {
        "title": "Estimated LMP date",
        "type": "string",
        "x-format": "date",
        "format": "date"
      },
      "daysRemaining": {
        "title": "Days until estimated due date",
        "type": "number",
        "x-format": "integer"
      },
      "termWindow": {
        "title": "Estimated term window",
        "type": "string",
        "x-format": "text"
      }
    }
  }
}
