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

Right order to importing Questionniare+ValueSet? #406

Open
vadi2 opened this issue Dec 1, 2021 · 4 comments
Open

Right order to importing Questionniare+ValueSet? #406

vadi2 opened this issue Dec 1, 2021 · 4 comments

Comments

@vadi2
Copy link
Contributor

vadi2 commented Dec 1, 2021

I'm having difficulty getting structor to recognise my answer valuesets -

  1. I upload the questionnaire (can't upload valueset before this)
  2. Then the ValueSet
  3. Hit validate and observe that it does not know the choice answers
Screen.Recording.2021-12-01.at.9.58.08.AM.mov

What's the best approach here?

@mgunnerud
Copy link
Contributor

Unfortunately, neither structor, nor the form filler used for preview have support for referencing external ValueSets through the answerValueSet property. When using ValueSets, it is assumed that these are included in the Questionnaire as contained resources in the "contained" property (and referenced with a #, see the JSON example below).

You can see how this works if you change the ValueSet used in the first question to the one you uploaded:
image

If you hit validate again, there should not be any errors. When you look at the JSON, you can see that the ValueSet is contained in the Questionnaire:

{
  "resourceType": "Questionnaire",
  "id": "SACQComorbidities",
  "name": "SACQComorbidities",
  "status": "draft",
  "publisher": "ICHOM",
  "url": "https://connect.ichom.org/fhir/Questionnaire/SACQComorbidities",
  "contained": [
    {
      "resourceType": "ValueSet",
      "status": "active",
      "name": "SACQPatientComorbidityHistory",
      "id": "SACQ-patient-comorbidity-history",
      "title": "SACQ Patient's comorbidity history",
      "description": "Patient's documented history of comorbidities",
      "version": "0.0.1",
      "url": "https://connect.ichom.org/fhir/ValueSet/SACQ-patient-comorbidity-history",
      "compose": {
        "include": [
          {
            "system": "http://connect.ichom.org/fhir/CodeSystem/sacq-patient-comorbidity-history",
            "concept": [
              {
                "code": "no-other-diseases"
              },
              {
                "code": "cancer-within-5yrs"
              },
              {
                "code": "other-medical-problems"
              }
            ]
          },
          {
            "system": "http://snomed.info/sct",
            "concept": [
              {
                "code": "56265001",
                "display": "Heart disease (For example, angina, heart attack, or heart failure)"
              },
              {
                "code": "38341003",
                "display": "High blood pressure"
              },
              {
                "code": "19829001",
                "display": "Lung disease (For example,  asthma, chronic bronchitis, or emphysema)"
              },
              {
                "code": "73211009",
                "display": "Diabetes"
              },
              {
                "code": "429040005",
                "display": "Ulcer"
              },
              {
                "code": "90708001",
                "display": "Kidney disease"
              },
              {
                "code": "235856003",
                "display": "Liver disease"
              },
              {
                "code": "271737000",
                "display": "Anemia"
              },
              {
                "code": "35489007",
                "display": "Depression"
              },
              {
                "code": "396275006",
                "display": "Osteoarthritis"
              },
              {
                "code": "161891005",
                "display": "Back pain"
              },
              {
                "code": "69896004",
                "display": "Rheumatoid arthritis"
              }
            ]
          }
        ]
      }
    }
  ],
  "item": [
    {
      "linkId": "ComorbiditiesSACQ",
      "type": "choice",
      "text": "Have you been told by a doctor that you have any of the following?",
      "answerValueSet": "#SACQ-patient-comorbidity-history",
      "required": true,
      "repeats": true
    },
    {
      "linkId": "ComorbiditiesSACQ_HeartDiseaseFU1",
      "type": "boolean",
      "text": "Do you receive treatment for heart disease (For example, angina, heart failure, or heart attack)?",
      "enableWhen": [
        {
          "question": "ComorbiditiesSACQ",
          "operator": "=",
          "answerCoding": {
            "code": "56265001",
            "system": "http://snomed.info/sct"
          }
        }
      ]
    },
  ...
}

@vadi2
Copy link
Contributor Author

vadi2 commented Dec 2, 2021

Gotcha. That did fix the validation issues, but none of the following questions that are tagged with enableWhen are showing up when a particular option is selected?

@mgunnerud
Copy link
Contributor

Are you referring to that the enableWhen items are not shown when the questionnaire is previewed? I suspect the form filler component used in the preview still have the limitation that it expects ValueSets to have only one include.

@vadi2
Copy link
Contributor Author

vadi2 commented Dec 4, 2021

enableWhen items are not shown when the questionnaire is previewed?

Indeed.

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

No branches or pull requests

2 participants