nmrs-nigeria / datamigration

0 stars 1 forks source link

Rest API response #3

Open multiplechuks opened 5 years ago

multiplechuks commented 5 years ago

@dkayiwa , We are trying to respond a meaninful response back from the REST API but we are not able to format the response to what we want. Is there any way this can be done? Thanks

dkayiwa commented 5 years ago

What exact response do you want to return?

multiplechuks commented 5 years ago

We would like to return the object that was sent and a status object too, the status object lets the users know if it is successful or not

dkayiwa commented 5 years ago

Why not just return the status?

multiplechuks commented 5 years ago

Okay. how do I do that?

multiplechuks commented 5 years ago

Can we call on skype?, we kind of have a tight timeline. The recent code is in git, This is a sample json that I send to the api { "preferred":"True", "prefix":"MR", "hospitalNo":"KP-10-001", "givenName":"Temiye", "middleName":"Oluseun", "familyName":"K", "birthDate":"21/03/1986", "gender":"M", "facility": { "facilityName":"Facilty One", "datimCode":"edtdyfdws", "lga":"Abuja", "state":"FCT" }, "address":{ "country": "Nigeria", "latitude": "9.0820", "longitude": "8.6753", "address1": "Nitel Junction", "address2": "Barcelona Hotels", "address3": "Abuja", "cityVillage": "Wuse II", "stateProvince": "FCT-Abuja", "postalCode": "23409g" }, "identifiers": [ { "identifier": "KP-10-001", "identifierType": "2", "locationId": "1", "preferred": "true" }, { "identifier": "KP-10-001", "identifierType": "4", "locationId": "1", "preferred": "false" } ], "encounters" : { "encounterId": 6, "encounterLocationId":6, "encounterDate":"28/3/2018", "formTypeId":4, "obs": [{ "conceptId": 628, "valueTypeId":"valueTypeId", "value":9 }] } }

multiplechuks commented 5 years ago

Hi @dkayiwa am still waiting for this. thanks

dkayiwa commented 5 years ago

Yes we can have a call on Skype. When are you available?

multiplechuks commented 5 years ago

Tuesday 9:00am Nigerian time. Does this work for you?

wonderfulguru1 commented 5 years ago

Yea it does.

Thank you.

On Sun, Sep 8, 2019 at 6:49 PM Johnbosco notifications@github.com wrote:

Tuesday 9:00am Nigerian time. Does this work for you?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nmrs-nigeria/datamigration/issues/3?email_source=notifications&email_token=ABT75U3XTVW5ZUSCEGNHIJTQIU3JVA5CNFSM4IS4HZF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6FVSRQ#issuecomment-529226054, or mute the thread https://github.com/notifications/unsubscribe-auth/ABT75U4OUP7OFAAS65QOHWLQIU3JVANCNFSM4IS4HZFQ .

multiplechuks commented 5 years ago

@dkayiwa It is better you give us a time for this Skype call so we can work with it. Regards

dkayiwa commented 5 years ago

@JohnboscoJbTech is now a good time for you guys?

multiplechuks commented 5 years ago

Yes my Skype id is multiplechuks, name Ezekwe Johnbosco

dkayiwa commented 5 years ago

Calling you now on Skype.

multiplechuks commented 5 years ago

This is a sample api I used, you can try it out

json structure

the response is

{ "uuid": "d0e94cca-6e22-462c-b924-b940625b1315", "links": [ { "rel": "self", "uri": "http://41.76.248.132:8080/openmrs/ws/rest/v1/migration/d0e94cca-6e22-462c-b924-b940625b1315" }, { "rel": "full", "uri": "http://41.76.248.132:8080/openmrs/ws/rest/v1/migration/d0e94cca-6e22-462c-b924-b940625b1315?v=full" } ], "resourceVersion": "1.8" }

When you search for the patient on the UI framework in this sample json, patient name is Chief Zombie, you will see the patient and even see all encounters but the obs are not complete because one of it failed and we have not bee able to output the error to know which one failed. The recent code is on a different repo here.

If am still up when you get back, I will let you know.

Regards

dkayiwa commented 5 years ago

@JohnboscoJbTech can you use pastebin for this and just share the paste link?

multiplechuks commented 5 years ago

@dkayiwa I have done that.

dkayiwa commented 5 years ago

@multiplechuks, thinking about this again, i strongly feel that this approach is unnecessarily complicated and is gonna take you a lot of time for a solution that implementing partners will find hard to use and hence just abandon it. Therefore, do you mind creating a post on OpenMRS Talk under the Developers category? In this post, describe the problem you are trying to solve, and then the approach you are taking. That way, you will get input from other community developers to help you weigh in, if this is really the best approach.

multiplechuks commented 5 years ago

@dkayiwa I have created this issue on talk see here

multiplechuks commented 5 years ago

@dkayiwa I am still waiting for the call we were supposed to have on this issue and some other issues that I have created on talk

dkayiwa commented 5 years ago

@multiplechuks the time zone that am in for this week is making it tricky for a synchronous meeting. What is the latest in the night, that you can go?