Forecast Engine technical document

Input

There are two ways to provide the data necessary for the forecast engine. The engine can directly connect to a database source (MySQL and SQL) or the data can be send through the API as CSV file.

Input using database

Two tables are required. One with hospitalization data and one with hospitalization parts. The description of each table is below.

Field nameField typeDescription
hospitalization_idint | stringThe hospitalization ID of the patient who was/is/will be admitted to the hospital.
plan_datedatetime | nullThe date and time at which the patient got a planned admission date and time or null in case this is not known or null in case of an emergency arrival.
planned_hospitalization_datedatetime | nullThe date and time at which the patient was expected to be hospitalized or null in case this is not known or null in case of an emergency arrival.
VODdatetime | nullUser provided estimated dismissal date and time at which the patient is planned to leave the hospital or null is case this is not known.
has_ORboolean | nullA Boolean value (0/1) representing whether the patient have had a surgery or is expected to have a surgery, or null if not available.
Hospitalization table.
Field nameField typeDescription
hospitalization_idint | stringThe hospitalization ID of the patient.
start_datetimedatetimeThe date and time at which the patient occupies a bed on the department, or an expected date and time for an planned future arrival.
end_datetimedatetime | nullThe date and time at which the patient ended his stay on the department or null in case the patient is still occupying the department.
departmentstringThe name of the department for this hospitalization part. The forecasts are made for this dimension. If you want to make forecasts for department groups instead of departments, then please provide the names of department groups in this field.
estimated_transfer_datetimedatetime | nullThe estimated date and time at which the patient was/is expected to be transferred to another department as expected by the doctor or null is not available. Note this is null in case of leaving the hospital (for that, use the VOD in Hospitalization table).
destination_departmentstring | nullThe name of the department where the patient was/is routed to after his current department or null in case this is unknown.
specialtystringThe specialty that the patient was assigned to during this part of the stay.
admission_urgencychar(2) (‘el’ = elective, ’em’ = emergency)How to patient entered this part of the stay. Either as elective (planned) admission, or as unplanned (emergency).
admission_typechar(1) (‘d’ = day, ‘c’ = clinical)Whether the patient was admitted for this part of the stay as a day patient (entering and leaving the department on the same day), or as a clinical admission.
Hospitalization parts table.

Input using CSV file

Field nameField typeDescription
hospitalization_idint | stringThe hospitalization ID of the patient.
start_datetimedatetimeThe date and time at which the patient occupies a bed on the department, or an expected date and time for an planned future arrival.
end_datetimedatetime | nullThe date and time at which the patient ended his stay on the department or null in case the patient is still occupying the department.
departmentstringThe name of the department for this hospitalization part. The forecasts are made for this dimension. If you want to make forecasts for department groups instead of departments, then please provide the names of department groups in this field.
estimated_transfer_datetimedatetime | nullThe estimated date and time at which the patient was/is expected to be transferred to another department as expected by the doctor or null is not available. Note this is null in case of leaving the hospital (for that, use the VOD in Hospitalization table).
destination_departmentstring | nullThe name of the department where the patient was/is routed to after his current department or null in case this is unknown.
specialtystringThe specialty that the patient was assigned to during this part of the stay.
admission_urgencychar(2) (‘el’ = elective, ’em’ = emergency)How to patient entered this part of the stay. Either as elective (planned) admission, or as unplanned (emergency).
admission_typechar(1) (‘d’ = day, ‘c’ = clinical)Whether the patient was admitted for this part of the stay as a day patient (entering and leaving the department on the same day), or as a clinical admission.
plan_datedatetime | nullThe date and time at which the patient got a planned admission date and time or null in case this is not known or null in case of an emergency arrival.
planned_hospitalization_datedatetime | nullThe date and time at which the patient was expected to be hospitalized or null in case this is not known or null in case of an emergency arrival.
VODdatetime | nullUser provided estimated dismissal date and time at which the patient is planned to leave the hospital or null is case this is not known.
CSV file contents.

Output

There are two ways to provide the output of forecast engine. The engine can directly write to a database destination (MySQL and SQL) or the output can be send as json response.

Output using database

Two tables are required or created by the engine if they do not already exist. The description of each table is below.

Field nameField typeDescription
departmentstringThe name of the department.
forecast_datetimedatetimeThe date and time for the prediction.
expected_occupancyfloatThe expected occupancy at the department on the date and time.
lowerbound_occupancyfloatThe lowerbound of the confidence interval of the predicted occupancy.
upperbound_occupancyfloatThe upperbound of the confidence interval of the predicted occupancy.
Table with hourly forecasts regarding the bed census.
Field nameField typeDescription
departmentstringThe name of the department.
forecast_datedateThe date for the prediction.
emergency_arrivalsfloatThe expected number of emergency arrivals to happen at the department on the date.
elective_arrivalsfloatThe expected number of elective arrivals (which is the number of already planned arrivals and the expected number of patient that will be planned in the period from now to the prediction date) to happen at the department on the date.
unplanned_arrivalsfloatThe expected number of patient that will be planned in the period from now to the prediction date.
Table with daily forecasts regarding the arrivals.

Output using json

The json response contains both the hourly and daily forecasts. Refer to the two tables mentioned in the section ‘Output using database’ for the interpretation of the fields in the json response. Click here to see a sample response. Note that the response will be returned in plain text, and not as a file.