{
  "formLayout": {
    "basic": [
      {
        "showFields": [
          { "field": "title", "col": 12 },
          { "field": "__$codeYesNo", "col": 12 },
          { "field": "code", "col": 12 },
          { "field": "status", "col": 12},
          { "field": "url", "col": 12},
          { "field": "description", "col": 12},
          { "field": "purpose", "col": 12}
        ]
      }
    ],
    "advanced": [
      {
        "showFields": [
          { "field": "__$terminologyServer", "col": 12},
          { field:  "implicitRules", col:  12},
          { field:  "version", col:  12},
          { field:  "name", col:  12},
          { field:  "identifier", col:  12},
          { field:  "meta", col:  12},
          { field:  "useContext", col:  12},
          { field:  "subjectType", "col": 12},
          { field:  "date", col:  12},
          { field:  "publisher", col:  12},
          { field:  "copyright", col:  12},
          { field:  "approvalDate", col:  12},
          { field:  "lastReviewDate", col:  12},
          { field:  "effectivePeriod", col:  12},
          { field:  "contained", "col": 12},
          { field:  "__$variable", col: 12},
          { field:  "__$extensionContainer", col: 12}
        ]
      }
    ],
    "targetPage": "formLevel"
  },
  // Please note that the jsonpath expression paths in the keys
  overridePropertyLabels: {
    '$.properties.extension': 'Extensions',
    '$.properties.contained': 'Contained resources',
    '$.properties.name': 'Questionnaire name',
    '$.properties.date': 'Revision date',
    '$.properties.meta.properties.tag': 'Tags',
    '$.properties.identifier': 'Identifiers',
    '$.properties.meta': 'Meta',
    '$.properties.useContext': 'Usage Context',
    '$.properties.useContext.items.properties.__$valueSummary': 'Value',
    '$.definitions.Meta.properties.versionId': 'Version ID (Read-only)',
    '$.definitions.Meta.properties.lastUpdated': 'Last updated (Read-only)',
    '$.definitions.Meta.properties.source': 'Source',
    '$.definitions.Meta.properties.profile': 'Profiles',
    '$.definitions.Meta.properties.security': 'Security labels',
    '$.definitions.Meta.properties.tag': 'Tags',
    '$.definitions.ValueSet.properties.resourceType': 'Type',
  },
  // Specify widget layout.
  // id is widget schema registry defined in lforms-widget-registry.ts
  // Label classes and control classes are used in the widget templates to fine tune widget layout positions
  widgetPresetMap: {
    inputBox: 'formStringField',
    textArea: 'formTextareaField',
    instant: 'formInstantField',
    'positive-integer': 'formPositiveIntegerField',
    'unsigned-integer': 'formUnsignedIntegerField'
  },

  widgets: {
    inputDate: {
      id: "date",
      labelPosition: "left",
      labelClasses: "col-sm-2 m-0 ps-0 pe-1",
      controlClasses: "col-sm-3",
      placeholder: 'yyyy-MM-dd'
    },
    inputDateTime: {
      id: "datetime",
      labelPosition: "left",
      labelClasses: "col-sm-2 m-0 ps-0 pe-1",
      controlClasses: "col-sm-3",
      placeholder: 'yyyy-MM-dd hh:mm:ss (AM|PM)'
    },
    url: {
      id: "url",
      labelPosition: "left",
      labelClasses: "col-sm-2 m-0 ps-0 pe-1",
      controlClasses: "col-sm-10 form-control"
    },
    dateRange: {
      id: "date-range",
      labelPosition: "left",
      labelClasses: "col-sm-2 m-0 ps-0 pe-1",
      controlClasses: "col-sm-6",
      showFields: [
        {"field": "start", "col": 6},
        {"field": "end", "col": 6}
      ]
    },
    __$terminologyServer: {
      "id": "terminology-server",
      "placeholder": "Enter url for preferred terminology server",
      "note": "You may wish to set this if you want to provide an answer value set for any item in this questionnaire.",
      "labelPosition": "left",
      "labelClasses": "col-sm-2 ps-0 pe-1",
      "controlClasses": "col-sm-10 m-0 p-0"
    },
    coding: {
      "id": "table",
      "labelPosition": "left",
      "labelClasses": "col-sm-2 m-0 ps-0 pe-1",
      "controlClasses": "col-sm-10 ps-0 pe-0",
      "noTableLabel": false,
      "noCollapseButton": true,
      "addButtonLabel": "Add new tag",
      "showFields": [
        {"field": "display", "col": 4, "nolabel": true},
        {"field": "code", "col": 3, "nolabel": true},
        {"field": "system", "col": 4, "nolabel": true}
      ]
    },
    identifier: {
      "id": "identifier",
      "addDefaultItemIfEmpty": false,
      "addEditAction": true,
      "labelPosition": "left",
      "labelClasses": "col-sm-2 ps-0 pe-1",
      "controlClasses": "col-sm-10",
      "addButtonLabel": "Add new identifier",
      "showFields": [
        {"field": "value", "col": 4, "nolabel": true},
        {"field": "system", "col": 4, "nolabel": true},
        {"field": "use", "col": 3, "nolabel": true}
      ]
    },
    metaSecurity: {
      "id": "table",
      "labelPosition": "left",
      "labelClasses": "col-sm-2 m-0 ps-0 pe-1",
      "controlClasses": "col-sm-10 ps-0 pe-0",
      "noTableLabel": false,
      "noCollapseButton": true,
      "addButtonLabel": "Add new security",
      "showFields": [
        {"field": "display", "col": 4, "nolabel": true},
        {"field": "code", "col": 3, "nolabel": true},
        {"field": "system", "col": 4, "nolabel": true}
      ]
    },
    metaProfile: {
      "id": "meta-profile",
      "labelPosition": "left",
      "labelClasses": "col-sm-2 m-0 ps-0 pe-1",
      "controlClasses": "col-sm-10 ps-0 pe-0",
      "noCollapseButton": true,
      "noTableLabel": false,
      "addButtonLabel": "Add profile"
    },
    metaGroup: {
      "id": "lfb-object",
      "labelClasses": "col-sm-2 ps-0 pe-1",
      "showFields": [
        {"field": "versionId", "col": 12},
        {"field": "lastUpdated", "col": 12},
        {"field": "source", "col": 12},
        {"field": "profile", "col": 12},
        {"field": "security", "col": 12},
        {"field": "tag", "col": 12}
      ]
    },
    usageContext: {
      "id": "usage-context",
      "addEditAction": true,
      "labelPosition": "left",
      "labelClasses": "col-sm-2 ps-0 pe-1",
      "controlClasses": "col-sm-10",
      "noTableLabel": false,
      "addButtonLabel": "Add Usage Context",
      "showFields": [
        {"field": "code.display", "title": "Display", "col": 4, "nolabel": true},
        {"field": "code.code", "title": "Code", "col": 3, "nolabel": true},
        {"field": "__$valueSummary", "title": "Value", "col": 4, "nolabel": true}
      ]
    },
    contained: {
      "id": "contained",
      "addEditAction": true,
      "labelPosition": "left",
      "labelClasses": "col-sm-2 ps-0 pe-1",
      "controlClasses": "col-sm-10",
      "addButtonLabel": "Add new ValueSet",
      "addButtonTitle": "At present, only ValueSet is supported as contained resource.",
      "showFields": [
        // The fields here are canonical paths of FormProperty.
        {"field": "resourceType", "col": 1, "nolabel": true},
        {"field": "id", "col": 3, "nolabel": true},
        {"field": "title", "col": 4, "nolabel": true},
        {"field": "date", "col": 2, "nolabel": true},
        {"field": "status", "col": 1, "nolabel": true}
      ]
    },
    "__$extensionContainer": {
      "id": "extension-container",
      "labelPosition": "left",
      "labelClasses": "col-sm-2 ps-0 pe-1",
      "controlClasses": "col-sm-10",
    },
    extension: {
      "id": "extension",
      "addEditAction": true,
      "labelPosition": "left",
      "labelClasses": "col-sm-2 ps-0 pe-1",
      "controlClasses": "col-sm-10",
      "addButtonLabel": "Add new extension",
      "addButtonTitle": "Note that the extensions added by other UI elements will be disabled for editing here.",
      "showFields": [
        // The fields here are canonical paths of FormProperty.
        {"field": "url", "col": 4, "nolabel": true},
        {"field": "__$valueType", "col": 2, "nolabel": true},
        {"field": "__$stringify", "col": 5, "nolabel": true},
      ]
    },
    valueSet: {
      "id": "value-set",
      "nolabel": true,
      "controlClasses": "col-sm-12",
      "showFields": [
        // The fields here are canonical paths of FormProperty.
        {
          "field": "id",
          "col": 2,
          "nolabel": true
        },
        {
          "field": "meta/tag",
          "col": 4,
          "nolabel": true
        },
        {
          "field": "meta/tag",
          "col": 3,
          "nolabel": true
        },
        {
          "field": "meta/tag",
          "col": 3,
          "nolabel": true
        }
      ]
    },
    "__$variable": {
      "id": "variable",
      "expressionUri":  "http://hl7.org/fhir/StructuredDefinition/variable",
      "showExpression": false,
      "displayExpressionEditorSections": {
        titleSection: true,
        uneditableVariablesSection: false,
        itemVariablesSection: true,
        outputExpressionSection: false
      },
      "labelPosition": "left",
      "labelClasses": "col-2 ps-0 pe-1",
      "controlClasses": "col-10 ",
      "addButtonLabel": "Add/edit variables",
      "showHeaderFields": [
        {"field": "valueExpression.properties.name", "nolabel": true, "col": 2, "title": "Name"},
        {"field": "valueExpression.properties.extension", "nolabel": true, "col": 3, "title": "Type"},
        {"field": "valueExpression.properties.expression", "nolabel": true, "col": 6, "title": "Question/FHIRPath Expression/FHIR Query"},
      ],
      "showDataFields": [
        {"field": "valueExpression.name", "nolabel": true, "col": 2, "title": "Name"},
        {"field": "valueExpression.extension", "nolabel": true, "col": 3, "title": "Type"},
        {"field": "valueExpression.expression", "nolabel": true, "col": 6, "title": "Question/FHIRPath Expression/FHIR Query"}
      ]
    }
  },
  // Map property: Each widget type is mapped to fields with jsonpath of its schema.
  widgetsMap: {
    // List of fields implementing this widget.
    inputBox: [
      '$.properties.url',
      '$.properties.implicitRules',
      '$.properties.version',
      '$.properties.title',
      '$.properties.name',
      '$.properties.publisher',
      '$.properties.description',
      '$.properties.purpose',
      '$.definitions.Meta.properties.versionId',
      '$.definitions.Meta.properties.lastUpdated',
    ],
    url: [
      '$.definitions.Meta.properties.source',
    ],
    textArea: [
      '$.properties.copyright',
    ],
    inputDate: [
      '$.properties.approvalDate',
      '$.properties.lastReviewDate'
    ],
    inputDateTime: [
      '$.properties.date',
    ],
    dateRange: [
      '$.properties.effectivePeriod'
    ],
    __$terminologyServer: [
      '$.properties.__$terminologyServer'
    ],
    coding: [
      '$.definitions.Meta.properties.tag',
    ],
    metaSecurity: [
      '$.definitions.Meta.properties.security',
    ],
    metaProfile: [
      '$.definitions.Meta.properties.profile',
    ],
    metaGroup: [
      '$.properties.meta',
    ],
    usageContext: [
      '$.properties.useContext'
    ],
    extension: [
      '$.properties.extension'
    ],
    identifier: [
      '$.properties.identifier'
    ],
    contained: [
      '$.properties.contained'
    ],
    valueSet: [
      '$.definitions.ValueSet'
    ],
    __$variable: [
      '$.properties.__$variable'
    ],
    __$extensionContainer: [
      '$.properties.__$extensionContainer'
    ]
  }
}
