docs: function addForm(schema, form, cloneFormsDeprecated) {
        var isAdmin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
        var indicators = arguments.length > 4 ? arguments[4] : undefined;
        var conditionsExprCompiler, contents, deploymentValues, jsonql, metadata, reverseJoins;
        contents = [];
        metadata = []; // Get deployments
  
        deploymentValues = _.map(form.deployments, function (dep) {
          return {
            id: dep._id,
            name: {
              en: dep.name
            }
          };
        });
        metadata.push({
          id: "deployment",
          type: "enum",
          name: {
            en: "Deployment"
          },
          enumValues: deploymentValues
        }); // Add user
  
        metadata.push({
          id: "user",
          name: {
            en: "Enumerator"
          },
          type: "join",
          join: {
            type: "n-1",
            toTable: "users",
            fromColumn: "user",
            toColumn: "_id"
          }
        }); // Add status
  
        metadata.push({
          id: "status",
          type: "enum",
          name: {
            en: "Status"
          },
          enumValues: [{
            id: "draft",
            name: {
              en: "Draft"
            }
          }, {
            id: "pending",
            name: {
              en: "Pending"
            }
          }, {
            id: "final",
            name: {
              en: "Final"
            }
          }, {
            id: "rejected",
            name: {
              en: "Rejected"
            }
          }]
        }); // Add code
  
        metadata.push({
          id: "code",
          type: "text",
          name: {
            en: "Response Code"
          }
        }); // Add startedOn
  
        metadata.push({
          id: "startedOn",
          type: "datetime",
          name: {
            en: "Drafted On"
          }
        }); // Add submitted on
  
        metadata.push({
          id: "submittedOn",
          type: "datetime",
          name: {
            en: "Submitted On"
          }
        }); // Add approvalLevel. Only has value if pending
  
        jsonql = {
          type: "case",
          cases: [{
            when: {
              type: "op",
              op: "=",
              exprs: [{
                type: "field",
                tableAlias: "{alias}",
                column: "status"
              }, {
                type: "literal",
                value: "pending"
              }]
            },
            then: {
              type: "op",
              op: "::text",
              exprs: [{
                type: "op",
                op: "jsonb_array_length",
                exprs: [{
                  type: "field",
                  tableAlias: "{alias}",
                  column: "approvals"
                }]
              }]
            }
          }]
        };
        metadata.push({
          id: "approvalLevel",
          type: "enum",
          name: {
            en: "Approval Level"
          },
          jsonql: jsonql,
          enumValues: [{
            id: "0",
            name: {
              en: "Pending Level 1"
            }
          }, {
            id: "1",
            name: {
              en: "Pending Level 2"
            }
          }, {
            id: "2",
            name: {
              en: "Pending Level 3"
            }
          }, {
            id: "3",
            name: {
              en: "Pending Level 4"
            }
          }]
        }); // Add IpAddress
  
        metadata.push({
          id: "ipAddress",
          type: "text",
          name: {
            en: "IP Address"
          }
        });
        contents.push({
          id: "metadata",
          type: "section",
          name: {
            en: "Response Metadata"
          },
          desc: {
            en: "Information about the response such as status, date, and IP Address"
          },
          contents: metadata
        });
        conditionsExprCompiler = new ConditionsExprCompiler(form.design); // List of joins in format: { table: destination table, column: join column to add }
  
        reverseJoins = [];
        this.addFormItem(form.design, contents, "responses:".concat(form._id), conditionsExprCompiler, null, reverseJoins); // Add to schema
  
        schema = schema.addTable({
          id: "responses:".concat(form._id),
          name: form.design.name,
          primaryKey: "_id",
          contents: contents,
          ordering: "submittedOn",
          label: "code"
        }); // Add any roster tables
  
        schema = this.addRosterTables(schema, form.design, conditionsExprCompiler, reverseJoins, "responses:".concat(form._id)); // Add reverse joins from entity and site questions
  
        schema = this.addReverseJoins(schema, form, reverseJoins);
  
        if (isAdmin) {
          schema = this.addConfidentialData(schema, form, conditionsExprCompiler);
          schema = this.addConfidentialDataForRosters(schema, form, conditionsExprCompiler);
        }
  
        schema = this.addCalculations(schema, form);
        schema = this.addIndicatorCalculations(schema, form, indicators, false); // Create table
  
        return schema;
      }