Skip to content

Backend

Dimitris Koutsonikolis edited this page Jan 27, 2022 · 5 revisions

Users/Medical Personnel

You can create users manually through the admin page. In order to be able to invoke the API(and also to access the UI), you need to:

  • Create an admin User through the Admin page.
  • Create a Medical Personnel entry for this User through the Admin page.

Hospitals

You should create new Hospitals manually through the admin page. After that, you can use the GET /hospitals/ and the GET /hospitals/{id}/ endpoints to retrieve a list of the hospitals and details of a certain hospital.

Patients

You can create a patient using the POST /patients/ endpoint. This endpoint also requires a hospital_id & a patient_hospital_id which are necessary in order to also register this patient to a certain hospital.

After the patient is created, you can use the GET /patients and GET /patients/{id}/ endpoints to retrieve a list of the patients and details of a certain patient. Those endpoints also return:

  • a hospitals field which is a list of the hospitals that this user is registered to.
  • an episodes field which is a list of this patient's registered episodes.

Patient Hospital Mapping

We use this entity in order to register a patient into different hospitals while persisting his specific patient_hospital_id for every different hospital. This mapping can be created in two ways:

  1. On Patient creation, where the hospital_id and the patient_hospital_id fields are required by the POST /patients/ endpoint. The endpoint uses them to automatically create a PatientHospitalMapping entry.
  2. By explicitly using the POST /patient-hospital-mappings/ endpoint.

Episodes

We can register a patient's Episode by using the POST /episodes endpoint. This episode can only get registered for a hospital that this patient is already registered to(PatientHospitalMapping exists). If the user wants to register an episode for a hospital that the patient is not yet registered to, we should use the POST /patient-hospital-mappings/ endpoint first and then invoke the POST /episodes/ endpoint.

Clone this wiki locally