Thanks for doing this Darius - I found it via my normal means of searching the openmrs wiki - i used google :) I don't see any labels on the User-Defined Rules page...

On 08/10/2011 06:37 PM, Darius Jazayeri wrote:
Hi Evelyn,

I just added an example of how to write the Age rule on the User-Defined Rules <https://wiki.openmrs.org/x/doDP> wiki page.

-Darius

PS- Mike, Evelyn, could both of you please go to the wiki, and do the search that you'd naturally do to figure out "how do I write a logic rule"? Then, make sure the User-Defined Rules page I linked to has those search terms as labels. And make sure any other prominent hit has a link to the User-Defined Rules page?

On Tue, Aug 9, 2011 at 7:38 AM, Michael Seaton <[email protected] <mailto:[email protected]>> wrote:

    Hi Evelyn,

    I see you're right on the demo server.  That's unfortunate.  Looks
    like you can either wait until the ticket that James sent is fixed
    and use velocity, or you can author a new Age rule yourself using
    the "Rule Definitions" section of the UI.

    @Darius or Burke - do you have an example somewhere of either Java
    or Groovy code that you could share to show how to do this?  Can
    you update the Logic Module wiki pages with this if you are able
    to provide it?

    Thanks,
    Mike




    On 08/09/2011 10:14 AM, Evelyn Castle wrote:
    Hi Mike,

    We are running OMRS version 1.8.2 and Logic Module 0.5.

    When I look at the token's under admin>Logic Module>token
    registration, AGE is not an option. Do I need to add it somehow?

    I tired the code you sent. I am able to save the form without any
    errors but the questions are omitted from the form, regardless of
    the patients age.

    Thanks
    Evelyn

    On Tue, Aug 9, 2011 at 2:11 PM, Michael Seaton <[email protected]
    <mailto:[email protected]>> wrote:

        Hi Evelyn,

What version of OpenMRS and the Logic Module are you using? I know the AGE token was broken in some previous versions,
        but I thought that had been fixed.  You might want to see if
        upgrading Logic and/or OpenMRS helps.

        Alternatively, the includeIf tag supports velocity
        expressions as well.  It looks like the documentation needs
        to be expanded to include more on the possibilities available
        with velocity.  I don't have this installed to try it out
        currently, but try something like the following:

        <includeIf velocityTest="$patient.age < 16"/>

        Hopefully this works,
        Mike



        On 08/09/2011 06:36 AM, Evelyn Castle wrote:
        Hi All,

        I am trying to use the HTML Form Entry module to include
        certain questions in a form if the patient is a child (under
        16). I am trying to use the same logic that would be used if
        you were trying to include only female patients. (we have
        this working fine in other forms)

        |<||includeIf|
        |logicTest||=||"GENDER =
        F"||>|








        But, in

        the logic test "token registration", age is
        not an option,

        only "birthdate" and "birthdate estimate".
        So how can I

        use the logic module to determine age since
        if I used

        birthdate, I would need to change the date
        every year in

        order for it to continue to show kids under
        16.








        Anyone

        know how I can do this?








        Thanks
        Evelyn

















-- Evelyn Castle
        Co-Director, eHealth Nigeria
        +1 415 545 8289 <tel:%2B1%20415%20545%208289> (US)
        website: http://www.eHealthNigeria.org
        blog: http://www.evelyncastle.com
        skype: evelynlcastle
        ------------------------------------------------------------------------
        Click here to unsubscribe
        <mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l>
        from OpenMRS Implementers' mailing list
        ------------------------------------------------------------------------
        Click here to unsubscribe
        <mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l>
        from OpenMRS Implementers' mailing list




-- Evelyn Castle
    Co-Director, eHealth Nigeria
    +1 415 545 8289 <tel:%2B1%20415%20545%208289> (US)
    website: http://www.eHealthNigeria.org
    blog: http://www.evelyncastle.com
    skype: evelynlcastle
    ------------------------------------------------------------------------
    Click here to unsubscribe
    <mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l>
from OpenMRS Implementers' mailing list
    ------------------------------------------------------------------------
    Click here to unsubscribe
    <mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l>
    from OpenMRS Implementers' mailing list


------------------------------------------------------------------------
Click here to unsubscribe <mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l> from OpenMRS Implementers' mailing list

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-implement-l" in the  body 
(not the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l]

Reply via email to