I want to add some columns as email, is_active and e.t.c. What is good way to do it? I need new rest with these parameters. I found two classes that do it. User and wrapper UserAndPassword1_8. How i can extend User? I wiil extend User or create new wrapper?
Have you considered storing them as user properties and hence avoid touching the data model? http://resources.openmrs.org/doc/org/openmrs/web/user/UserProperties.html
No, I don’t know about this way. What I can do it with this ? Can i send these properties by rest?
Yes as you can see in the Model Example Value here: https://qa-refapp.openmrs.org/openmrs/module/webservices/rest/apiDocs.htm#!/user/createUser
and i can get its only as map {“staring”, “string”}?
How did you want to get it?
I want to get its as ‘username’ or ‘date_changed’ field. For example:
{ “uuid”: “8cae7911-7698-11e7-97d5-000c2921acb8”, “display”: “admin”, “username”: “”, “systemId”: “admin”, “email” : "lala@google.com ", “is_active”:1
}
I do not seem to understand what you exactly want.
I want rest api to return json, which contains parameters that I need not in user properties map and in attributes. For example, I want add email attribute to User. You suggest me use UserProperties table. Then I get email attribute inside userproperty. { “uuid”: “8cae7911-7698-11e7-97d5-000c2921acb8”, “display”: “admin”, “userProperties”:{ “email” : "lala@google.com "}
} But i want like this: { “uuid”: “8cae7911-7698-11e7-97d5-000c2921acb8”, “display”: “admin”, “email” : "lala@google.com " }
That would require changing the existing code. Is there any special reason why you do not want it under user properties?
I use json parsing programm that was written by another proggrammer. It is easier for him if i return json like I wrote above. And you do not advise so to do?
I would advise you to make the parsing take care of user properties.
Thank you!