Re: [Dhis2-devs] [Dhis2-users] Generating sequential numbers in program rule
Dear Knut Thank you - I will update as soon as possible with some of my recommendations. Kind regards, Terence Terence Scott Global Alliance for Rabies Control (GARC) Pan-African Rabies Control Network (PARACON) Steering Committee terence.sc...@rabiesalliance.org https://paracon.rabiesalliance.org Skype: tpscott1987 On Thu, Nov 1, 2018 at 12:14 PM Knut Staring wrote: > Hi Terence, great to see it worked out. > > Just plugging the collaborative nature of the documentation effort as well > ;-) > https://docs.dhis2.org/master/en/implementer/html/doc_guide_chapter.html# > > On Thu, Nov 1, 2018 at 9:24 AM Terence Scott < > terence.sc...@rabiesalliance.org> wrote: > >> Dear Shurajit >> >> Thanks for the advice. This worked fantastically - however, the >> documentation is a little confusing with regards to the required format. Is >> there somewhere where I can possibly make suggestions for clarification? >> >> The string that eventually worked under the Auto-generate section is as >> follows: >> CURRENT_DATE(-MM)-"-"-ORG_UNIT_CODE(...)-"-"-SEQUENTIAL() >> >> The '+' did not work for me and gave a parse error - this is what is >> specified in some parts of the documentation, whereas using the '-' worked >> (as is shown in one example under "SEQUENTIAL(format)". >> >> It seems that currently only CURRENT_DATE is supported and not enrollment >> date? Is there some way to include Enrollment date instead? I tried to >> simply include ENROLLMENT_DATE(-MM) and this did not work. >> >> Thank you once again for the help! Really appreciate it as I have been >> struggling with this for a while. >> >> Kind regards, >> Terence >> >> Terence Scott >> >> Global Alliance for Rabies Control (GARC) >> Pan-African Rabies Control Network (PARACON) Steering Committee >> terence.sc...@rabiesalliance.org >> https://paracon.rabiesalliance.org >> Skype: tpscott1987 >> >> >> >> On Thu, Nov 1, 2018 at 3:46 AM Shurajit Dutta >> wrote: >> >>> Hi Terence >>> >>> This textpattern applies to generating unique tracked entity attributes. >>> So if you make the attribute unique and then system generated you can enter >>> the pattern accordingly: >>> >>> [image: image.png] >>> >>> On Wed, Oct 31, 2018 at 5:58 PM Terence Scott < >>> terence.sc...@rabiesalliance.org> wrote: >>> Hi MSP Thank you for the suggestion. I have also attempted this and was unable to have any success. I tried to create a new rule with simply having "Sequential(###)" alone, and did not have any success either. Therefore, I assumed that there would be some sort of additional text that is required to make it work. Kind regards, Terence Terence Scott Global Alliance for Rabies Control (GARC) Pan-African Rabies Control Network (PARACON) Steering Committee terence.sc...@rabiesalliance.org https://paracon.rabiesalliance.org Skype: tpscott1987 On Tue, Oct 30, 2018 at 5:49 PM M.Selvaraaj Prabu wrote: > Hi Terrance, > > Sometime back I read about this. I think you need to use the > expression like > >- > >ORG_UNIT_CODE(…) + "-" + CURRENT_DATE(ww) + "-" + SEQUENTIAL(#) > > > Instead of using the function concatenate. Please refer the below link > for more details: > >- > > https://docs.dhis2.org/master/en/user/html/working-with-textpattern.html > > Hope this helps. > > Thanks and regards > > MSP > > > On Tue, Oct 30, 2018 at 4:56 PM Terence Scott < > terence.sc...@rabiesalliance.org> wrote: > >> Dear Zubair, Nick >> >> I have upgraded the instance to 2.30 now and am attempting to once >> again implement the sequential numbering using the TextPattern option. I >> am >> using it on a TEAttribute, but have not had any success. >> >> Thus far, my Defined program rule action looks as follows: >> >> d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-') >> >> This is currently working and generating the UID, but of course, >> without the sequential numbers. I have attempted the following >> combinations >> to try include the sequential numbers to no avail: >> d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', >> SEQUENTIAL(###)) >> d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', >> Sequential(###)) >> d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', >> V{Sequential(###)}) >> d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', >> V{sequential(###)}) >> d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', >> V{sequential###}) >> d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', >> 'SEQUENTIAL(###)') - this one simply added the text in (as suspected). >> d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-') + >>
Re: [Dhis2-devs] [Dhis2-users] Generating sequential numbers in program rule
Hi Terence, great to see it worked out. Just plugging the collaborative nature of the documentation effort as well ;-) https://docs.dhis2.org/master/en/implementer/html/doc_guide_chapter.html# On Thu, Nov 1, 2018 at 9:24 AM Terence Scott < terence.sc...@rabiesalliance.org> wrote: > Dear Shurajit > > Thanks for the advice. This worked fantastically - however, the > documentation is a little confusing with regards to the required format. Is > there somewhere where I can possibly make suggestions for clarification? > > The string that eventually worked under the Auto-generate section is as > follows: > CURRENT_DATE(-MM)-"-"-ORG_UNIT_CODE(...)-"-"-SEQUENTIAL() > > The '+' did not work for me and gave a parse error - this is what is > specified in some parts of the documentation, whereas using the '-' worked > (as is shown in one example under "SEQUENTIAL(format)". > > It seems that currently only CURRENT_DATE is supported and not enrollment > date? Is there some way to include Enrollment date instead? I tried to > simply include ENROLLMENT_DATE(-MM) and this did not work. > > Thank you once again for the help! Really appreciate it as I have been > struggling with this for a while. > > Kind regards, > Terence > > Terence Scott > > Global Alliance for Rabies Control (GARC) > Pan-African Rabies Control Network (PARACON) Steering Committee > terence.sc...@rabiesalliance.org > https://paracon.rabiesalliance.org > Skype: tpscott1987 > > > > On Thu, Nov 1, 2018 at 3:46 AM Shurajit Dutta > wrote: > >> Hi Terence >> >> This textpattern applies to generating unique tracked entity attributes. >> So if you make the attribute unique and then system generated you can enter >> the pattern accordingly: >> >> [image: image.png] >> >> On Wed, Oct 31, 2018 at 5:58 PM Terence Scott < >> terence.sc...@rabiesalliance.org> wrote: >> >>> Hi MSP >>> >>> Thank you for the suggestion. I have also attempted this and was unable >>> to have any success. I tried to create a new rule with simply having >>> "Sequential(###)" alone, and did not have any success either. Therefore, I >>> assumed that there would be some sort of additional text that is required >>> to make it work. >>> >>> Kind regards, >>> Terence >>> >>> Terence Scott >>> >>> Global Alliance for Rabies Control (GARC) >>> Pan-African Rabies Control Network (PARACON) Steering Committee >>> terence.sc...@rabiesalliance.org >>> https://paracon.rabiesalliance.org >>> Skype: tpscott1987 >>> >>> >>> >>> On Tue, Oct 30, 2018 at 5:49 PM M.Selvaraaj Prabu >>> wrote: >>> Hi Terrance, Sometime back I read about this. I think you need to use the expression like - ORG_UNIT_CODE(…) + "-" + CURRENT_DATE(ww) + "-" + SEQUENTIAL(#) Instead of using the function concatenate. Please refer the below link for more details: - https://docs.dhis2.org/master/en/user/html/working-with-textpattern.html Hope this helps. Thanks and regards MSP On Tue, Oct 30, 2018 at 4:56 PM Terence Scott < terence.sc...@rabiesalliance.org> wrote: > Dear Zubair, Nick > > I have upgraded the instance to 2.30 now and am attempting to once > again implement the sequential numbering using the TextPattern option. I > am > using it on a TEAttribute, but have not had any success. > > Thus far, my Defined program rule action looks as follows: > > d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-') > > This is currently working and generating the UID, but of course, > without the sequential numbers. I have attempted the following > combinations > to try include the sequential numbers to no avail: > d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', > SEQUENTIAL(###)) > d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', > Sequential(###)) > d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', > V{Sequential(###)}) > d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', > V{sequential(###)}) > d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', > V{sequential###}) > d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-', > 'SEQUENTIAL(###)') - this one simply added the text in (as suspected). > d2:concatenate( V{enrollment_date}, '-', V{orgunit_code}, '-') + > SEQUENTIAL(###) > > None of these combinations have worked thus far. Clearly I am > misunderstanding something or missing something and would appreciate any > help. > > Kind regards, > Terence > > > Terence Scott > > Global Alliance for Rabies Control (GARC) > Pan-African Rabies Control Network (PARACON) Steering Committee > terence.sc...@rabiesalliance.org > https://paracon.rabiesalliance.org > Skype: tpscott1987 > > > > On Wed, Oct 10, 2018
Re: [Dhis2-devs] [Dhis2-users] Generating sequential numbers in program rule
Hi Terence Please have a look at textpattern to generate UID's: https://docs.dhis2.org/2.29/en/user/html/working-with-textpattern.html This is available as of 2.29 and believe it should be able to generate what you need. Nick On Wed, Oct 10, 2018 at 4:55 PM Terence Scott < terence.sc...@rabiesalliance.org> wrote: > Dear All > > I am creating a program rule to develop a UID for the patient. I have > currently created a program rule using d2:concatenate to bring various > attributes and DEs together into the Unique ID (such as date and OrgUnit > code). However, I would also like to include sequential numbering after > this to ensure that more than 1 case can be registered on a single day. > > I have looked through all of the documentation and am unable to find > anything along these lines. Is it possible? > > Example: > 2018-10-10-OrgUnit code-1; > 2018-10-10-OrgUnit code-2; > 2018-10-10-OrgUnit code-3; etc. (where 1,2 and 3 are the sequential > numbers generated). > > I have also looked at Program Rule variables and am unsure as to what the > "Calculated value" source type is, as in the documentation it is listed as > "TBA" with no further information. > > I would appreciate any help or advise. > > Kind regards, > Terence > > > > > Terence Scott > > Global Alliance for Rabies Control (GARC) > Pan-African Rabies Control Network (PARACON) Steering Committee > terence.sc...@rabiesalliance.org > https://paracon.rabiesalliance.org > Skype: tpscott1987 > > ___ > Mailing list: https://launchpad.net/~dhis2-users > Post to : dhis2-us...@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-users > More help : https://help.launchpad.net/ListHelp > -- Shurajit Dutta (MPH, MHI) Health Information Systems Adviser ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp