Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add API tests directly #193 #194

Merged
merged 2 commits into from
Feb 21, 2024
Merged

add API tests directly #193 #194

merged 2 commits into from
Feb 21, 2024

Conversation

oliveregger
Copy link
Member

This PR adds a first version to test the validation API with the $validate operation

  • tests are run with no external dependencies (no tx.fhir.org)
  • a tests has been added that it is checked that the validation session gets reused
  • a test ig is added https://github.com/ahdis/matchbox-test-ig for tests, that in future we can add additional test resources there and don't need to provide them in matchbox directly

the operation outcome has been extended, that the textual validation information is also added:

{
  "resourceType": "OperationOutcome",
  "id": "516b797860fe08b49713a0f6b3ed1216dad0ce97af98a834796cc8437a07c9d7",
  "issue": [ {
    "extension": [ {
      "url": "http://matchbox.health/validiation",
      "extension": [ {
        "url": "profile",
        "valueUri": "http://hl7.org/fhir/StructureDefinition/Patient"
      }, {
        "url": "profileVersion",
        "valueUri": "4.0.1"
      }, {
        "url": "profileDate",
        "valueDateTime": "2019-11-01T09:29:23+11:00"
      }, {
        "url": "total",
        "valueDuration": {
          "value": 39,
          "unit": "ms"
        }
      }, {
        "url": "validatorVersion",
        "valueString": "powered by matchbox 3.5.4, hapi-fhir 6.10.0 and org.hl7.fhir.core 6.1.16"
      }, {
        "url": "ig",
        "valueString": "hl7.fhir.r4.core#4.0.1"
      }, {
        "url": "hintAboutNonMustSupport",
        "valueBoolean": false
      }, {
        "url": "recursive",
        "valueBoolean": false
      }, {
        "url": "showMessagesFromReferences",
        "valueBoolean": false
      }, {
        "url": "doDebug",
        "valueBoolean": false
      }, {
        "url": "assumeValidRestReferences",
        "valueBoolean": false
      }, {
        "url": "canDoNative",
        "valueBoolean": false
      }, {
        "url": "noExtensibleBindingMessages",
        "valueBoolean": false
      }, {
        "url": "noUnicodeBiDiControlChars",
        "valueBoolean": false
      }, {
        "url": "noInvariants",
        "valueBoolean": false
      }, {
        "url": "displayIssuesAreWarnings",
        "valueBoolean": true
      }, {
        "url": "wantInvariantsInMessages",
        "valueBoolean": false
      }, {
        "url": "doImplicitFHIRPathStringConversion",
        "valueBoolean": false
      }, {
        "url": "securityChecks",
        "valueBoolean": false
      }, {
        "url": "crumbTrails",
        "valueBoolean": false
      }, {
        "url": "forPublication",
        "valueBoolean": false
      }, {
        "url": "httpReadOnly",
        "valueBoolean": false
      }, {
        "url": "allowExampleUrls",
        "valueBoolean": false
      }, {
        "url": "txServer",
        "valueUri": "http://localhost:8081/matchboxv3/fhir"
      }, {
        "url": "lang"
      }, {
        "url": "snomedCT"
      }, {
        "url": "fhirVersion",
        "valueString": "4.0.1"
      }, {
        "url": "ig",
        "valueString": "hl7.fhir.r4.core#4.0.1"
      }, {
        "url": "locale",
        "valueString": "English"
      }, {
        "url": "jurisdiction",
        "valueString": "urn:iso:std:iso:3166#CH"
      }, {
        "url": "sessionId",
        "valueString": "211057106"
      }, {
        "url": "package",
        "valueString": "hl7.fhir.xver-extensions#4.0"
      }, {
        "url": "package",
        "valueString": "hl7.fhir.r4.core#4.0.1"
      }, {
        "url": "package",
        "valueString": "hl7.fhir.uv.extensions.r4#1.0.0"
      }, {
        "url": "package",
        "valueString": "hl7.terminology#5.4.0"
      } ]
    } ],
    "severity": "information",
    "code": "informational",
    "diagnostics": "Validation for profile http://hl7.org/fhir/StructureDefinition/Patient|4.0.1 (2019-11-01T09:29:23+11:00). Loaded packages: hl7.fhir.xver-extensions#4.0, hl7.fhir.r4.core#4.0.1, hl7.fhir.uv.extensions.r4#1.0.0, hl7.terminology#5.4.0. Duration: 0.039s. powered by matchbox 3.5.4, hapi-fhir 6.10.0 and org.hl7.fhir.core 6.1.16. Validation parameters: CliContext{doNative=false, hintAboutNonMustSupport=false, recursive=false, showMessagesFromReferences=false, doDebug=false, assumeValidRestReferences=false, canDoNative=false, noExtensibleBindingMessages=false, noUnicodeBiDiControlChars=false, noInvariants=false, displayIssuesAreWarnings=true, wantInvariantsInMessages=false, doImplicitFHIRPathStringConversion=false, htmlInMarkdownCheck=WARNING, txServer='http://localhost:8081/matchboxv3/fhir', lang='null', snomedCT='null', fhirVersion='4.0.1', ig='hl7.fhir.r4.core#4.0.1', questionnaireMode=CHECK, level=HINTS, mode=VALIDATION, securityChecks=false, crumbTrails=false, forPublication=false, allowExampleUrls=false, locale='English', locations={}, jurisdiction='urn:iso:std:iso:3166#CH', igsPreloaded=null, onlyOneEngine=false, httpReadOnly=false}"
  }, {
    "severity": "information",
    "code": "informational",
    "diagnostics": "No fatal or error issues detected, the validation has passed"
  } ]
}

@oliveregger
Copy link
Member Author

oliveregger commented Feb 19, 2024

rebased it on the ql_dependency_upgrade2 branch and added a changelog

@qligier qligier merged commit 4dae35e into main Feb 21, 2024
5 of 7 checks passed
@qligier qligier deleted the oe_tests branch February 21, 2024 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants