← Back to team overview

dhis2-devs team mailing list archive

Re: Changes to DHIS2 : Patient Tracker

 

As an example, you can send the attached json file to our demo server
(running 2.14)

curl -H "Content-Type: application/json" -X PUT -u admin:district -d
@p.json http://apps.dhis2.org/demo/api/persons/iHhCKKXHQv6.json

--
Morten


On Tue, Feb 25, 2014 at 9:11 AM, Morten Olav Hansen <mortenoh@xxxxxxxxx>wrote:

> Hi,
>
> I have made some small changes in rev 13791 which I hope can help (issues
> related to system identifier).
>
> I think what you should do, is this:
> 1) Enter Individual Records, and Find/Add Person
> 2) Create a new person on Sierra Leone (or whatever your test db uses)
> 3) Find the UID of the OU by using /api/organisationUnits/query/sierr (in
> my case)
> 4) Then go /api/persons.json?orgUnit=UID
> 5) On that list, you will find your newly created person
> 6) Now take the uid from the person, and go to /api/persons/UID.json
> 7) The format from the last query, you should be able to send back to the
> server.. e.g. by using cURL:
> curl -u username:password -H "Content-Type: application/json" -d
> @filename.json http://server/api/persons/UID
>
>
> --
> Morten
>
>
> On Mon, Feb 24, 2014 at 9:18 PM, Pierre Dane <pierre@xxxxxxxxx> wrote:
>
>> Hi Morten,
>>
>> Thanks for committing that code but it hasn’t solved the problem.
>>
>> I’ve built and released the new code and I’m getting the same error:
>> Message:
>> {
>>     "orgUnit": "C33j9neHDGt",
>>     "identifiers": [ {
>>         "type": "zEhQmZeoRN9",
>>         "value": "7373736543376"
>>     } ],
>>     "attributes": [ {
>>         "type": "uRGeJ84LKb5",
>>         "value": "pierretest"
>>     },{
>>         "type": "PGtWVaM3uXz",
>>         "value": "2010-02-02"
>>     },{
>>         "type": "T7pwpMdaVVa",
>>         "value": "1974-02-03"
>>     }
>>     ]
>> }
>>
>> 0000: 7B 22 73 74  61 74 75 73  22 3A 22 45  52 52 4F 52  |
>> {"status":"ERROR |
>> 0010: 22 2C 22 69  6D 70 6F 72  74 43 6F 75  6E 74 22 3A  |
>> ","importCount": |
>> 0020: 7B 22 69 6D  70 6F 72 74  65 64 22 3A  30 2C 22 75  |
>> {"imported":0,"u |
>> 0030: 70 64 61 74  65 64 22 3A  30 2C 22 69  67 6E 6F 72  |
>> pdated":0,"ignor |
>> 0040: 65 64 22 3A  31 2C 22 64  65 6C 65 74  65 64 22 3A  |
>> ed":1,"deleted": |
>> 0050: 30 7D 2C 22  63 6F 6E 66  6C 69 63 74  73 22 3A 5B  |
>> 0},"conflicts":[ |
>> 0060: 7B 22 6F 62  6A 65 63 74  22 3A 22 49  64 65 6E 74  |
>> {"object":"Ident |
>> 0070: 69 66 69 65  72 2E 74 79  70 65 22 2C  22 76 61 6C  |
>> ifier.type","val |
>> 0080: 75 65 22 3A  22 4D 69 73  73 69 6E 67  20 72 65 71  | ue":"Missing
>> req |
>> 0090: 75 69 72 65  64 20 69 64  65 6E 74 69  66 69 65 72  | uired
>> identifier |
>> 00A0: 20 74 79 70  65 20 7A 45  68 51 6D 5A  65 6F 52 4E  |  type
>> zEhQmZeoRN |
>> 00B0: 39 22 7D 2C  7B 22 6F 62  6A 65 63 74  22 3A 22 49  |
>> 9"},{"object":"I |
>> 00C0: 64 65 6E 74  69 66 69 65  72 2E 74 79  70 65 22 2C  |
>> dentifier.type", |
>> 00D0: 22 76 61 6C  75 65 22 3A  22 49 6E 76  61 6C 69 64  |
>> "value":"Invalid |
>> 00E0: 20 74 79 70  65 20 6E 75  6C 6C 22 7D  2C 7B 22 6F  |  type
>> null"},{"o |
>> 00F0: 62 6A 65 63  74 22 3A 22  41 74 74 72  69 62 75 74  |
>> bject":"Attribut |
>> 0100: 65 2E 74 79  70 65 22 2C  22 76 61 6C  75 65 22 3A  |
>> e.type","value": |
>> 0110: 22 4D 69 73  73 69 6E 67  20 72 65 71  75 69 72 65  | "Missing
>> require |
>> 0120: 64 20 61 74  74 72 69 62  75 74 65 20  74 79 70 65  | d attribute
>> type |
>> 0130: 20 54 37 70  77 70 4D 64  61 56 56 61  22 7D 2C 7B  |
>>  T7pwpMdaVVa"},{ |
>> 0140: 22 6F 62 6A  65 63 74 22  3A 22 41 74  74 72 69 62  |
>> "object":"Attrib |
>> 0150: 75 74 65 2E  74 79 70 65  22 2C 22 76  61 6C 75 65  |
>> ute.type","value |
>> 0160: 22 3A 22 4D  69 73 73 69  6E 67 20 72  65 71 75 69  | ":"Missing
>> requi |
>> 0170: 72 65 64 20  61 74 74 72  69 62 75 74  65 20 74 79  | red attribute
>> ty |
>> 0180: 70 65 20 50  47 74 57 56  61 4D 33 75  58 7A 22 7D  | pe
>> PGtWVaM3uXz"} |
>> 0190: 2C 7B 22 6F  62 6A 65 63  74 22 3A 22  41 74 74 72  |
>> ,{"object":"Attr |
>> 01A0: 69 62 75 74  65 2E 74 79  70 65 22 2C  22 76 61 6C  |
>> ibute.type","val |
>> 01B0: 75 65 22 3A  22 4D 69 73  73 69 6E 67  20 72 65 71  | ue":"Missing
>> req |
>> 01C0: 75 69 72 65  64 20 61 74  74 72 69 62  75 74 65 20  | uired
>> attribute  |
>> 01D0: 74 79 70 65  20 75 52 47  65 4A 38 34  4C 4B 62 35  | type
>> uRGeJ84LKb5 |
>> 01E0: 22 7D 2C 7B  22 6F 62 6A  65 63 74 22  3A 22 41 74  |
>> "},{"object":"At |
>> 01F0: 74 72 69 62  75 74 65 2E  74 79 70 65  22 2C 22 76  |
>> tribute.type","v |
>> 0200: 61 6C 75 65  22 3A 22 49  6E 76 61 6C  69 64 20 74  |
>> alue":"Invalid t |
>> 0210: 79 70 65 20  6E 75 6C 6C  22 7D 2C 7B  22 6F 62 6A  | ype
>> null"},{"obj |
>> 0220: 65 63 74 22  3A 22 41 74  74 72 69 62  75 74 65 2E  |
>> ect":"Attribute. |
>> 0230: 74 79 70 65  22 2C 22 76  61 6C 75 65  22 3A 22 49  |
>> type","value":"I |
>> 0240: 6E 76 61 6C  69 64 20 74  79 70 65 20  6E 75 6C 6C  | nvalid type
>> null |
>> 0250: 22 7D 2C 7B  22 6F 62 6A  65 63 74 22  3A 22 41 74  |
>> "},{"object":"At |
>> 0260: 74 72 69 62  75 74 65 2E  74 79 70 65  22 2C 22 76  |
>> tribute.type","v |
>> 0270: 61 6C 75 65  22 3A 22 49  6E 76 61 6C  69 64 20 74  |
>> alue":"Invalid t |
>> 0280: 79 70 65 20  6E 75 6C 6C  22 7D 5D 7D               | ype null"}]}
>>     |
>>
>>
>> *However!*
>>
>> When I make the identifiers and attributes non-mandatory i get the
>> following error message:
>> 0000: 7B 22 73 74  61 74 75 73  22 3A 22 45  52 52 4F 52  |
>> {"status":"ERROR |
>> 0010: 22 2C 22 69  6D 70 6F 72  74 43 6F 75  6E 74 22 3A  |
>> ","importCount": |
>> 0020: 7B 22 69 6D  70 6F 72 74  65 64 22 3A  30 2C 22 75  |
>> {"imported":0,"u |
>> 0030: 70 64 61 74  65 64 22 3A  30 2C 22 69  67 6E 6F 72  |
>> pdated":0,"ignor |
>> 0040: 65 64 22 3A  31 2C 22 64  65 6C 65 74  65 64 22 3A  |
>> ed":1,"deleted": |
>> 0050: 30 7D 2C 22  63 6F 6E 66  6C 69 63 74  73 22 3A 5B  |
>> 0},"conflicts":[ |
>> 0060: 7B 22 6F 62  6A 65 63 74  22 3A 22 49  64 65 6E 74  |
>> {"object":"Ident |
>> 0070: 69 66 69 65  72 2E 74 79  70 65 22 2C  22 76 61 6C  |
>> ifier.type","val |
>> 0080: 75 65 22 3A  22 49 6E 76  61 6C 69 64  20 74 79 70  | ue":"Invalid
>> typ |
>> 0090: 65 20 6E 75  6C 6C 22 7D  2C 7B 22 6F  62 6A 65 63  | e
>> null"},{"objec |
>> 00A0: 74 22 3A 22  41 74 74 72  69 62 75 74  65 2E 74 79  |
>> t":"Attribute.ty |
>> 00B0: 70 65 22 2C  22 76 61 6C  75 65 22 3A  22 49 6E 76  |
>> pe","value":"Inv |
>> 00C0: 61 6C 69 64  20 74 79 70  65 20 6E 75  6C 6C 22 7D  | alid type
>> null"} |
>> 00D0: 2C 7B 22 6F  62 6A 65 63  74 22 3A 22  41 74 74 72  |
>> ,{"object":"Attr |
>> 00E0: 69 62 75 74  65 2E 74 79  70 65 22 2C  22 76 61 6C  |
>> ibute.type","val |
>> 00F0: 75 65 22 3A  22 49 6E 76  61 6C 69 64  20 74 79 70  | ue":"Invalid
>> typ |
>> 0100: 65 20 6E 75  6C 6C 22 7D  2C 7B 22 6F  62 6A 65 63  | e
>> null"},{"objec |
>> 0110: 74 22 3A 22  41 74 74 72  69 62 75 74  65 2E 74 79  |
>> t":"Attribute.ty |
>> 0120: 70 65 22 2C  22 76 61 6C  75 65 22 3A  22 49 6E 76  |
>> pe","value":"Inv |
>> 0130: 61 6C 69 64  20 74 79 70  65 20 6E 75  6C 6C 22 7D  | alid type
>> null"} |
>> 0140: 5D 7D                                               | ]}
>>     |
>>
>> and here is what I see in the server log:
>> * INFO  2014-02-24 16:10:59,424 Login success for user: 'admin', ip:
>> '105.236.172.122' (DefaultUserAuditService.java [http-bio-8080-exec-3])
>> * INFO  2014-02-24 16:14:13,904 'admin' update
>> org.hisp.dhis.patient.PatientIdentifierType, name: NationalId, uid:
>> zEhQmZeoRN9 (AuditLogUtil.java [http-bio-8080-exec-2])
>> * INFO  2014-02-24 16:14:18,393 Login success for user: 'admin', ip:
>> '105.236.172.122' (DefaultUserAuditService.java [http-bio-8080-exec-10])
>> * INFO  2014-02-24 16:14:48,666 'admin' update
>> org.hisp.dhis.patient.PatientAttribute, name: DOB, uid: T7pwpMdaVVa
>> (AuditLogUtil.java [http-bio-8080-exec-2])
>> * INFO  2014-02-24 16:14:56,789 'admin' update
>> org.hisp.dhis.patient.PatientAttribute, name: DueDate, uid: PGtWVaM3uXz
>> (AuditLogUtil.java [http-bio-8080-exec-6])
>> * INFO  2014-02-24 16:15:02,793 'admin' update
>> org.hisp.dhis.patient.PatientAttribute, name: name, uid: uRGeJ84LKb5
>> (AuditLogUtil.java [http-bio-8080-exec-5])
>> * INFO  2014-02-24 16:15:08,022 Login success for user: 'admin', ip:
>> '105.236.172.122' (DefaultUserAuditService.java [http-bio-8080-exec-10])
>>
>>
>> Database:
>>  patientattributeid |     uid     | code |         created         |
>>   lastupdated       |  name   |  description  | valuetype | mandatory |
>> groupby | patientattributegroupid | inherit | expression |
>> displayonvisitschedule | sortorderinvisitschedule | displayinlistnoprogram
>> | patientmobilesettingid | sort_order_patientattributename | sort_order
>>
>> --------------------+-------------+------+-------------------------+-------------------------+---------+---------------+-----------+-----------+---------+-------------------------+---------+------------+------------------------+--------------------------+------------------------+------------------------+---------------------------------+------------
>>                  51 | T7pwpMdaVVa |      | 2014-02-19 12:48:19.397 |
>> 2014-02-19 13:16:29.982 | DOB     | Date of Birth | date      | t         |
>> f       |                      67 | f       |            | f
>>       |                          | f                      |
>>         |                                 |          1
>>                  58 | PGtWVaM3uXz |      | 2014-02-19 13:19:32.361 |
>> 2014-02-19 13:19:32.361 | DueDate | DueDate       | date      | t         |
>> f       |                      67 | t       |            | f
>>       |                          | f                      |
>>         |                                 |          2
>>                  76 | uRGeJ84LKb5 |      | 2014-02-20 12:20:57.464 |
>> 2014-02-20 12:20:57.464 | name    | name          | string    | t         |
>> f       |                         | f       |            | f
>>       |                          | f                      |
>>         |                                 |
>> (3 rows)
>>
>>  patientidentifierid |     uid     | code |         created         |
>>   lastupdated       | patientidentifiertypeid | patientid |
>> identifier
>>
>> ---------------------+-------------+------+-------------------------+-------------------------+-------------------------+-----------+------------------------
>>                   64 | wNaKiFhjrdt |      | 2014-02-19 13:36:18.351 |
>> 2014-02-19 13:36:18.351 |                      55 |        63 | 1234567
>>                   66 | u1nTxgr7AKk |      | 2014-02-19 13:36:38.701 |
>> 2014-02-19 13:36:38.701 |                      55 |        65 |
>> weofdhweiewewwewwwwewe
>>
>>  patientidentifiertypeid |     uid     | code |         created         |
>>       lastupdated       |    name    | description | mandatory | related |
>> nochars |  type  | orgunitscope | programscope | periodtypeid |
>> displayinlistnoprogram
>>
>> -------------------------+-------------+------+-------------------------+-------------------------+------------+-------------+-----------+---------+---------+--------+--------------+--------------+--------------+------------------------
>>                       55 | zEhQmZeoRN9 |      | 2014-02-19 12:50:22.243 |
>> 2014-02-19 12:50:22.243 | NationalId | National ID | t         | f       |
>>         | string | f            | f            |              | f
>> (1 row)
>>
>> Thanks
>>
>>
>> On 24 Feb 2014, at 1:41 PM, Pascal Brandt <pascal@xxxxxxxxx> wrote:
>>
>> Hi,
>>
>> At the moment we're testing rev 13788<http://bazaar.launchpad.net/~dhis2-devs-core/dhis2/2.14/revision/13788> to
>> make sure our use case works.
>>
>> Basically, all we need to be able to do is create a person via the API
>> and set values for some attributes that we will have created in the system
>> beforehand.
>>
>> This should be possible, right?
>>
>> We will provide some feedback after our test.
>>
>> Cheers,
>> Pascal
>>
>>
>>
>> On 24 February 2014 13:04, Morten Olav Hansen <mortenoh@xxxxxxxxx> wrote:
>>
>>> Is this regarding the update of persons, or is it related to something
>>> else?
>>>
>>> --
>>> Morten
>>>
>>>
>>> On Mon, Feb 24, 2014 at 5:02 PM, Pascal Brandt <pascal@xxxxxxxxx> wrote:
>>>
>>>> Hi,
>>>>
>>>> Does rev 13788<http://bazaar.launchpad.net/~dhis2-devs-core/dhis2/2.14/revision/13788> still
>>>> not give us what we need? What's the current limitation?
>>>>
>>>> Let's start the discussion here and see if anyone on the dev list has a
>>>> similar requirement.
>>>>
>>>> Cheers,
>>>> Pascal
>>>>
>>>>
>>>>
>>>> On 24 February 2014 11:57, Pierre Dane <pierre@xxxxxxxxx> wrote:
>>>>
>>>>> Hi Lars,
>>>>>
>>>>> Would it be possible to have a chat about the current state of the
>>>>> patient tracker API and data model so that we can get an idea of how much
>>>>> work would be involved to get the functionality we need for the Maternal
>>>>> Health Initiative (National Pregnancy Register) released. Ferdi said I
>>>>> should get in touch with you regarding any java development work that
>>>>> needed doing. If it’s looking like it’s going to take more than a week or
>>>>> so of your time then we may have to fall back to using just the dataset api
>>>>> to record indicators.
>>>>>
>>>>> Please let me know if you have a gap for a Skype/telephone call.
>>>>>
>>>>> Many thanks and kind regards,
>>>>>
>>>>> Pierre Dane.
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Pascal Brandt Senio*
>>>>
>>>> *r Software Developer, Jembi Health Systems | SOUTH AFRICA Mobile: +27
>>>> 84 827 9342 <%2B27%2084%20827%209342> | Office: +27 21 701 0939
>>>> <%2B27%2021%20701%200939> | Skype: psbrandt E-mail: pascal@xxxxxxxxx
>>>> <pascal@xxxxxxxxx>*
>>>>
>>>
>>>
>>
>>
>> --
>>
>> *Pascal BrandtSenio*
>>
>> *r Software Developer, Jembi Health Systems | SOUTH AFRICA Mobile: +27 84
>> 827 9342 <%2B27%2084%20827%209342> | Office: +27 21 701 0939
>> <%2B27%2021%20701%200939> | Skype: psbrandt E-mail: pascal@xxxxxxxxx
>> <pascal@xxxxxxxxx>*
>>
>>
>>
>

Attachment: p.json
Description: application/json


References