We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!

simple conditional display and single select

toskriptoskrip Posts: 279 ✭✭✭
Hallo everyone,
I found one rather strange behaviour with simple conditional display in
CRF. Lets say that I have one single select field in CRF and depending
on selected value in this field I would like to display another single
select CRF field (one from many).
When no data are entered it looks fine. When I select the first single
select CRF, the other field is displayed according to my need. However
when I change the value in a main single select it displays the other
appropriate single select, but it does not hide the one which was
displayed before.
Also when I try to save the CRF data it produces validation errors that
data are selected for single select CRF fields which should be hidden.
I think it is caused because the single select behaviour, which
automatically select first data item (does not allow - null value).
Can anybody share experience how to deal with this type of situations?
best
-- Tomas Skripcak IT scientist Deutsches Konsortium für Translationale Krebsforschung (DKTK) Deutsches Krebsforschungszentrum (DKFZ) Im Neuenheimer Feld 280 69120 Heidelberg Medizinische Fakultät und Universtitätsklinikum Carl Gustav Carus Dresden Technische Universität Dresden Klinik für Strahlentherapie Fetscherstraße 74 01307 Dresden Tel: +49 351 458 4146 Email: [email protected] Email: [email protected] Web: http://www.dkfz.de Web: http://www.uniklinikum-dresden.de/

