Hi Nada,
there is a variable that you can use to get the orgunit code in program rules, 
but not the orgunit name. 

The variable is addressed with V{orgunit_code}. For tracker programs this will 
be the enrolling orgunit, while for single event programs this will be the 
event orgunit.

See table 19.14: 19.5.6. Reference information: Operators and functions to use 
in program rule expression 
<https://docs.dhis2.org/master/en/user/html/dhis2_user_manual_en_full.html#program_rules_operators_functions>

Markus

> 2. jan. 2018 kl. 17.46 skrev Pamod Amarakoon <pam...@gmail.com>:
> 
> Hi Nada,
> 
> Just wondering whether you are using the standard data entry form or a custom 
> form. I'm not really sure whether there is a function to display selected org 
> unit name. This is possible using javascript if you are using a custom form 
> though.
> 
> On Tue, Jan 2, 2018 at 12:04 AM, Nada Ghosn <esumoh...@gmail.com 
> <mailto:esumoh...@gmail.com>> wrote:
> Good evening,
> Thank you again for your prompt reply.
> I shall test the new program again.
> 
> I will be thankful if you can assist me in the following query:
> how to create a data element to retain the name of the orgunit.
> 
> Sincerely
> Nada
> 
> 
> On Mon, Jan 1, 2018 at 9:15 PM, Pamod Amarakoon <pam...@gmail.com 
> <mailto:pam...@gmail.com>> wrote:
> Hi Nada,
> 
> It should come automatically if you already have a data element for the age 
> field and if you have applied a rule to assign the value of the expression 
> above to the data element.
> 
> On Mon, Jan 1, 2018 at 11:17 PM, Nada Ghosn <esumoh...@gmail.com 
> <mailto:esumoh...@gmail.com>> wrote:
> Good evening,
> Thank you for your prompt reply.
> I did the expression and it works.
> However, i have to click on the field (year) to get the value.
> I will be thankful if you can advise on how to get the value automatically 
> without having to click in the target field (year)
> Sincerely
> NG
> 
> 
> On Mon, Jan 1, 2018 at 8:19 PM, Pamod Amarakoon <pam...@gmail.com 
> <mailto:pam...@gmail.com>> wrote:
> Hi Nada,
> 
> Best wishes for 2018 !
> 
> Regarding your query I assume the problem you are facing with is how to 
> obtain the year from the event date. Considering the date format you can get 
> the string value of the year by obtaining the first 4 digits from the left 
> side of the value for the event date. So I suggest you use the following 
> function.
> 
> d2:left(V{event_date}, 4)
> 
> Hope this helps.
> 
> On Mon, Jan 1, 2018 at 9:35 PM, Nada Ghosn <esumoh...@gmail.com 
> <mailto:esumoh...@gmail.com>> wrote:
> Hello,
> Best wishes for 2018.
> 
> I am trying to do the following in an event-capture program:
> - capture the year of the event date (report date) and assign it to a
> program rule variable.
> 
> I will be thankful if you can assist me.
> Sincerely
> NG
> 
> -- 
> Nada Ghosn, MD
> Head, Epidemiology Surveillance Program (Esumoh)
> Ministry of Public Health
> Beirut, Museum square
> Lebanon
> Tel +961.1.614194 <tel:+961%201%20614%20194>
> Fax +961.1.610920 <tel:+961%201%20610%20920>
> Email esumoh...@gmail.com <mailto:esumoh...@gmail.com>, esu...@moph.gov.lb 
> <mailto:esu...@moph.gov.lb>
> Website www.moph.gov.lb <http://www.moph.gov.lb/>
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users 
> <https://launchpad.net/~dhis2-users>
> Post to     : dhis2-users@lists.launchpad.net 
> <mailto:dhis2-users@lists.launchpad.net>
> Unsubscribe : https://launchpad.net/~dhis2-users 
> <https://launchpad.net/~dhis2-users>
> More help   : https://help.launchpad.net/ListHelp 
> <https://help.launchpad.net/ListHelp>
> 
> 
> 
> 
> -- 
> Regards,
> Dr. Pamod Amarakoon
> MBBS (SL)
> MSc (Biomedical Informatics), EMSc (Health Admin), PGCert (MedEd), CEH
> Medical Officer in Health Informatics
> Nutrition Coordination Division
> Ministry of Health, Nutrition and Indigenous Medicine,
> Sri Lanka
> 
> Confidentiality Notice: the information contained in this email and any 
> attachments may be legally privileged and confidential. If you are not an 
> intended recipient, you are hereby notified that any dissemination, 
> distribution, or copying of this e-mail is strictly prohibited. If you have 
> received this e-mail in error, please notify the sender and permanently 
> delete the e-mail and any attachments immediately. You should not retain, 
> copy or use this e-mail or any attachments for any purpose, nor disclose all 
> or any part of the contents to any other person.
> 
> 
> 
> 
> 
> 
> -- 
> Nada Ghosn, MD
> Head, Epidemiology Surveillance Program (Esumoh)
> Ministry of Public Health
> Beirut, Museum square
> Lebanon
> Tel +961.1.614194 <tel:+961%201%20614%20194>
> Fax +961.1.610920 <tel:+961%201%20610%20920>
> Email esumoh...@gmail.com <mailto:esumoh...@gmail.com>, esu...@moph.gov.lb 
> <mailto:esu...@moph.gov.lb>
> Website www.moph.gov.lb <http://www.moph.gov.lb/>
> 
> 
> 
> 
> -- 
> Regards,
> Dr. Pamod Amarakoon
> MBBS (SL)
> MSc (Biomedical Informatics), EMSc (Health Admin), PGCert (MedEd), CEH
> Medical Officer in Health Informatics
> Nutrition Coordination Division
> Ministry of Health, Nutrition and Indigenous Medicine,
> Sri Lanka
> 
> Confidentiality Notice: the information contained in this email and any 
> attachments may be legally privileged and confidential. If you are not an 
> intended recipient, you are hereby notified that any dissemination, 
> distribution, or copying of this e-mail is strictly prohibited. If you have 
> received this e-mail in error, please notify the sender and permanently 
> delete the e-mail and any attachments immediately. You should not retain, 
> copy or use this e-mail or any attachments for any purpose, nor disclose all 
> or any part of the contents to any other person.
> 
> 
> 
> 
> 
> 
> -- 
> Nada Ghosn, MD
> Head, Epidemiology Surveillance Program (Esumoh)
> Ministry of Public Health
> Beirut, Museum square
> Lebanon
> Tel +961.1.614194 <tel:+961%201%20614%20194>
> Fax +961.1.610920 <tel:+961%201%20610%20920>
> Email esumoh...@gmail.com <mailto:esumoh...@gmail.com>, esu...@moph.gov.lb 
> <mailto:esu...@moph.gov.lb>
> Website www.moph.gov.lb <http://www.moph.gov.lb/>
> 
> 
> 
> 
> -- 
> Regards,
> Dr. Pamod Amarakoon
> MBBS (SL)
> MSc (Biomedical Informatics), EMSc (Health Admin), PGCert (MedEd), CEH
> Medical Officer in Health Informatics
> Nutrition Coordination Division
> Ministry of Health, Nutrition and Indigenous Medicine,
> Sri Lanka
> 
> Confidentiality Notice: the information contained in this email and any 
> attachments may be legally privileged and confidential. If you are not an 
> intended recipient, you are hereby notified that any dissemination, 
> distribution, or copying of this e-mail is strictly prohibited. If you have 
> received this e-mail in error, please notify the sender and permanently 
> delete the e-mail and any attachments immediately. You should not retain, 
> copy or use this e-mail or any attachments for any purpose, nor disclose all 
> or any part of the contents to any other person.
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users 
> <https://launchpad.net/~dhis2-users>
> Post to     : dhis2-users@lists.launchpad.net 
> <mailto:dhis2-users@lists.launchpad.net>
> Unsubscribe : https://launchpad.net/~dhis2-users 
> <https://launchpad.net/~dhis2-users>
> More help   : https://help.launchpad.net/ListHelp 
> <https://help.launchpad.net/ListHelp>
_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to