[
  {
    "name": "_id",
    "description": "_id",
    "type": "ObjectId",
    "required": true,
    "nullable": false
  },
  {
    "name": "creatorId",
    "description": "creatorId",
    "type": "string",
    "required": true,
    "nullable": false
  },
  {
    "name": "createdAt",
    "description": "createdAt",
    "type": "Date",
    "required": true,
    "nullable": false
  },
  {
    "name": "updaterId",
    "description": "updaterId",
    "type": "string",
    "required": true,
    "nullable": false
  },
  {
    "name": "updatedAt",
    "description": "updatedAt",
    "type": "Date",
    "required": true,
    "nullable": false
  },
  {
    "name": "__STATE__",
    "description": "__STATE__",
    "type": "string",
    "required": true,
    "nullable": false
  },
  {
    "name": "planName",
    "type": "string",
    "required": true,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "prototypeId",
    "type": "string",
    "required": true,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "notes",
    "type": "string",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "startDate",
    "type": "Date",
    "required": true,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "endDate",
    "type": "Date",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "each",
    "type": "Array_string",
    "required": true,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "times",
    "type": "number",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "hours",
    "type": "Array_string",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "doctorId",
    "type": "string",
    "required": true,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "patientId",
    "type": "string",
    "required": true,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "adherenceToleranceTime",
    "type": "number",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "adherenceToleranceFrequency",
    "type": "string",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "adherenceMinimumPercentage",
    "type": "number",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "complianceMinimumPercentage",
    "type": "number",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "isPatientAdherent",
    "type": "boolean",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "isPatientCompliant",
    "type": "boolean",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "tresholds",
    "type": "Array_RawObject",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false,
    "schema": {
      "properties": {
        "propertyName": {
          "type": "string",
          "description": "Name of the property the threshold is evaluated on"
        },
        "tresholdOperator": {
          "type": "string",
          "description": "Name of the operator",
          "enum": [
            "gt",
            "lt",
            "gte",
            "lte",
            "eq"
          ]
        },
        "tresholdValue": {
          "type": "number",
          "description": "Threshold value"
        }
      },
      "required": [
        "propertyName",
        "tresholdOperator",
        "tresholdValue"
      ]
    }
  },
  {
    "name": "isPatientAdherentLastUpdatedAt",
    "type": "Date",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "isPatientCompliantLastUpdatedAt",
    "type": "Date",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  },
  {
    "name": "thresholds",
    "type": "Array_RawObject",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false,
    "schema": {
      "properties": {
        "propertyName": {
          "type": "string",
          "description": "Name of the property the threshold is evaluated on"
        },
        "thresholdOperator": {
          "type": "string",
          "description": "Name of the operator",
          "enum": [
            "gt",
            "lt",
            "gte",
            "lte",
            "eq",
            "between",
            "notBetween"
          ]
        },
        "thresholdValue": {
          "oneOf": [
            {
              "type": "number",
              "description": "Threshold value"
            },
            {
              "type": "array",
              "items": { "type": "number" },
              "minLength": 2,
              "maxLength": 2,
              "description": "Threshold range"
            }
          ]
        }
      },
      "required": [
        "propertyName",
        "thresholdOperator",
        "thresholdValue"
      ]
    }
  },
  {
    "name": "assignedDevices",
    "type": "Array_string",
    "required": false,
    "nullable": false,
    "sensitivityValue": 0,
    "encryptionEnabled": false,
    "encryptionSearchable": false
  }
]
