{
  "resourceType": "Questionnaire",
  "status": "active",
  "item": [
    {
      "linkId": "fib4",
      "text": "FIB-4 Liver Fibrosis Index",
      "type": "group",
      "item": [
        {
          "linkId": "fib4-age",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "30525-0"
            }
          ],
          "text": "Age (years)",
          "type": "integer",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "a",
                "display": "years"
              }
            }
          ]
        },
        {
          "linkId": "fib4-ast",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "1920-8"
            }
          ],
          "text": "AST (U/L)",
          "type": "decimal",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "U/L",
                "display": "U/L"
              }
            }
          ]
        },
        {
          "linkId": "fib4-alt",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "1742-6"
            }
          ],
          "text": "ALT (U/L)",
          "type": "decimal",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "U/L",
                "display": "U/L"
              }
            }
          ]
        },
        {
          "linkId": "fib4-plt",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "777-3"
            }
          ],
          "text": "Platelets (×10⁹/L)",
          "type": "decimal",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "10*9/L",
                "display": "×10⁹/L"
              }
            }
          ]
        },
        {
          "linkId": "fib4-index",
          "text": "FIB-4 index",
          "type": "decimal",
          "readOnly": true,
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
              "valueExpression": {
                "language": "text/fhirpath",
                "expression": "((((%resource.item.where(linkId='fib4').item.where(linkId='fib4-age').answer.valueInteger) * (%resource.item.where(linkId='fib4').item.where(linkId='fib4-ast').answer.valueDecimal)) / ((%resource.item.where(linkId='fib4').item.where(linkId='fib4-plt').answer.valueDecimal) * (%resource.item.where(linkId='fib4').item.where(linkId='fib4-alt').answer.valueDecimal).sqrt()))).round(2)"
              }
            }
          ]
        },
        {
          "linkId": "fib4-category",
          "text": "FIB-4 category",
          "type": "string",
          "readOnly": true,
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
              "valueExpression": {
                "language": "text/fhirpath",
                "expression": "iif((((%resource.item.where(linkId='fib4').item.where(linkId='fib4-age').answer.valueInteger) * (%resource.item.where(linkId='fib4').item.where(linkId='fib4-ast').answer.valueDecimal)) / ((%resource.item.where(linkId='fib4').item.where(linkId='fib4-plt').answer.valueDecimal) * (%resource.item.where(linkId='fib4').item.where(linkId='fib4-alt').answer.valueDecimal).sqrt())).exists(), iif((((%resource.item.where(linkId='fib4').item.where(linkId='fib4-age').answer.valueInteger) * (%resource.item.where(linkId='fib4').item.where(linkId='fib4-ast').answer.valueDecimal)) / ((%resource.item.where(linkId='fib4').item.where(linkId='fib4-plt').answer.valueDecimal) * (%resource.item.where(linkId='fib4').item.where(linkId='fib4-alt').answer.valueDecimal).sqrt())) < 1.3, 'Low risk (< 1.3)', iif((((%resource.item.where(linkId='fib4').item.where(linkId='fib4-age').answer.valueInteger) * (%resource.item.where(linkId='fib4').item.where(linkId='fib4-ast').answer.valueDecimal)) / ((%resource.item.where(linkId='fib4').item.where(linkId='fib4-plt').answer.valueDecimal) * (%resource.item.where(linkId='fib4').item.where(linkId='fib4-alt').answer.valueDecimal).sqrt())) < 2.67, 'Indeterminate (1.3–2.67)', 'High risk (> 2.67)')), {})"
              }
            }
          ]
        }
      ]
    }
  ]
}