Comments

  • Manoj SoniManoj Soni Posts: 163
    Hi
    Instead of Single Select, use radio.

    You wont get this issue.
    Hope this helps.
    Regards
    Manoj

    On Mon, Oct 14, 2013 at 3:43 PM, Skripcak, Tomas wrote:
    Hallo everyone,
    I found one rather strange behaviour with simple conditional display in
    CRF. Lets say that I have one single select field in CRF and depending
    on selected value in this field I would like to display another single
    select CRF field (one from many).
    When no data are entered it looks fine. When I select the first single
    select CRF, the other field is displayed according to my need. However
    when I change the value in a main single select it displays the other
    appropriate single select, but it does not hide the one which was
    displayed before.
    Also when I try to save the CRF data it produces validation errors that
    data are selected for single select CRF fields which should be hidden.
    I think it is caused because the single select behaviour, which
    automatically select first data item (does not allow - null value).
    Can anybody share experience how to deal with this type of situations?
    best
    --
    Tomas Skripcak
    IT scientist
    Deutsches Konsortium für Translationale Krebsforschung (DKTK)
    Deutsches Krebsforschungszentrum (DKFZ)
    Im Neuenheimer Feld 280
    69120 Heidelberg
    Medizinische Fakultät und Universtitätsklinikum Carl Gustav Carus Dresden
    Technische Universität Dresden
    Klinik für Strahlentherapie
    Fetscherstraße 74
    01307 Dresden
    Tel: +49 351 458 4146
    Email: [email protected]
    Email: [email protected]
    Web: http://www.dkfz.de
    Web: http://www.uniklinikum-dresden.de/
  • tdpurnattdpurnat Posts: 126
    I might not understand the situation properly: You have a main field that shows/hides a field base don one value. If main field is not equal to a value, then the dependent field must not be shown/have data?
    I think your problem is related to what happens when you change the value of the field that drives show/hide of the dependent field.
    Data that was initially entered into the dependent field (which was displayed conditionally) does not get invalidated/deleted because you changed the value in the field triggering hide/show. It might not be logical to have a value in that field anymore, but the change requires human action.
    The investigator must fix the problematic data in the dependent fields that are not relevant anymore. Validation helps to remind them.
    tina
    ----------
    Tina D Dannemann Purnat, M.Sc., PMP, CCDM
    Skype tdpurnat | Office +49 89 38 03 89 67 | http://www.linkedin.com/in/tinadpurnat
    Why are my emails so terse? emailcharter.org
    2013/10/14 Skripcak, Tomas
    Hallo everyone,
    I found one rather strange behaviour with simple conditional display in
    CRF. Lets say that I have one single select field in CRF and depending
    on selected value in this field I would like to display another single
    select CRF field (one from many).
    When no data are entered it looks fine. When I select the first single
    select CRF, the other field is displayed according to my need. However
    when I change the value in a main single select it displays the other
    appropriate single select, but it does not hide the one which was
    displayed before.
    Also when I try to save the CRF data it produces validation errors that
    data are selected for single select CRF fields which should be hidden.
    I think it is caused because the single select behaviour, which
    automatically select first data item (does not allow - null value).
    Can anybody share experience how to deal with this type of situations?
    best
    --
    Tomas Skripcak
    IT scientist
    Deutsches Konsortium für Translationale Krebsforschung (DKTK)
    Deutsches Krebsforschungszentrum (DKFZ)
    Im Neuenheimer Feld 280
    69120 Heidelberg
    Medizinische Fakultät und Universtitätsklinikum Carl Gustav Carus Dresden
    Technische Universität Dresden
    Klinik für Strahlentherapie
    Fetscherstraße 74
    01307 Dresden
    Tel: +49 351 458 4146
    Email: [email protected]
    Email: [email protected]
    Web: http://www.dkfz.de
    Web: http://www.uniklinikum-dresden.de/
  • toskriptoskrip Posts: 279 ✭✭✭
    To keep it simple I will make an example:
    I have a first field called tumour type, which is a single select from (Brain, Lungs, Prostata, Head and Neck, Other).
    Now I have 5 other fields (also single select) which are normally hidden. There is defined SIMPLE_CONDITIONAL_DISPLAY condition depending on the first tumour type field. Because I want to show only one of those 5 fields.
    Now when user select Lungs, in the first field. It shows second single select field (this works). The user select one value from the second field and try to save the CRF. It produces validation error on save and made all of those 5 fields visible.
    This is the behaviour of single select that it automatically selects the first value from the list (even if it is hidden). The way which Manoj recommend (using radio) will probably work because radio single select support non checked option, however the list of options can be quite big and I would prefer to display them in drop down list. Is there any other way how to go around this? Maybe defining visibility, hide XML rules will be better?
    best
    Tomas
    On 14.10.2013 12:47, Tina D Purnat wrote:
    I might not understand the situation properly: You have a main field that shows/hides a field base don one value. If main field is not equal to a value, then the dependent field must not be shown/have data?
    I think your problem is related to what happens when you change the value of the field that drives show/hide of the dependent field.
    Data that was initially entered into the dependent field (which was displayed conditionally) does not get invalidated/deleted because you changed the value in the field triggering hide/show. It might not be logical to have a value in that field anymore, but the change requires human action.
    The investigator must fix the problematic data in the dependent fields that are not relevant anymore. Validation helps to remind them.
    tina
    ----------
    Tina D Dannemann Purnat, M.Sc., PMP, CCDM
    Skype tdpurnat | Office +49 89 38 03 89 67 | http://www.linkedin.com/in/tinadpurnat
    Why are my emails so terse? emailcharter.org
    2013/10/14 Skripcak, Tomas >
    Hallo everyone,
    I found one rather strange behaviour with simple conditional display in
    CRF. Lets say that I have one single select field in CRF and depending
    on selected value in this field I would like to display another single
    select CRF field (one from many).
    When no data are entered it looks fine. When I select the first single
    select CRF, the other field is displayed according to my need. However
    when I change the value in a main single select it displays the other
    appropriate single select, but it does not hide the one which was
    displayed before.
    Also when I try to save the CRF data it produces validation errors that
    data are selected for single select CRF fields which should be hidden.
    I think it is caused because the single select behaviour, which
    automatically select first data item (does not allow - null value).
    Can anybody share experience how to deal with this type of situations?
    best
    --
    Tomas Skripcak
    IT scientist
    Deutsches Konsortium für Translationale Krebsforschung (DKTK)
    Deutsches Krebsforschungszentrum (DKFZ)
    Im Neuenheimer Feld 280
    69120 Heidelberg
    Medizinische Fakultät und Universtitätsklinikum Carl Gustav Carus Dresden
    Technische Universität Dresden
    Klinik für Strahlentherapie
    Fetscherstraße 74
    01307 Dresden
    Tel: +49 351 458 4146
    Email: [email protected]
    Email: [email protected]
    Web: http://www.dkfz.de
    Web: http://www.uniklinikum-dresden.de/
  • tdpurnattdpurnat Posts: 126
    Have you tried putting a null value as the first option on the list?
    Tina
    ----------
    Tina D Dannemann Purnat, M.Sc., PMP, CCDM
    Skype tdpurnat | Office +49 89 38 03 89 67 | http://www.linkedin.com/in/tinadpurnat
    Why are my emails so terse? emailcharter.org
    2013/10/14 Skripcak, Tomas
    To keep it simple I will make an example:
    I have a first field called tumour type, which is a single select from (Brain, Lungs, Prostata, Head and Neck, Other).
    Now I have 5 other fields (also single select) which are normally hidden. There is defined SIMPLE_CONDITIONAL_DISPLAY condition depending on the first tumour type field. Because I want to show only one of those 5 fields.
    Now when user select Lungs, in the first field. It shows second single select field (this works). The user select one value from the second field and try to save the CRF. It produces validation error on save and made all of those 5 fields visible.
    This is the behaviour of single select that it automatically selects the first value from the list (even if it is hidden). The way which Manoj recommend (using radio) will probably work because radio single select support non checked option, however the list of options can be quite big and I would prefer to display them in drop down list. Is there any other way how to go around this? Maybe defining visibility, hide XML rules will be better?
    best
    Tomas
    On 14.10.2013 12:47, Tina D Purnat wrote:
    I might not understand the situation properly: You have a main field that shows/hides a field base don one value. If main field is not equal to a value, then the dependent field must not be shown/have data?
    I think your problem is related to what happens when you change the value of the field that drives show/hide of the dependent field.
    Data that was initially entered into the dependent field (which was displayed conditionally) does not get invalidated/deleted because you changed the value in the field triggering hide/show. It might not be logical to have a value in that field anymore, but the change requires human action.
    The investigator must fix the problematic data in the dependent fields that are not relevant anymore. Validation helps to remind them.
    tina
    ----------
    Tina D Dannemann Purnat, M.Sc., PMP, CCDM
    Skype tdpurnat | Office +49 89 38 03 89 67 | http://www.linkedin.com/in/tinadpurnat
    Why are my emails so terse? emailcharter.org
    2013/10/14 Skripcak, Tomas >
    Hallo everyone,
    I found one rather strange behaviour with simple conditional display in
    CRF. Lets say that I have one single select field in CRF and depending
    on selected value in this field I would like to display another single
    select CRF field (one from many).
    When no data are entered it looks fine. When I select the first single
    select CRF, the other field is displayed according to my need. However
    when I change the value in a main single select it displays the other
    appropriate single select, but it does not hide the one which was
    displayed before.
    Also when I try to save the CRF data it produces validation errors that
    data are selected for single select CRF fields which should be hidden.
    I think it is caused because the single select behaviour, which
    automatically select first data item (does not allow - null value).
    Can anybody share experience how to deal with this type of situations?
    best
    --
    Tomas Skripcak
    IT scientist
    Deutsches Konsortium für Translationale Krebsforschung (DKTK)
    Deutsches Krebsforschungszentrum (DKFZ)
    Im Neuenheimer Feld 280
    69120 Heidelberg
    Medizinische Fakultät und Universtitätsklinikum Carl Gustav Carus Dresden
    Technische Universität Dresden
    Klinik für Strahlentherapie
    Fetscherstraße 74
    01307 Dresden
    Tel: +49 351 458 4146
    Email: [email protected]
    Email: [email protected]
    Web: http://www.dkfz.de
    Web: http://www.uniklinikum-dresden.de/
  • anneliesrotteanneliesrotte Posts: 11
    Hi Tomas
    Try to add an empty option at the start of a single select using a comma before the text of the first option:
    In the Cel under RESPONSE_OPTIONS_TEXT enter: , Brain, Lungs, Prostata, Head and Neck, Other
    In the Cel under RESPONSE_VALUES_OR_CALCULATIONS enter: , 1, 2, 3, 4, 5
    The benefit is you do not store a choice if the user did not make an explicit decision
    You can select an empty option if you change your mind.
    I recommend your single-select is of the type INT
    All items that are hiden need the same empty option, otherwise they try to store a choice. This may be the cause of your error messages.
    Hope this helps
    Annelies
  • tdpurnattdpurnat Posts: 126
    I agree with Annelies...
    This is what my pull downs look like:
    And I end up just using the "default value" (select one). It does not have a value, so it is considered blank if the user does not answer the question.
    It is important to give a choice to the user for not answering the question , especially in SCD.
    Examples of this are also in the CRF library in Open Clinica web site.
    Tina
    ----------
    Tina D Dannemann Purnat, M.Sc., PMP, CCDM
    Skype tdpurnat | Office +49 89 38 03 89 67 | http://www.linkedin.com/in/tinadpurnat
    Why are my emails so terse? emailcharter.org
    2013/10/14 Annelies Rotte
    Hi Tomas
    Try to add an empty option at the start of a single select using a comma before the text of the first option:
    In the Cel under RESPONSE_OPTIONS_TEXT enter: , Brain, Lungs, Prostata, Head and Neck, Other
    In the Cel under RESPONSE_VALUES_OR_CALCULATIONS enter: , 1, 2, 3, 4, 5
    The benefit is you do not store a choice if the user did not make an explicit decision
    You can select an empty option if you change your mind.
    I recommend your single-select is of the type INT
    All items that are hiden need the same empty option, otherwise they try to store a choice. This may be the cause of your error messages.
    Hope this helps
    Annelies
This discussion has been closed.