{
  "resourceType": "StructureDefinition",
  "id": "sort-score",
  "url": "http://hl7.org/fhir/StructureDefinition/sort-score",
  "version": "4.0",
  "name": "sort-score",
  "title": "Sorting Score",
  "status": "draft",
  "publisher": "Orion Health",
  "description": "A calculated value that can be used for sorting resources",
  "purpose": "This extension provides a field that can be used for sorting a set of resources. It is used specifically within problem type resources (e.g. AllergyIntolerance, Condition, Flag) where attributes like severity, criticality, reaction severity, category, resource type etc may all contribute to an overall score which indicates if that resources should appear higher in the list than others",
  "fhirVersion": "4.0",
  "kind": "complex-type",
  "abstract": false,
  "type": "Extension",
  "snapshot": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "max": "1",
        "base": {
          "path": "Extension",
          "max": "1"
        }
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "base": {
          "path": "Extension.url"
        },
        "fixedUri": "http://hl7.org/fhir/StructureDefinition/sort-score"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "short": "A calculated value that can be used for sorting resources",
        "definition": "Set the sort score for the resource",
        "comment": "32 bit number; for values larger than this, use decimal",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Extension.value[x]",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "integer"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "max": "1"
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "http://hl7.org/fhir/StructureDefinition/sort-score"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "short": "A calculated value that can be used for sorting resources",
        "definition": "Set the sort score for the resource",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "integer"
          }
        ]
      }
    ]
  }
}