{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://meethealth.org/sample-package/schema.json",
  "title": "Meethealth sample record (meethealth-sample-v1)",
  "type": "object",
  "required": [
    "patient_id",
    "patient_data",
    "prompt",
    "diet",
    "meethealth"
  ],
  "properties": {
    "patient_id": {
      "type": "string",
      "format": "uuid"
    },
    "patient_data": {
      "type": "object",
      "description": "Synthetic patient profile. Fields beyond the required set vary by scenario (labs, dietary recall, lifestyle).",
      "required": [
        "id",
        "name",
        "age",
        "gender",
        "language",
        "weight",
        "height",
        "activity_level",
        "prompt_mode"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Generated with Faker. Not a real person."
        },
        "age": {
          "type": "integer",
          "minimum": 18,
          "maximum": 80
        },
        "age_group": {
          "type": "string"
        },
        "gender": {
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "language": {
          "type": "string",
          "enum": [
            "en",
            "es"
          ]
        },
        "conditions": {
          "type": "string",
          "description": "Comma-separated diagnoses."
        },
        "allergies": {
          "type": "string"
        },
        "preferences": {
          "type": "string"
        },
        "weight": {
          "type": "number",
          "description": "kg"
        },
        "height": {
          "type": "number",
          "description": "cm"
        },
        "bmi": {
          "type": "number"
        },
        "activity_level": {
          "type": "string"
        },
        "prompt_mode": {
          "type": "string",
          "enum": [
            "standard",
            "clinical"
          ]
        },
        "clinical_analysis_depth": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "prompt": {
      "type": "string",
      "description": "Exact generation prompt sent to the model."
    },
    "diet": {
      "type": "object",
      "required": [
        "content",
        "model",
        "temperature"
      ],
      "properties": {
        "content": {
          "type": "string",
          "description": "Markdown plan: Summary, 4\u00d77 meal tables, Foods (Include/Avoid), Notes."
        },
        "model": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "temperature": {
          "type": "number"
        },
        "reasoning": {
          "type": "boolean"
        }
      }
    },
    "meethealth": {
      "type": "object",
      "description": "Provenance and verification block added at packaging time. Source fields are unmodified.",
      "required": [
        "package",
        "package_version",
        "source_corpus",
        "source_line",
        "contract",
        "contract_fingerprint",
        "gate_failures",
        "package_checks",
        "evidence_level",
        "expert_review"
      ],
      "properties": {
        "package": {
          "const": "meethealth-sample-v1"
        },
        "package_version": {
          "type": "string"
        },
        "source_corpus": {
          "type": "string"
        },
        "source_line": {
          "type": "integer",
          "description": "0-indexed line in the source corpus."
        },
        "contract": {
          "type": "string"
        },
        "contract_fingerprint": {
          "type": "string"
        },
        "gate_rules_evaluated": {
          "type": "integer"
        },
        "gate_failures": {
          "type": "array",
          "maxItems": 0
        },
        "package_checks": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "required": [
              "pass",
              "detail"
            ],
            "properties": {
              "pass": {
                "type": "boolean"
              },
              "detail": {
                "type": "string"
              }
            }
          }
        },
        "evidence_level": {
          "type": "string"
        },
        "expert_review": {
          "type": "string",
          "enum": [
            "not_performed",
            "sampled",
            "full"
          ]
        }
      }
    }
  }
}
