medic / cht-interoperability

CHT - eCHIS interoperability project
GNU Affero General Public License v3.0
2 stars 3 forks source link

Patient route crashes when `name` isn't provided in request body #19

Closed samuelimoisili closed 1 year ago

samuelimoisili commented 1 year ago

The create patient route on the mediator server crashes when the request body doesn't contain a name field that is a string.

lorerod commented 1 year ago

@samuelimoisili can you please share the obtained result versus the expected result? I can't reproduce the issue anymore because you merged the fix to the main branch. It would be helpful to see how the server crashes and with what input. Thanks!

lorerod commented 1 year ago

Environment: MacOS 13.1 (22C65); Docker desktop 4.15.0 (93002)l; Docker engine: 20.10.21 CHT 4.1.0: Local using docker compose files cht-core.yml and cht-couchdb.yml interoperability branch: main

lorerod commented 1 year ago

I put the ticket status as Done, as the branch was already merged with the main branch. @samuelimoisili as a note, it is always better not to merge the branch before acceptance testing is done. Please reference the Development workflow. Thanks!

lorerod commented 1 year ago
samuelimoisili commented 1 year ago
  • When I tried with all the required fields I got the following response: Request: POST http://localhost:5001/mediator/patient { "_id": "bbca4173-b914-43b6-9fcb-437aa8773f38", "sex":"female", "name":"Lorena"} Response code: 200 OK Response Body:
{
    "status": 400,
    "patient": {
        "message": "Invalid 'date_of_birth' range: received undefined"
    }
}

@samuelimoisili I think the response body is confusing. The status 400 inside de body and the message. Do you think we need to fix this? Please let me know and I can create the issue. Thanks

Yeah, I think we'll need to fix it. I'll go ahead to create ticket.

samuelimoisili commented 1 year ago

I put the ticket status as Done, as the branch was already merged with the main branch. @samuelimoisili as a note, it is always better not to merge the branch before acceptance testing is done. Please reference the Development workflow. Thanks!

Yeah, I'll take note of that. Thanks.