Search code examples
hl7-fhir

How can I programmatically get the actual scoring values from the FHIR Questionnaire for the GCS example?


I am just getting started with HL7 FHIR and I am having a hard time digging into it the specifics of how the Questionnaire (and QuestionnaireResponse) resource is supposed to be used. We would like to create a questionnaire that has some kind of scoring system. We have previously implemented the Glascow Coma Scale (GCS) ourselves in our own proprietary (minimal) model, so when I found GCS being listed on the examples page I thought it would be a good start for understanding this.

The first question I ask myself is, where are the actual scoring values? The Questionnaire resource lists stuff such as http://loinc.org/ValueSet/LL357-5 as the ValueSet, which contains stuff such as this:

 "compose": {
    "include": [ {
      "system": "http://loinc.org",
      "concept": [ {
        "code": "LA6562-8",
        "display": "No motor response"
      }, {
        "code": "LA6563-6",
        "display": "Extension to pain"
      }, {
        "code": "LA6564-4",
        "display": "Flexion to pain"
      }, {
        "code": "LA6565-1",
        "display": "Withdrawal from pain"
      }, {
        "code": "LA6566-9",
        "display": "Localizing pain"
      }, {
        "code": "LA6567-7",
        "display": "Obeys commands"
      } ]
    } ]
  }

Each of those codes should map to some numeric value and no matter which resource I check out, I cannot find any such values. So confusing. The html page for LL357-5 even lists the values, so they must be found somewhere.

The second thing is that I thought the Questionnaire resource could somehow instruct/point to how the score could be calculated, and I don't really find any such hints. I know the algorithm, but is it not so that a system should be able to receive this Questionnaire, render it, accept values and produce a QuestionnaireResponse containing a score from some kind of referenced algorithm? How does the FHIR Resources say how one actually computes this score?


Solution

  • To convey the values, use the http://hl7.org/fhir/StructureDefinition/ordinalValue extension. It can appear both CodeSystem and ValueSet concepts and also on Questionnaire options.

    Handling embedding calculations is more sophisticated than the base Questionnaire resource is set up for. (FHIR resources, in general, only try to represent functionality that most systems that support Questionnaires know how to do, and the lowest common denominator for Questionnaires in healthcare is relatively low.) However, there's an implementation guide called Structured Data Capture (SDC) that describes a bunch of advanced behavior. Doing calculations is covered in the advanced behavior section. There's an example that shows how everything fits together here.