Hi Saptarshi,
If you can't create someone with just Age, that's a bug and you should file
a ticket.
Addresses should work the same as names, i.e. they should be creatable when
the person is created. If that's not supported, ticket that too.
I would expect attributes to work like:
attributes: [
{ attributeType: "uuid-of-civil-status", value: "uuid-of-Married-concept"
},
{ attributeType: "uuid-of-nationality", value: "Indian assuming
free-text" }
]
This is more in line with the way they are represented when you GET a
person, i.e. it's a list of attributes, not a list of map entries.
The notion is that the parent resource lists in its "creatable properties"
any sub-resources that can be created at its creation-time. Does our
documentation actually show sub-resources as part of the owning resources?
(It should, but I don't remember whether we coded this...)
-Darius
On Sat, May 5, 2012 at 4:31 AM, Saptarshi Purkayastha <[email protected]>wrote:
> I am trying to post the following to create a person...
>
> {
> "names": [{"givenName": "Test", "familyName": "Woman"}],
> "gender": "F",
> "age": 32,
> "birthdate": "1980-01-02",
> "birthdateEstimated": true,
> "dead": true,
> "deathDate": "2012-05-05",
> "causeOfDeath": "Cancer",
> "addresses": [{"preferred":true,"address1": "12 Hauz Khas Village",
> "address2": "Hauz Khas", "city": "New Delhi", "postalCode": "110011"}],
> "attributes": [{"8d871f2a-c2cc-11de-8d13-0010c6dffd0f":"Married",
> "8d871afc-c2cc-11de-8d13-0010c6dffd0f": "Indian"}]
> }
>
> There is some problem with the documentation here or probably a bug... So
> although *age* is a creatable property according to the documentation, I
> cannot create a person with age
> The names is nice because we do not have to call the personname resource
> and create a name. Though, I wonder why addresses can't be done in the same
> way.
>
> Attributes might be a little complex, but shouldn't they be done in a
> similar fashion... So, 8d871f2a-c2cc-11de-8d13-0010c6dffd0f is Civil
> Status (attribute type) and I'm trying to save the value of Married to
> create a new atttribute for that person.
>
> Is there a notion by which we can write/distinguish in the documentation
> as to what sub-resources can be created on the fly, while others need to be
> created separately and referenced??
>
> ---
> Regards,
> Saptarshi PURKAYASTHA
>
> My Tech Blog: http://sunnytalkstech.blogspot.com
> You Live by CHOICE, Not by CHANCE
> ------------------------------
> Click here to
> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from
> OpenMRS Developers' mailing list
_________________________________________
To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to
[email protected] with "SIGNOFF openmrs-devel-l" in the body (not
the subject) of your e-mail.
[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]