-
Notifications
You must be signed in to change notification settings - Fork 1
Backend
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
Userthrough the Admin page. - Create a
Medical Personnelentry for this User through the Admin page.
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.
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
hospitalsfield which is a list of the hospitals that this user is registered to. - an
episodesfield which is a list of this patient's registered episodes.
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:
- On Patient creation, where the
hospital_idand thepatient_hospital_idfields are required by the POST/patients/endpoint. The endpoint uses them to automatically create aPatientHospitalMappingentry. - By explicitly using the POST
/patient-hospital-mappings/endpoint.
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.