{
  "resourceType": "StructureDefinition",
  "constrainedType": "Extension",
  "base": "http://hl7.org/fhir/StructureDefinition/Extension",
  "id": "spark393",
  "meta": {
    "versionId": "spark393",
    "lastUpdated": "2015-10-02T12:26:57.227+00:00"
  },
  "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",
  "name": "Maximum repetitions",
  "status": "draft",
  "date": "2013-07-04",
  "publisher": "HL7",
  "contact": [
    {
      "telecom": [
        {
          "system": "other",
          "value": "http://www.hl7.org"
        }
      ]
    }
  ],
  "description": "The maximum number of times the group must appear or the minimum number of answers for a question - when greater than 1 and not unlimited.",
  "fhirVersion": "1.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM"
    }
  ],
  "kind": "datatype",
  "abstract": false,
  "contextType": "resource",
  "context": [
    "Questionnaire.group",
    "Questionnaire.group.group",
    "Questionnaire.group.question"
  ],
  "snapshot": {
    "element": [
      {
        "comments": "Only relevant if the element has repeats=true and there's a need to constrain the number of allowed repetitions.",
        "id": "Extension",
        "path": "Extension",
        "short": "Maximum repetitions",
        "definition": "The maximum number of times the group must appear or the minimum number of answers for a question - when greater than 1 and not unlimited.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "inv-2",
            "severity": "error",
            "human": "maxOccurs can't be more than one if repeats is false",
            "xpath": "f:valueInteger/@value<=1 or parent::*/f:repeats/@value=true()",
            "source": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A - MIF rather than RIM level"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "comments": "Only relevant if the element has repeats=true and there's a need to constrain the number of allowed repetitions.",
        "path": "Extension",
        "short": "Maximum repetitions",
        "definition": "The maximum number of times the group must appear or the minimum number of answers for a question - when greater than 1 and not unlimited.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "inv-2",
            "severity": "error",
            "human": "maxOccurs can't be more than one if repeats is false",
            "xpath": "f:valueInteger/@value<=1 or parent::*/f:repeats/@value=true()"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A - MIF rather than RIM level"
          }
        ]
      },
      {
        "name": "extension",
        "path": "Extension.extension",
        "max": "0"
      },
      {
        "path": "Extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs"
      },
      {
        "path": "Extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "integer"
          }
        ]
      }
    ]
  }
}