{
  "resourceType" : "TestScript",
  "id" : "Test92-WarningBerUidGln",
  "language" : "en",
  "url" : "http://fhir.ch/ig/ch-elm/TestScript/Test92-WarningBerUidGln",
  "version" : "1.16.0",
  "name" : "Test92WarningBerUidGln",
  "status" : "active",
  "date" : "2026-10-22T06:32:21+00:00",
  "publisher" : "Federal Office of Public Health FOPH",
  "contact" : [{
    "name" : "Federal Office of Public Health FOPH",
    "telecom" : [{
      "system" : "url",
      "value" : "https://www.bag.admin.ch/bag/en/home/das-bag/kontakt-standort.html"
    }]
  }],
  "description" : "Test92: Verify that warnings for incorrect BER, UID and GLN are raised",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "urn:iso:std:iso:3166",
      "code" : "CH"
    }]
  }],
  "copyright" : "CC0-1.0",
  "fixture" : [{
    "id" : "inputdata",
    "autocreate" : false,
    "autodelete" : false,
    "resource" : {
      "reference" : "Binary/Test92-Bundle-WarningBerUidGln"
    }
  }],
  "test" : [{
    "name" : "Test92",
    "description" : "Test92: Verify that warnings for incorrect BER, UID and GLN are raised",
    "action" : [{
      "operation" : {
        "type" : {
          "system" : "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
          "code" : "validate"
        },
        "description" : "validate",
        "contentType" : "application/fhir+json",
        "encodeRequestUrl" : true,
        "params" : "profile=http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-document-strict",
        "sourceId" : "inputdata"
      }
    },
    {
      "assert" : {
        "description" : "Confirm that the returned HTTP status is 200(OK).",
        "direction" : "response",
        "responseCode" : "200",
        "warningOnly" : false
      }
    },
    {
      "assert" : {
        "description" : "Confirm that the returned resource is an OperationOutcome.",
        "expression" : "is(FHIR.OperationOutcome)",
        "value" : "true",
        "warningOnly" : false
      }
    },
    {
      "assert" : {
        "description" : "Confirm that we have no errors.",
        "expression" : "issue.where(severity='error' or severity='fatal').count()=0",
        "value" : "true",
        "warningOnly" : false
      }
    },
    {
      "assert" : {
        "description" : "Check Constraint failed: gln-modulus-10",
        "expression" : "issue.where(severity='warning' and diagnostics.startsWith('Constraint failed: gln-modulus-10:')).count() = 1",
        "value" : "true",
        "warningOnly" : false
      }
    },
    {
      "assert" : {
        "description" : "Check Constraint failed: gln-startswith76",
        "expression" : "issue.where(severity='warning' and diagnostics.startsWith('Constraint failed: gln-startswith76:')).count() = 1",
        "value" : "true",
        "warningOnly" : false
      }
    },
    {
      "assert" : {
        "description" : "Check Constraint failed: ber-length",
        "expression" : "issue.where(severity='warning' and diagnostics.startsWith('Constraint failed: ber-length')).count() = 1",
        "value" : "true",
        "warningOnly" : false
      }
    },
    {
      "assert" : {
        "description" : "Check Constraint failed: ber-modulus-11",
        "expression" : "issue.where(severity='warning' and diagnostics.startsWith('Constraint failed: ber-modulus-11')).count() = 1",
        "value" : "true",
        "warningOnly" : false
      }
    },
    {
      "assert" : {
        "description" : "Check Constraint failed: uidb-length",
        "expression" : "issue.where(severity='warning' and diagnostics.startsWith('Constraint failed: uidb-length')).count() = 1",
        "value" : "true",
        "warningOnly" : false
      }
    },
    {
      "assert" : {
        "description" : "Check Constraint failed: uidb-modulus-11",
        "expression" : "issue.where(severity='warning' and diagnostics.startsWith('Constraint failed: uidb-modulus-11')).count() = 1",
        "value" : "true",
        "warningOnly" : false
      }
    }]
  }]
}