Protect a field in a grid group

Dear all,
I'm looking for a way to protect a field in a grid group.

After the automatically population of the field using the insert-action, I would like to protect the filed from changes.

A rule is not enough because it is possible change the value creating a discrepancy, so I need something different.

In the wiki oc page, crf section, 'How to calculate the age in a CRF' link,
the field used for the age calculation is protected from changes after calculation.
I'm wondering if it is possible do the same thing for a field in a grid group.

Many thanks in advance
Alfonso

Comments

  • alfopcliossalfopclioss Posts: 37
    Dear all,
    I'm looking for a way to protect a field in a grid group.

    After the automatically population of the field using the insert-action, I would like to protect the filed from changes.

    A rule is not enough because it is possible change the value creating a discrepancy, so I need something different.

    In the wiki oc page, crf section, 'How to calculate the age in a CRF' link,
    the field used for the age calculation is protected from changes after calculation.
    I'm wondering if it is possible do the same thing for a field in a grid group.

    Many thanks in advance
    Alfonso
  • Hi Alfonso
    There are 2 ways I can think of, described below. If neither are quite right I'd change focus from QA by design to QC via a report, or extract analysis, or checking the audit logs.
    * Decoding
    gridField1: your insertaction destination field - hidden, not required so you don't get RFC blocks in ADE
    gridField2: calculation field, with func: decode(field1,1,field1,field1)
    Value gets inserted to gridField1, then gridField2 has a decode function that displays the value of gridField1. Main downside is that you have to save a couple of times, to get the value inserted then run the decode calculation.
    * Disabling
    Use jquery styling (as described in the oc wiki) to turn on the disabled property of gridField1, that is, change to , such that the value can't be edited via the OC interface. Doesn't require an extra save, however a particularly cluey user could decide to open up firebug, temporarily enable the field it and submit a new value. This is more or less how the age calculation script 'protects' the calculated field, with the following line:
    fieldAge.attr('disabled', 'disabled');
    Although you might need to borrow the way that the 'Long Lists' script finds the right grid input to manipulate.
    * Horribly overcomplicated bonus option
    You could try having a 2nd not-required CRF in the same event which is the same, except for the names etc. Insert a copy of whatever you're inserting into both CRFs, and then add rules to check that the values in the corresponding fields are the same on both CRFs, such that you could pick up on any changes to the field you don't want to be changed. The exact arrangement of insertactions and rules would depend on your workflow.
    Best regards,
    Lindsay
    Sent: Friday, 22 March 2013 8:15 PM
    To: developers@openclinica.org; users@openclinica.org
    Subject: [Users] Protect a field in a grid group
    Dear all,
    I'm looking for a way to protect a field in a grid group.

    After the automatically population of the field using the insert-action, I would like to protect the filed from changes.

    A rule is not enough because it is possible change the value creating a discrepancy, so I need something different.

    In the wiki oc page, crf section, 'How to calculate the age in a CRF' link,
    the field used for the age calculation is protected from changes after calculation.
    I'm wondering if it is possible do the same thing for a field in a grid group.

    Many thanks in advance
    Alfonso
    This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal
    IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. The CTC is not responsible for any unauthorised alterations to this e-mail or attachment to it. Views expressed in this message are those of the individual sender, and are not necessarily the views of the CTC. If you receive this e-mail in error, please immediately delete it and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient.
  • adridderadridder Posts: 38
    Hi,
    About the jQuery solution: you may want to use attr("readonly", true); instead of the disabled attribute, otherwise I think you'll have problems when you try to save the data. The age-calculation enables the field when pressing the save button, but that's more complicated with the repeating group. Readonly on the other hand should be fine.
    Cheers,
    Sander
    On 23 March 2013 13:59, Lindsay Stevens wrote:
    Hi Alfonso
    There are 2 ways I can think of, described below. If neither are quite right I'd change focus from QA by design to QC via a report, or extract analysis, or checking the audit logs.
    * Decoding
    gridField1: your insertaction destination field - hidden, not required so you don't get RFC blocks in ADE
    gridField2: calculation field, with func: decode(field1,1,field1,field1)
    Value gets inserted to gridField1, then gridField2 has a decode function that displays the value of gridField1. Main downside is that you have to save a couple of times, to get the value inserted then run the decode calculation.
    * Disabling
    Use jquery styling (as described in the oc wiki) to turn on the disabled property of gridField1, that is, change to , such that the value can't be edited via the OC interface. Doesn't require an extra save, however a particularly cluey user could decide to open up firebug, temporarily enable the field it and submit a new value. This is more or less how the age calculation script 'protects' the calculated field, with the following line:
    fieldAge.attr('disabled', 'disabled');
    Although you might need to borrow the way that the 'Long Lists' script finds the right grid input to manipulate.
    * Horribly overcomplicated bonus option
    You could try having a 2nd not-required CRF in the same event which is the same, except for the names etc. Insert a copy of whatever you're inserting into both CRFs, and then add rules to check that the values in the corresponding fields are the same on both CRFs, such that you could pick up on any changes to the field you don't want to be changed. The exact arrangement of insertactions and rules would depend on your workflow.
    Best regards,
    Lindsay
    Sent: Friday, 22 March 2013 8:15 PM
    To: developers@openclinica.org; users@openclinica.org
    Subject: [Users] Protect a field in a grid group
    Dear all,
    I'm looking for a way to protect a field in a grid group.

    After the automatically population of the field using the insert-action, I would like to protect the filed from changes.

    A rule is not enough because it is possible change the value creating a discrepancy, so I need something different.

    In the wiki oc page, crf section, 'How to calculate the age in a CRF' link,
    the field used for the age calculation is protected from changes after calculation.
    I'm wondering if it is possible do the same thing for a field in a grid group.

    Many thanks in advance
    Alfonso
    This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal
    IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. The CTC is not responsible for any unauthorised alterations to this e-mail or attachment to it. Views expressed in this message are those of the individual sender, and are not necessarily the views of the CTC. If you receive this e-mail in error, please immediately delete it and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient.
  • alfopcliossalfopclioss Posts: 37
    Hi Lindsay,
    many thanks for your suggestions. You gave me some opportunities to solve the problem.

    Thanks again.
    Alfonso.
    Sent: Saturday, March 23, 2013 13:59
    To: users@openclinica.org
    Subject: Re: [Users] Protect a field in a grid group
    Hi Alfonso
    There are 2 ways I can think of, described below. If neither are quite right I'd change focus from QA by design to QC via a report, or extract analysis, or checking the audit logs.
    * Decoding
    gridField1: your insertaction destination field - hidden, not required so you don't get RFC blocks in ADE
    gridField2: calculation field, with func: decode(field1,1,field1,field1)
    Value gets inserted to gridField1, then gridField2 has a decode function that displays the value of gridField1. Main downside is that you have to save a couple of times, to get the value inserted then run the decode calculation.
    * Disabling
    Use jquery styling (as described in the oc wiki) to turn on the disabled property of gridField1, that is, change to , such that the value can't be edited via the OC interface. Doesn't require an extra save, however a particularly cluey user could decide to open up firebug, temporarily enable the field it and submit a new value. This is more or less how the age calculation script 'protects' the calculated field, with the following line:
    fieldAge.attr('disabled', 'disabled');
    Although you might need to borrow the way that the 'Long Lists' script finds the right grid input to manipulate.
    * Horribly overcomplicated bonus option
    You could try having a 2nd not-required CRF in the same event which is the same, except for the names etc. Insert a copy of whatever you're inserting into both CRFs, and then add rules to check that the values in the corresponding fields are the same on both CRFs, such that you could pick up on any changes to the field you don't want to be changed. The exact arrangement of insertactions and rules would depend on your workflow.
    Best regards,
    Lindsay
    Sent: Friday, 22 March 2013 8:15 PM
    To: developers@openclinica.org; users@openclinica.org
    Subject: [Users] Protect a field in a grid group
    Dear all,
    I'm looking for a way to protect a field in a grid group.

    After the automatically population of the field using the insert-action, I would like to protect the filed from changes.

    A rule is not enough because it is possible change the value creating a discrepancy, so I need something different.

    In the wiki oc page, crf section, 'How to calculate the age in a CRF' link,
    the field used for the age calculation is protected from changes after calculation.
    I'm wondering if it is possible do the same thing for a field in a grid group.

    Many thanks in advance
    Alfonso
    This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal
    IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. The CTC is not responsible for any unauthorised alterations to this e-mail or attachment to it. Views expressed in this message are those of the individual sender, and are not necessarily the views of the CTC. If you receive this e-mail in error, please immediately delete it and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient.
  • alfopcliossalfopclioss Posts: 37
    Hi,
    That's correct. Many thanks Sander for the information.

    Alfonso.
    Sent: Monday, March 25, 2013 10:11
    To: users@openclinica.org
    Subject: Re: [Users] Protect a field in a grid group
    Hi,
    About the jQuery solution: you may want to use attr("readonly", true); instead of the disabled attribute, otherwise I think you'll have problems when you try to save the data. The age-calculation enables the field when pressing the save button, but that's more complicated with the repeating group. Readonly on the other hand should be fine.
    Cheers,
    Sander
    On 23 March 2013 13:59, Lindsay Stevens wrote:
    Hi Alfonso
    There are 2 ways I can think of, described below. If neither are quite right I'd change focus from QA by design to QC via a report, or extract analysis, or checking the audit logs.
    * Decoding
    gridField1: your insertaction destination field - hidden, not required so you don't get RFC blocks in ADE
    gridField2: calculation field, with func: decode(field1,1,field1,field1)
    Value gets inserted to gridField1, then gridField2 has a decode function that displays the value of gridField1. Main downside is that you have to save a couple of times, to get the value inserted then run the decode calculation.
    * Disabling
    Use jquery styling (as described in the oc wiki) to turn on the disabled property of gridField1, that is, change to , such that the value can't be edited via the OC interface. Doesn't require an extra save, however a particularly cluey user could decide to open up firebug, temporarily enable the field it and submit a new value. This is more or less how the age calculation script 'protects' the calculated field, with the following line:
    fieldAge.attr('disabled', 'disabled');
    Although you might need to borrow the way that the 'Long Lists' script finds the right grid input to manipulate.
    * Horribly overcomplicated bonus option
    You could try having a 2nd not-required CRF in the same event which is the same, except for the names etc. Insert a copy of whatever you're inserting into both CRFs, and then add rules to check that the values in the corresponding fields are the same on both CRFs, such that you could pick up on any changes to the field you don't want to be changed. The exact arrangement of insertactions and rules would depend on your workflow.
    Best regards,
    Lindsay
    Sent: Friday, 22 March 2013 8:15 PM
    To: developers@openclinica.org; users@openclinica.org
    Subject: [Users] Protect a field in a grid group
    Dear all,
    I'm looking for a way to protect a field in a grid group.

    After the automatically population of the field using the insert-action, I would like to protect the filed from changes.

    A rule is not enough because it is possible change the value creating a discrepancy, so I need something different.

    In the wiki oc page, crf section, 'How to calculate the age in a CRF' link,
    the field used for the age calculation is protected from changes after calculation.
    I'm wondering if it is possible do the same thing for a field in a grid group.

    Many thanks in advance
    Alfonso
    This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal
    IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. The CTC is not responsible for any unauthorised alterations to this e-mail or attachment to it. Views expressed in this message are those of the individual sender, and are not necessarily the views of the CTC. If you receive this e-mail in error, please immediately delete it and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient.
This discussion has been closed.