Menu

#419 Fields are not hidden by condition (layouts)

Development_Release
closed-accepted
None
5
2016-07-11
2016-03-28
No

Trying to add conditions to some fields in the LBF layout edit screen. The conditions are not being applied. We can see the javascript code that should apply the rules but is not being included in all the screens.

STR:
go to Administration-> Layouts
Click on the "?" at the end of any field line.
Add any rule.

Expected behaivior:
the field should be hidden/show according the rule
Actual behaivior:
-> nothing

Proposal Fix:
Use/fix the existing javascript (options.php.js)

Commit
https://github.com/matrix-israel/openemr/tree/20160328_ConditionalFields_SC

Discussion

  • Oleg Sverdlov

    Oleg Sverdlov - 2016-03-28
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,11 +1,18 @@
    -When trying to add conditions  to some fields in the layout edit. The conditions where not being applied. We can see the javascript code that should apply the rules but is not being included in all the screens.
    +Trying to add conditions  to some fields in the LBF layout edit screen. The conditions are not being applied. We can see the javascript code that should apply the rules but is not being included in all the screens.
    
    -Administration-> Layouts
    +STR:
    +go to Administration-> Layouts
     Click on the "?" at the end of any field line.
     Add any rule.
    
    -Expected behaivior the field should be hidden/show according the rule
    -Actual behaivior -> nothing
    +Expected behaivior:
    +the field should be hidden/show according the rule
    +Actual behaivior:
    +-> nothing
    
     Proposal Fix: 
     Use/fix the existing javascript (options.php.js) 
    +
    +Commit
    +https://github.com/matrix-israel/openemr/tree/20160328_ConditionalFields_SC
    +
    
     
  • Brady Miller

    Brady Miller - 2016-03-29

    Couple minor issues pointed out by myself and Rod on github( https://github.com/openemr/openemr/pull/106 ). After you address these, plan to bring this into the codebase. Please ensure your solution tests well with both the layouts and the LBF forms.
    -brady

     
  • Sharon Cohen

    Sharon Cohen - 2016-03-29

    @Brady Miller, i commited the fixes to the issues you pointed out. Can you tell me more details on what/how/where to do further tests (layouts and LBF forms?) Thanks

     
  • Oleg Sverdlov

    Oleg Sverdlov - 2016-03-29
    • status: open --> pending
    • assigned_to: Oleg Sverdlov
     
  • Brady Miller

    Brady Miller - 2016-03-30

    Hi Sharon,

    To test the layouts, just make some changes in the demographics and history layouts using this feature and then confirm it works on patients.

    To test the LBF, then just create a quick LBF form that also uses this feature to ensure it works on patients:
    http://www.open-emr.org/wiki/index.php/Sample_Layout_Based_Visit_Form

    -brady

     
  • Sharon Cohen

    Sharon Cohen - 2016-03-30

    Hi Brady, working like a charm :) thanks for the help!

     
  • Brady Miller

    Brady Miller - 2016-03-31

    Hi,

    Thanks for doing the testing.

    I just rebased your 4 commits into 1 and brought it into the codebase:
    https://github.com/openemr/openemr/commit/fa10ca51f83d66e3240a23fc3b74b63390abbacd

    For future code, recommend the following:

    1. Try to maintain whitespacing structure of the script you are working in (whether it be indentation or spacing; the codebase mostly uses spacing, so good idea to turn off auto-indentation in your browser).
    2. To keep code clear place space between things such as if (condition), rather than if(condition).
    3. To keep code clear, ensure space/indent code within conditional.

    thanks for the contribution,
    -brady

     
  • Brady Miller

    Brady Miller - 2016-03-31
    • status: pending --> closed-accepted
     
  • Oleg Sverdlov

    Oleg Sverdlov - 2016-07-11
    • Owner: Oleg Sverdlov --> Oleg Matrix
     

Log in to post a comment.

MongoDB Logo MongoDB