Re: [Dhis2-users] New Organization Units Import
Hi, Writing is not supported for /api/organisationUnits (sorry, that might not have been clear). Try and push the XML to /api/metaData -- Morten On Wed, Dec 12, 2012 at 11:25 AM, ChangJames jamesbjch...@hotmail.comwrote: Thank you all for the help. They were quite helpful. I have tried both database method and cURL Meta-data import. The database method was successful, using ‘nextval('hibernate_sequence')’ and restart of DHIS2 for UID auto populate. However, I am still struggling with cURL method. I have downloaded curl.exe and ran it (in Windows 7). I keep on getting ‘HTTP Status 405 – Request method ‘POST’ not supported’ error. Is there something I have to set on DHIS2 or on server for this? The command I used is – curl –d @test3.xml “http://107.—.—.—:8080/dhis/api/organizationUnits” –H “Content-Type:application/xml” –u ---/--- -v This is for adding a new OrganizationUnit. In this email, I have attached curl error output and test Meta-data xml files. I have tried variations of the curl commands (removing header parameters, etc) and variations of Meta-data xml file contents(adding/removing UID, ID, etc), but all gave me 405 error. If it is not about the DHIS2 setup issue, I was wondering if someone can provide me with any success case curl command and Meta-data xml file, so that I can use that was an example to follow. Thank you in advance for any help. *From:* Morten Olav Hansen morte...@gmail.com *Sent:* Wednesday, December 05, 2012 10:25 PM *To:* ChangJames jamesbjch...@hotmail.com *Cc:* dhis2-users dhis2-users@lists.launchpad.net *Subject:* Re: [Dhis2-users] New Organization Units Import That should be without any ou-levels -- Morten On Wed, Dec 5, 2012 at 4:24 PM, Morten Olav Hansen morte...@gmail.comwrote: Do you have a structure in the data your are importing, or is it a flat list with any ou-levels? I would personally use the DHIS 2 web-api to import the data. For examples, look at our documentation for meta-data import: http://dhis2.org/doc/snapshot/en/user/html/ch23s04.html So you would use something like: metaData organisationUnits organisationUnit /organisationUnit organisationUnit /organisationUnit organisationUnit /organisationUnit organisationUnit /organisationUnit /organisationUnits /metaData For examples of the meta-data, have a look at: http://apps.dhis2.org/demo/api http://apps.dhis2.org/demo/api/metaData.xml This can then be pushed into DHIS using your username/password, and a proper content-type (I would personally use cURL for this) -- Morten On Wed, Dec 5, 2012 at 4:20 PM, ChangJames jamesbjch...@hotmail.comwrote: Hi, Is there any easy way(/preferred way) to import Organization Units (New ones) on blank DHIS2 system? I have a list of organization units I like to add to the system, but like to know if there is an alternative to the individual manual add using DHIS UI. It seems there isn’t import function for this on DHIS, so I took a look at datatable for inserting straight to DB. But, the ‘OrganizationUnit’ table has ‘UID’ field. How do I generate that? One of my data ‘jII07NoHiO5’ does seem like normal Uniquie Identifier number format. And is this, adding rows straight to datatable, a OK way of mass importing the Organization Units on DHIS? ___ 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 ___ 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
Re: [Dhis2-users] New Organization Units Import
Yes that way does work. You can try a GET first on an instance, eg http://apps.dhis2.org/dev/api/metaData.xml?assumeTrue=falseorganisationUnits=true so you can check the required format. Bob On 12 December 2012 09:27, Morten Olav Hansen morte...@gmail.com wrote: Hi, Writing is not supported for /api/organisationUnits (sorry, that might not have been clear). Try and push the XML to /api/metaData -- Morten On Wed, Dec 12, 2012 at 11:25 AM, ChangJames jamesbjch...@hotmail.comwrote: Thank you all for the help. They were quite helpful. I have tried both database method and cURL Meta-data import. The database method was successful, using ‘nextval('hibernate_sequence')’ and restart of DHIS2 for UID auto populate. However, I am still struggling with cURL method. I have downloaded curl.exe and ran it (in Windows 7). I keep on getting ‘HTTP Status 405 – Request method ‘POST’ not supported’ error. Is there something I have to set on DHIS2 or on server for this? The command I used is – curl –d @test3.xml “http://107.—.—.—:8080/dhis/api/organizationUnits” –H “Content-Type:application/xml” –u ---/--- -v This is for adding a new OrganizationUnit. In this email, I have attached curl error output and test Meta-data xml files. I have tried variations of the curl commands (removing header parameters, etc) and variations of Meta-data xml file contents(adding/removing UID, ID, etc), but all gave me 405 error. If it is not about the DHIS2 setup issue, I was wondering if someone can provide me with any success case curl command and Meta-data xml file, so that I can use that was an example to follow. Thank you in advance for any help. *From:* Morten Olav Hansen morte...@gmail.com *Sent:* Wednesday, December 05, 2012 10:25 PM *To:* ChangJames jamesbjch...@hotmail.com *Cc:* dhis2-users dhis2-users@lists.launchpad.net *Subject:* Re: [Dhis2-users] New Organization Units Import That should be without any ou-levels -- Morten On Wed, Dec 5, 2012 at 4:24 PM, Morten Olav Hansen morte...@gmail.comwrote: Do you have a structure in the data your are importing, or is it a flat list with any ou-levels? I would personally use the DHIS 2 web-api to import the data. For examples, look at our documentation for meta-data import: http://dhis2.org/doc/snapshot/en/user/html/ch23s04.html So you would use something like: metaData organisationUnits organisationUnit /organisationUnit organisationUnit /organisationUnit organisationUnit /organisationUnit organisationUnit /organisationUnit /organisationUnits /metaData For examples of the meta-data, have a look at: http://apps.dhis2.org/demo/api http://apps.dhis2.org/demo/api/metaData.xml This can then be pushed into DHIS using your username/password, and a proper content-type (I would personally use cURL for this) -- Morten On Wed, Dec 5, 2012 at 4:20 PM, ChangJames jamesbjch...@hotmail.comwrote: Hi, Is there any easy way(/preferred way) to import Organization Units (New ones) on blank DHIS2 system? I have a list of organization units I like to add to the system, but like to know if there is an alternative to the individual manual add using DHIS UI. It seems there isn’t import function for this on DHIS, so I took a look at datatable for inserting straight to DB. But, the ‘OrganizationUnit’ table has ‘UID’ field. How do I generate that? One of my data ‘jII07NoHiO5’ does seem like normal Uniquie Identifier number format. And is this, adding rows straight to datatable, a OK way of mass importing the Organization Units on DHIS? ___ 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 ___ 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 ___ 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
[Dhis2-users] Issues aggregating patient data values
Hi all, I have two doubts while aggregating patient data values: 1- In the Query Builder, I want to use the Age at visit (days since birth) field (in the Program label - Program stage properties). I tried comparing the field with a number, but it didn't work. I tried other syntax but none passes the Test. 2- In Manual Person Aggregation at Individual Records label, the aggregation process returns several times the same information by org unit. I have checked this in the online demo application and it's the same (I have created the dataset Death summary). In my case, the same information is printed 30 times by org unit. The values can be saved, but the page is slow and unusable... Thank you, Victor ___ 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
Re: [Dhis2-users] Issues aggregating patient data values
Dear Victor, There is a bug with *Age at visit (days since birth)* formula. I fixed it for version 2.10. Please re-run your formulas with version 9108. For the second issue, but this bug didn't occur in my laptop. I cannot test your case on demo application online exactly because I didn't find out the* **Death summary* dataset for testing. Please send me the formula you created for this case and parameters which you selected in *Manual person aggregation* function, I will re-test it. . This is a formula example for* **Age at visit (days since birth) *to get the total number of children who visited *Birth Details* stage of *Child Health program* and had the age at visit as *1 week :* * [PS:1149293] AND [PC:DATE@executionDate#-DATE@birthDate#] = 7* * * Hope it's useful for you. Best regards Châu Thu Trân HISP Viet Nam Email: tran.hispviet...@gmail.com On Thu, Dec 13, 2012 at 12:05 AM, Victor Garcia vgarcia...@gmail.comwrote: Hi all, I have two doubts while aggregating patient data values: 1- In the Query Builder, I want to use the Age at visit (days since birth) field (in the Program label - Program stage properties). I tried comparing the field with a number, but it didn't work. I tried other syntax but none passes the Test. 2- In Manual Person Aggregation at Individual Records label, the aggregation process returns several times the same information by org unit. I have checked this in the online demo application and it's the same (I have created the dataset Death summary). In my case, the same information is printed 30 times by org unit. The values can be saved, but the page is slow and unusable... Thank you, Victor ___ 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 ___ 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