[Dhis2-devs] Error When Creating User via Web API

2015-08-16 Thread Farai Mutero
Hi Guys

 I'm trying to create a user in DHIS2 via the Web API *providing a
predefined username and password*, I have prepared a test payload to test
against the DHIS2 Sierra Leone demo, but I'm not winning. I wonder if you
can assist. The payload contents is as follows (all UIDs in the payload are
from the Sierra Leone demo):

curl -X POST -d @user_registration_payload.json "
https://apps.dhis2.org/demo/api/users/"; -H "Content-Type:application/json"
-u admin:district -v

{
"name": "Farai_Mutero",
"displayName": "Farai Mutero",
"surname": "Mutero",
"firstName": "Farai",
"phoneNumber": "+27011022033",
"email":"fa...@hisp.org",
"employer": "HISP",
"userCredentials":
{

"name": "Farai_Mutero",
"password": "FaraiMutero1",
"userRoles": [ {
"id": "Ql6Gew7eaX6"
} ]
},
  "organisationUnits": [ {
"id": "ImspTQPwCqd"
  } ],
  "userGroups": [ {
"id": "Iqfwd3j2qe5"
  } ]
}

The response I get is as follows:

*   Trying 129.240.64.5...
* Connected to apps.dhis2.org (129.240.64.5) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Users\Farai
Mut\AppData\Local\Apps\cURL\bin\curl-ca-bundle.crt
  CApath: none
