Coder Social home page Coder Social logo

Comments (6)

plynchnlm avatar plynchnlm commented on June 1, 2024

Yes, although we just fixed a problem with enableWhen in 20.2.1. What version of LForms are you using? Can you attach a sample Questionnaire that demonstrates the problem?

from lforms.

yunwwang avatar yunwwang commented on June 1, 2024

I used the one demo app at https://lhcforms.nlm.nih.gov/lhcforms
Here is the questionnaire:
{ "resourceType": "Questionnaire", "id": "urn:hl7:davinci:crd:home-oxygen-questionnaire_2-r4", "meta": { "profile": [ "http://hl7.org/fhir/StructureDefinition/cqif-questionnaire", "http://hl7.org/fhir/us/davinci-dtr/StructureDefinition/dtr-questionnaire-r4" ] }, "title": "Home Oxygen Therapy", "status": "draft", "subjectType": [ "Patient" ], "date": "2019-12-06", "publisher": "Da Vinci DTR", "extension": [{ "url": "http://hl7.org/fhir/StructureDefinition/cqif-library", "valueReference": { "reference": "urn:hl7:davinci:crd:library-oxygen-therapy-prepopulate-r4" } }, { "url": "http://hl7.org/fhir/StructureDefinition/cqif-library", "valueReference": { "reference": "urn:hl7:davinci:crd:library-basic-patient-info-prepopulate-r4" } }, { "url": "http://hl7.org/fhir/StructureDefinition/cqif-library", "valueReference": { "reference": "urn:hl7:davinci:crd:library-basic-practitioner-info-prepopulate-r4" } } ], "contained": [{ "resourceType": "ValueSet", "id": "gender", "name": "Gender", "status": "draft", "description": "Gender", "compose": { "include": [{ "concept": [{ "code": "male", "display": "Male" }, { "code": "female", "display": "Female" }, { "code": "other", "display": "Other" } ] }] } }], "item": [{ "linkId": "1", "text": "Patient Information", "type": "group", "item": [{ "linkId": "1.1", "text": "Last Name but Different This Time", "type": "string", "required": true }, { "linkId": "1.2", "text": "First Name", "type": "string", "required": true }, { "linkId": "1.3", "text": "Middle Initial", "type": "string", "required": true }, { "linkId": "1.4", "text": "Date Of Birth", "type": "date", "required": true }, { "linkId": "1.5", "text": "Gender", "type": "choice", "required": true, "options": { "reference": "#gender" } }, { "linkId": "1.6", "text": "Medicare ID", "type": "string", "required": true } ] }, { "linkId": "2", "text": "Provider who is performing face-to-face evaluation", "type": "group", "item": [{ "linkId": "2.1", "text": "Last Name", "type": "string", "required": true }, { "linkId": "2.2", "text": "First Name", "type": "string", "required": true }, { "linkId": "2.3", "text": "Middle Initial", "type": "string", "required": true }, { "linkId": "2.4", "text": "NPI", "type": "string", "required": true }, { "linkId": "2.5", "text": "Date of Face-To-Face Evaluation", "type": "date", "required": true } ] }, { "linkId": "3", "text": "Coverage Requirements", "type": "group", "item": [{ "linkId": "3.1", "text": "Relevant Patient Diagnoses (conditions that might be expected to improve with oxygen therapy)", "type": "open-choice", "required": true, "repeats": true, "option": [{ "valueCoding": { "code": "COPD" } }, { "valueCoding": { "code": "Bronchiectasis" } }, { "valueCoding": { "code": "Hypoxemia" } }, { "valueCoding": { "code": "Diffuse interstitial lung disease" } }, { "valueCoding": { "code": "Cystic fibrosis" } }, { "valueCoding": { "code": "Pulmonary neoplasm" } }, { "valueCoding": { "code": "Erythrocytosis" } }, { "valueCoding": { "code": "Pulmonary hypertension" } }, { "valueCoding": { "code": "Recurring CHF d/t Cor Pulmonale" } } ] }, { "linkId": "3.2", "text": "Arterial oxygen saturation (Patient on room air while at rest and awake when tested)", "type": "quantity", "required": false }, { "linkId": "3.3", "text": "Arterial Partial Pressure of Oxygen (PO2) (Patient on room air while at rest and awake when tested)", "type": "quantity", "required": false }, { "linkId": "3.4", "text": "Arterial oxygen saturation (Patient tested during exercise)", "type": "quantity", "required": false }, { "linkId": "3.5", "text": "Arterial Partial Pressure of Oxygen (PO2) (Patient tested during exercise)", "type": "quantity", "required": false }, { "linkId": "3.6", "text": "Is there a documented improvement of hypoxemia during exercise with oxygen?", "type": "boolean", "required": false }, { "linkId": "3.7", "text": "Is the patient mobile within the home? ", "type": "boolean", "required": false, "enableWhen": [ { "question": "5.1b", "answerBoolean": true } ] }, { "linkId": "3.8", "text": "Does the patient have dependent edema due to congestive heart failure?", "type": "boolean", "required": false, "enableWhen": [ { "question": "3.2", "answerQuantity": { "value": 89, "unit": "%" } } ] } ] }, { "linkId": "4", "text": "Prescribed Use", "type": "group", "item": [{ "linkId": "4.1", "text": "Start date", "type": "date", "required": true }, { "linkId": "4.2", "text": "Length of need: (months) (99 = lifetime)", "type": "integer", "required": false }, { "linkId": "4.4", "text": "Peak Flow Rate", "type": "group", "item": [{ "linkId": "4.4.1", "text": "LPM", "type": "integer", "required": true }, { "linkId": "4.4.2", "text": "oxygen %", "type": "integer", "required": true } ] }, { "linkId": "4.4b", "text": "Since > 4 LPM prescribed, enter arterial oxygen saturation or PO2 while patient was on 4 LPM in stable state.", "type": "quantity", "required": true, "enableWhen": [ { "operator": ">", "question": "4.4.1", "answerInteger": 4 } ] }, { "linkId": "4.5", "text": "Average Flow Rate", "type": "group", "item": [{ "linkId": "4.5.1", "text": "LPM", "type": "integer", "required": true }, { "linkId": "4.5.2", "text": "oxygen %", "type": "integer", "required": true } ] }, { "linkId": "4.6", "text": "Frequency of use (choose all that apply)", "type": "open-choice", "required": true, "repeats": true, "option": [{ "valueCoding": { "code": "At rest and awake" } }, { "valueCoding": { "code": "During exertion" } }, { "valueCoding": { "code": "During sleep" } } ] } ] }, { "linkId": "5", "text": "Oxygen Supply Order Details", "type": "group", "item": [{ "linkId": "5.1", "text": "Current Order Description", "type": "string", "readOnly": true }, { "linkId": "5.1b", "text": "Current Order Is For A Portable Device", "type": "boolean", "readOnly": true }, { "linkId": "5.2", "text": "Type", "type": "choice", "required": true, "option": [{ "valueCoding": { "code": "Liquid" } }, { "valueCoding": { "code": "Compressed Gas" } }, { "valueCoding": { "code": "Concentrator" } } ] }, { "linkId": "5.3", "text": "Means of oxygen delivery and accessories", "type": "open-choice", "required": true, "repeats": true, "option": [{ "valueCoding": { "code": "Nasal cannula" } }, { "valueCoding": { "code": "Non-rebreather" } }, { "valueCoding": { "code": "Ventilator" } }, { "valueCoding": { "code": "Mask" } }, { "valueCoding": { "code": "PAP bleed in" } }, { "valueCoding": { "code": "Oxygen conserving device" } }, { "valueCoding": { "code": "High flow oxygen therapy" } } ] }, { "linkId": "5.4", "text": "Type of order", "type": "choice", "required": true, "option": [{ "valueCoding": { "code": "Initial or original order for certification" } }, { "valueCoding": { "code": "Change in status" } }, { "valueCoding": { "code": "Revision or change in equipment" } }, { "valueCoding": { "code": "Replacement" } } ] }, { "linkId": "5.5", "text": "Reason for Change in Status", "type": "open-choice", "required": true, "enableWhen": [ { "question": "5.4", "answerCoding": { "code": "Change in status" } } ], "option": [{ "valueCoding": { "code": "Patient relocated" } }, { "valueCoding": { "code": "Different supplier" } } ] } ] } ] }

