-
Notifications
You must be signed in to change notification settings - Fork 56
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
LHC Form Builder and answer data type Boolean (Yes/No) #12
Comments
Thanks for raising this issue. We just took a look, and the skip logic seems to work if you require the source field boolean to be true, but not if you require it to be false. Is that the problem you were seeing? If you could provide the definition of a small form that demonstrates the problem you see, that would be helpful. |
Thank you for responding. Yes. I think that the way that you described the issue is more accurate than my description.
I have attached an example, exported in all 3 formats for your convenience.
Question 3800-2 should only be shown if Question 3800-1 is false
Question 3800-3 should only be shown if Question 3800-3 is true (this piece is working)
Question 3800-4 should only be shown if Question 3800-4 is true (this piece is working)
Question 3800-5 should only be shown if {Question 3800-1 is false AND Question 3800-3 is false}
I just observed that the skipLogic triggers in LHC Forms might also have the potential for confusion or misinterpretation of null and false.
"skipLogic": {
"action": "show",
"logic": "ALL",
"conditions": [
{
"source": "[3800-1]",
"trigger": {
"value": false
}
},
{
"source": "[3800-3]",
"trigger": {
"value": null
}
}
]
}
Diane Rodden
MSIS candidate 2019
School of Information and Library Science
University of North Carolina at Chapel Hill
mail to: [email protected]<http://mail%20to:%[email protected]>
…________________________________
From: plynchnlm <[email protected]>
Sent: Thursday, July 25, 2019 4:36 PM
To: lhncbc/lforms <[email protected]>
Cc: Rodden, Diane Judith <[email protected]>; Author <[email protected]>
Subject: Re: [lhncbc/lforms] LHC Form Builder and answer data type Boolean (Yes/No) (#12)
Thanks for raising this issue. We just took a look, and the skip logic seems to work if you require the source field boolean to be true, but not if you require it to be false. Is that the problem you were seeing? If you could provide the definition of a small form that demonstrates the problem you see, that would be helpful.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#12>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AMWYACAWGYBBNUFNYAI5MBDQBIFENANCNFSM4IG5FYTA>.
|
I'm not seeing the attachment. It looks like GitHub supports only a limited number of file types. You might need to rename the .json files as .txt (changing the file extension). Alternatively, you could copy & paste the content into the comment. Just the LHC-Forms format is enough. |
Attached LH Forms Definition as txt.
Content is also pasted below since it is short:
{
"name": "TestingBooleanForm",
"items": [
{
"question": "Will compensation be provided to the study participants?",
"questionCodeSystem": "Custom",
"questionCode": "[3800-1]",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "1"
},
"dataType": "BL"
},
{
"question": "What benefits, if any, will be achieved by the study participants?",
"questionCodeSystem": "Custom",
"questionCode": "[3800-2]",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "*"
},
"dataType": "CWE",
"answers": [
{
"text": "None",
"code": "Possible improvement of their medical condition",
"label": "Possible cure of their medical condition",
"score": null,
"other": "Please describe"
}
],
"skipLogic": {
"action": "show",
"logic": "ANY",
"conditions": [
{
"source": "[3800-1]",
"trigger": {
"value": null
}
}
]
}
},
{
"question": "Will compensation be hourly?",
"questionCodeSystem": "Custom",
"questionCode": "[3800-3]",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "1"
},
"dataType": "BL",
"skipLogic": {
"action": "show",
"logic": "ANY",
"conditions": [
{
"source": "[3800-1]",
"trigger": {
"value": true
}
}
]
}
},
{
"question": "Please enter the hourly compensation rate in local currency",
"questionCodeSystem": "Custom",
"questionCode": "[3800-4]",
"codingInstructions": "Use USD for US studies, use CAD for Canadian studies, etc.",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "1"
},
"dataType": "REAL",
"skipLogic": {
"action": "show",
"logic": "ANY",
"conditions": [
{
"source": "[3800-3]",
"trigger": {
"value": true
}
}
]
}
},
{
"question": "Will compensation be at a daily flat rate?",
"questionCodeSystem": "Custom",
"questionCode": "[3800-5]",
"codingInstructions": "For example, $100 USD for each day of participation",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "1"
},
"dataType": "BL",
"skipLogic": {
"action": "show",
"logic": "ALL",
"conditions": [
{
"source": "[3800-1]",
"trigger": {
"value": false
}
},
{
"source": "[3800-3]",
"trigger": {
"value": null
}
}
]
}
}
]
}
Diane Rodden
MSIS candidate 2019
School of Information and Library Science
University of North Carolina at Chapel Hill
mail to: [email protected]<http://mail%20to:%[email protected]>
…________________________________
From: plynchnlm <[email protected]>
Sent: Friday, July 26, 2019 11:14 AM
To: lhncbc/lforms <[email protected]>
Cc: Rodden, Diane Judith <[email protected]>; Author <[email protected]>
Subject: Re: [lhncbc/lforms] LHC Form Builder and answer data type Boolean (Yes/No) (#12)
I'm not seeing the attachment. It looks like GitHub supports only a limited number of file types. You might need to rename the .json files as .txt (changing the file extension). Alternatively, you could copy & paste the content into the comment. Just the LHC-Forms format is enough.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#12>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AMWYACG6KQG5IPXGSEMPEMDQBMIE7ANCNFSM4IG5FYTA>.
{
"name": "TestingBooleanForm",
"items": [
{
"question": "Will compensation be provided to the study participants?",
"questionCodeSystem": "Custom",
"questionCode": "[3800-1]",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "1"
},
"dataType": "BL"
},
{
"question": "What benefits, if any, will be achieved by the study participants?",
"questionCodeSystem": "Custom",
"questionCode": "[3800-2]",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "*"
},
"dataType": "CWE",
"answers": [
{
"text": "None",
"code": "Possible improvement of their medical condition",
"label": "Possible cure of their medical condition",
"score": null,
"other": "Please describe"
}
],
"skipLogic": {
"action": "show",
"logic": "ANY",
"conditions": [
{
"source": "[3800-1]",
"trigger": {
"value": null
}
}
]
}
},
{
"question": "Will compensation be hourly?",
"questionCodeSystem": "Custom",
"questionCode": "[3800-3]",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "1"
},
"dataType": "BL",
"skipLogic": {
"action": "show",
"logic": "ANY",
"conditions": [
{
"source": "[3800-1]",
"trigger": {
"value": true
}
}
]
}
},
{
"question": "Please enter the hourly compensation rate in local currency",
"questionCodeSystem": "Custom",
"questionCode": "[3800-4]",
"codingInstructions": "Use USD for US studies, use CAD for Canadian studies, etc.",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "1"
},
"dataType": "REAL",
"skipLogic": {
"action": "show",
"logic": "ANY",
"conditions": [
{
"source": "[3800-3]",
"trigger": {
"value": true
}
}
]
}
},
{
"question": "Will compensation be at a daily flat rate?",
"questionCodeSystem": "Custom",
"questionCode": "[3800-5]",
"codingInstructions": "For example, $100 USD for each day of participation",
"questionCardinality": {
"min": "1",
"max": "1"
},
"header": false,
"editable": "1",
"answerCardinality": {
"min": "1",
"max": "1"
},
"dataType": "BL",
"skipLogic": {
"action": "show",
"logic": "ALL",
"conditions": [
{
"source": "[3800-1]",
"trigger": {
"value": false
}
},
{
"source": "[3800-3]",
"trigger": {
"value": null
}
}
]
}
}
]
}
|
Thanks for the example. Incidentally, you can add a second skip logic condition for "Will compensation be hourly" so that it will hide again if "Will compensation be provided to the study participants?" is changed back to false. (Just change the logic from "ANY" to "ALL") |
The reported issue, that {value: false} does not work as a skipLogic trigger, is fixed (and probably has been for some time-- sorry for not updating this issue). The above LForms form definition also contains another issue, that it uses {value: null} in some places, and that is not supported and causes exceptions to be thrown. Instead, the supported syntax is {exists: false}. |
https://lhcformbuilder.nlm.nih.gov/ LHC Form Builder doesn't seem to support conditional show logic when the Source Field Answer Data Type is Boolean (Yes/No). We had to use a time-consuming workaround of changing all of the Answer Data Types (for Source Fields of Conditional Questions) to List with no exceptions (CNE) in order to get the conditional show logic to work. Will conditional show logic when the Source Field Answer Data Type is Boolean (Yes/No) functionality be added soon?
The text was updated successfully, but these errors were encountered: