Error 500 when viewing appointment added by REST API

Share this

If you are all of a sudden getting error 500 on viewing all appointments of a demographic, and you compared the appointment table entries for the demographic to other working ones and they seem to be correct, it’s likely because the demographicNo was entered as an integer when the /schedule/add API endpoint expects string for demographicNo instead of int on some OSCAR versions.

POST /ws/services/schedule/add

{
  "providerNo": "string",
  "appointmentDate": "string",
  "startTime": "string",
  "startTime12hWithMedian": "string",
  "name": "string",
  "demographicNo": "string",
  "notes": "string",
  "reason": "string",
  "location": "string",
  "resources": "string",
  "type": "string",
  "status": "string",
  "duration": 0,
  "urgency": "string"
}

If you add an appointment via API and specify demographicNo as int instead of string, you will see error 500 when trying to add an appointment for that demographic or open any of the past/future appointments for that patient. The fix for an existing patient is to correct the demographic_no column in the appointment table.