* TLSv1.2, TLS handshake, Client hello (1):
* TLSv1.2, TLS handshake, Server hello (2):
* TLSv1.2, TLS handshake, CERT (11):
* TLSv1.2, TLS handshake, Server finished (14):
* TLSv1.2, TLS handshake, Client key exchange (16):
* TLSv1.2, TLS change cipher, Client hello (1):
* TLSv1.2, TLS handshake, Finished (20):
* TLSv1.2, TLS change cipher, Client hello (1):
* TLSv1.2, TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / AES256-SHA256
* Server certificate:
*subject: serialNumber=KoK/SuBIjHQ/RNfXzQHywx35u9n186L/;
OU=GT73263644; OU=See www.rapidssl.com/resources/cps (c)14; OU=Do
main Control Validated - RapidSSL(R); CN=apps.dhis2.org
*start date: 2014-06-15 15:19:59 GMT
*expire date: 2017-06-18 07:45:20 GMT
*subjectAltName: apps.dhis2.org matched
*issuer: C=US; O=GeoTrust, Inc.; CN=RapidSSL CA
*SSL certificate verify ok.
* Server auth using Basic with user 'admin'
> POST /demo/api/users/ HTTP/1.1
> Authorization: Basic YWRtaW46ZGlzdHJpY3Q=
> User-Agent: curl/7.40.0
> Host: apps.dhis2.org
> Accept: */*
> Content-Type:application/json
> Content-Length: 420
>
* upload completely sent off: 420 out of 420 bytes
< HTTP/1.1 500 Internal Server Error
< Date: Wed, 12 Aug 2015 12:37:52 GMT
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< Set-Cookie: JSESSIONID=3133D6950BF0788C1C0B9CE701F7F005; Path=/demo/;
Secure; HttpOnly
< Content-Type: text/html;charset=utf-8
< Content-Language: en
< Vary: cookie
< Connection: close
< Transfer-Encoding: chunked
<
Apache Tomcat/7.0.63 - Error report HTTP Status 500 - Request processing
failed; nested exception is java.lang.NullPointerExcepti
ontype Exception
reportmessage Request processing failed; nested ex
ception is java.lang.NullPointerExceptiondescription
The server encountered an internal error that prevented
it from fulfilling this request.exception
org.springframework.web.util.NestedServletException: Request proc
essing failed; nested exception is java.lang.NullPointerException

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:979)

org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterC

Re: [Dhis2-devs] [Dhis2-users] Data Integrity Checks

2015-08-16 Thread constyekani
Hello, 

Can you go to Apps>Admin> SQL view and run : SELECT * from organisationunit 
where parentid is null

After you can go on PGadmin and run: Delete from organisationunit where uid= 
'x'

Sincerely

Guy Ekani
Moph Cameroon
,.

Aanyo  Melo AHIAGNO  a écrit :

Hello
Can you try, to do the something on the another browser ???
AHIAGNO Aanyo
HISP WA
0022890962285

_
Date: Sun, 16 Aug 2015 08:41:13 +0200
From: a...@hisp.org
To: larshe...@gmail.com
CC: dhis2-us...@lists.launchpad.net; dhis2-devs@lists.launchpad.net
Subject: Re: [Dhis2-users] Data Integrity Checks
Thanks Lars or your response.

Yes I did clear cache statistics as well as browser cache. How does the 
application determine orphaned organisationunits? Organisationunits without a 
parentid? Or a parentid that does not exist?

Regards

Ant

On 16 August 2015 at 07:20, Lars Helge Øverland  wrote:
Hi Ant, 

after doing SQL against a running DHIS 2 instance you might want to go to data 
admin > cache statistics > clear cache. This since the cache might become stale 
unknowingly as a result of direct SQL queries.

regards,

Lars

On Sat, Aug 15, 2015 at 12:05 PM, Ant Snyman  wrote:
Dear All,

DHIS2 vesrion 2.20 snapshot, build 19527

The data integrity checks showed some "orphaned" org units which should not 
have been on the system. 

So I wrote scripts to clean out the org units and checked all 37 tables that 
either reference organisationunitid or sourceid and cleaned out all those 
tables. I also checked the "reporttable_organisationunits" table and it was not 
necessary to renumber as the org units were never in that table (I checked 
before doing any deletes and by the way thanks Jason Pickering for the script 
you shared with Ferdie).

After that I cleared analytics, re-generated resource tables, cleared cache and 
cache statistics and re-ran integrity checksthose org unit uids are still 
appearing as "orphaned organisation units".

From which table(s) is the integrity check picking these org units up from? 

Thanks

Ant Snyman
Cell: 0824910449
Landline: 028 2713242

 
Health Information Systems Program - SA

This message and any attachments are subject to a disclaimer published at 
http://www.hisp.org/policies.html#comms_disclaimer.  Please read the disclaimer 
before opening any attachment or taking any other action in terms of this 
electronic transmission.  If you cannot access the disclaimer, kindly send an 
email to disclai...@hisp.org and a copy will be provided to you. By replying to 
this e-mail or opening any attachment you agree to be bound by the provisions 
of the disclaimer.

___
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


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org


-- 

Ant Snyman
Cell: 0824910449
Landline: 028 2713242

 
Health Information Systems Program - SA

This message and any attachments are subject to a disclaimer published at 
http://www.hisp.org/policies.html#comms_disclaimer.  Please read the disclaimer 
before opening any attachment or taking any other action in terms of this 
electronic transmission.  If you cannot access the disclaimer, kindly send an 
email to disclai...@hisp.org and a copy will be provided to you. By replying to 
this e-mail or opening any attachment you agree to be bound by the provisions 
of the disclaimer.

___ 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
 
___
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


Re: [Dhis2-devs] Pivot table data reporting

2015-08-16 Thread sumudu weerasinghe
Thanks Lars,

I tried in two ways but unable to gain my need ,

1.st  Method, it gives subdivision into gender , i need total of all gender
category, without .
[image: Inline image 2]


2 nd method , also unable to give solution , giving same result as above.

What i need is eg.
 1. no of plastic surgeries (Minor)--- not gender wise categorization


Can we get it through dhis2?

Regards
Sumudu













On Sat, Aug 15, 2015 at 4:19 PM, Lars Helge Øverland 
wrote:

> Hi Sumudu,
>
> yes there are two options:
>
> 1. You can go to the data items > data elements section, the for data
> elements you select "Details" instead of "Totals"
>
>
> [image: Inline image 1]
>
> 2. You can make sure your category is marked as a "Data dimension" in the
> maintenance (make sure to re-run analytics afterwards if you changed it).
>
> You can then use the category in your pivot (from the left side panel),
> select your items and place the dimension on the "rows" from the Layout
> dialog.
>
>
> regards,
>
> Lars
>
>
>
>
>
>
>
> On Sat, Aug 15, 2015 at 8:25 AM, sumudu weerasinghe 
> wrote:
>
>> Dear all,
>>
>> We are  using dhis2 , 2.18 for a hospital information system.
>> Data element for theater statistics developed by using category
>> combination of ,  Gender( M,F,Not define) and Type of surgery(Major, minor,
>> intermediate).
>>
>> I need to get report on total for each category   as follows,
>>
>>  eg.
>>
>>
>>
>> Major
>>
>> Intermediate
>>
>> Minor
>>
>> No of general surgeries
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> No of Plastic surgeries
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Is it possible to get such report in pivot table or any other reporting
>> within dhis2?
>>
>> Regards,
>>
>> Dr.Sumudu Weerasinghe
>> Medical officer Health informatics
>> Teaching hospital - Ragama
>> Srin Lanka
>>
>> ___
>> 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
>>
>>
>
>
> --
> Lars Helge Øverland
> Lead developer, DHIS 2
> University of Oslo
> Skype: larshelgeoverland
> http://www.dhis2.org 
>
>
___
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


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19770: minor bugfix, use ImportSummary for TEI POST when only 1 was imported

2015-08-16 Thread noreply

revno: 19770
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Mon 2015-08-17 09:46:35 +0700
message:
  minor bugfix, use ImportSummary for TEI POST when only 1 was imported
modified:
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/TrackedEntityInstanceController.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/TrackedEntityInstanceController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/TrackedEntityInstanceController.java	2015-07-15 15:49:39 +
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/TrackedEntityInstanceController.java	2015-08-17 02:46:35 +
@@ -32,6 +32,7 @@
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.OrganisationUnitSelectionMode;
+import org.hisp.dhis.common.cache.CacheStrategy;
 import org.hisp.dhis.dxf2.common.JacksonUtils;
 import org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstance;
 import org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstanceService;
@@ -52,7 +53,6 @@
 import org.hisp.dhis.webapi.service.ContextService;
 import org.hisp.dhis.webapi.service.WebMessageService;
 import org.hisp.dhis.webapi.utils.ContextUtils;
-import org.hisp.dhis.common.cache.CacheStrategy;
 import org.hisp.dhis.webapi.utils.WebMessageUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -382,7 +382,7 @@
 importSummary.setImportCount( null );
 }
 
-webMessageService.send( WebMessageUtils.importSummaries( importSummaries ), response, request );
+webMessageService.send( WebMessageUtils.importSummary( importSummary ), response, request );
 }
 }
 

___
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


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19771: use setAutoFields in OU constructor, needed to make getPath behave properly

2015-08-16 Thread noreply

revno: 19771
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Mon 2015-08-17 10:03:40 +0700
message:
  use setAutoFields in OU constructor, needed to make getPath behave properly
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2015-08-03 10:21:51 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2015-08-17 03:03:40 +
@@ -166,11 +166,12 @@
 
 public OrganisationUnit()
 {
-
+setAutoFields(); // to have getPath working properly, we need to set auto fields (for uid etc)
 }
 
 public OrganisationUnit( String name )
 {
+this();
 this.name = name;
 }
 

___
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