from lforms.

plynchnlm avatar plynchnlm commented on June 1, 2024

It looks to me like the problem is that your enableWhen's are missing the operator field, which per the R4 spec, is required.

Also, if you fix that, then presently you would run into a bug in lforms which we have fixed but the fix is not yet in that demo system (which was updated around 2/26). The fix is present in our SDC app, at https://lhcforms.nlm.nih.gov/sdc, so I recommend you test your form there. The "upload" button at that app does not save the form to the FHIR server; it doesn't get saved unless you use the "save" menu. If you do save the form, please note that we reset that FHIR server weekly.

We are also at this moment fixing a bug with enableWhen.answerCoding, but I don't think that will affect your form since you have not specified a "system".

from lforms.

yunwwang avatar yunwwang commented on June 1, 2024

I created a new sample Questionnaire and tried to upload to https://lhncbc.github.io/lforms-fhir-app/. I noticed that it only works when the target item is dat the same group. For example, this works
{ "resourceType": "Questionnaire", "id": "2", "title": "Enable When Test", "status": "draft", "subjectType": [ "Patient" ], "date": "2019-12-06", "item": [ { "linkId": "1", "text": "First Item", "type": "group", "item": [ { "linkId": "1.1.1", "text": "checkbox 1", "type": "boolean" }, { "linkId": "1.2", "text": "Should enable when 1.1.1 is true", "type": "string", "enableWhen": [ { "question": "1.1.1", "operator": "=", "answerBoolean": true } ] } ] } ] }
but this does NOT (error: TypeError: Cannot read property '_skipLogicTargets' of null)
{ "resourceType": "Questionnaire", "id": "2", "title": "Enable When Test", "status": "draft", "subjectType": [ "Patient" ], "date": "2019-12-06", "item": [ { "linkId": "1", "text": "First Item", "type": "group", "item": [ { "linkId": "1.1", "text": "Checkbox Group", "type": "group", "item": [ { "linkId": "1.1.1", "text": "checkbox 1", "type": "boolean" }, { "linkId": "1.1.2", "text": "checkbox 2", "type": "boolean" } ] }, { "linkId": "1.2", "text": "Should enable when 1.1.1 is true", "type": "string", "enableWhen": [ { "question": "1.1.1", "operator": "=", "answerBoolean": true } ] } ] } ] }

from lforms.

plynchnlm avatar plynchnlm commented on June 1, 2024

In our implementation, the "question" linkID can be in the same group, one of the answer groups, or the immediate children of one of the ancestors. (In other words, siblings of ancestors, but not children of siblings of ancestors.) I think this was done to optimize the search and to avoid problems with repeating groups. Does that limitation cause a problem for what you need to do?

from lforms.

yunwwang avatar yunwwang commented on June 1, 2024

I have maybe one or two falling in that category. I will see if I can re group them.

from lforms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.