From 4a89b017ae79a25ae988c2d9910d4ccfe78e65e6 Mon Sep 17 00:00:00 2001 From: Wolkenfarmer Date: Wed, 16 Oct 2024 19:07:22 +0200 Subject: [PATCH] #330 backend: update continuous_variables_data for more realistic run time --- .../data/continuous_variables_data.py | 100 +++++++++++++++--- 1 file changed, 85 insertions(+), 15 deletions(-) diff --git a/backend/dps_training_k/data/continuous_variables_data.py b/backend/dps_training_k/data/continuous_variables_data.py index 9648699e..f373349f 100644 --- a/backend/dps_training_k/data/continuous_variables_data.py +++ b/backend/dps_training_k/data/continuous_variables_data.py @@ -18,34 +18,55 @@ def update_or_create_continuous_variables(): uuid=ContinuousVariableIDs.SPO2, defaults={ "name": ContinuousVariable.Variable.SPO2, - "function": ContinuousVariable.Function.LINEAR, + "function": ContinuousVariable.Function.SIGMOID, "exceptions": [ { - "actions": [str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN)], + "actions": [ + str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN), + str(ActionIDs.SAUERSTOFF_ANBRINGEN), + [ + str(ActionIDs.ANALGETIKUM), + str(ActionIDs.ANTIKOAGULANZ), + str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN), + ], + ], "materials": [ str(MaterialIDs.BEATMUNGSGERAET_STATIONAER), str(MaterialIDs.BEATMUNGSGERAET_TRAGBAR), + [ + str(MaterialIDs.FRESH_FROZEN_PLASMA), + str(MaterialIDs.LAB_GERAET_1), + str(MaterialIDs.LAB_GERAET_2), + ], ], - "function": ContinuousVariable.Function.LINEAR, + "function": ContinuousVariable.Function.INCREMENT, }, { "actions": [ - [str(ActionIDs.IV_ZUGANG), str(ActionIDs.DRUCKVERBAND)] + str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN), + [ + str(ActionIDs.ANALGETIKUM), + str(ActionIDs.ANTIKOAGULANZ), + ], ], "materials": [ - [str(MaterialIDs.EKG), str(MaterialIDs.BZ_MESSGERAET)] + str(MaterialIDs.BEATMUNGSGERAET_STATIONAER), + [ + str(MaterialIDs.FRESH_FROZEN_PLASMA), + str(MaterialIDs.LAB_GERAET_1), + ], ], - "function": ContinuousVariable.Function.DECREMENT, + "function": ContinuousVariable.Function.LINEAR, }, { - "actions": [str(ActionIDs.IV_ZUGANG)], - "materials": [str(MaterialIDs.EKG)], - "function": ContinuousVariable.Function.INCREMENT, + "actions": [str(ActionIDs.TURNIQUET)], + "materials": [], + "function": ContinuousVariable.Function.SIGMOID_DELAYED, }, { - "actions": [str(ActionIDs.IV_ZUGANG)], - "materials": [], - "function": ContinuousVariable.Function.SIGMOID, + "actions": [], + "materials": [str(MaterialIDs.BZ_MESSGERAET)], + "function": ContinuousVariable.Function.SIGMOID_DELAYED, }, ], }, @@ -53,8 +74,57 @@ def update_or_create_continuous_variables(): ContinuousVariable.objects.update_or_create( uuid=ContinuousVariableIDs.HEART_RATE, defaults={ - "name": ContinuousVariable.Variable.HEART_RATE, - "function": ContinuousVariable.Function.SIGMOID_DELAYED, - "exceptions": [], + "name": ContinuousVariable.Variable.SPO2, + "function": ContinuousVariable.Function.SIGMOID, + "exceptions": [ + { + "actions": [ + str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN), + str(ActionIDs.SAUERSTOFF_ANBRINGEN), + [ + str(ActionIDs.ANALGETIKUM), + str(ActionIDs.ANTIKOAGULANZ), + str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN), + ], + ], + "materials": [ + str(MaterialIDs.BEATMUNGSGERAET_STATIONAER), + str(MaterialIDs.BEATMUNGSGERAET_TRAGBAR), + [ + str(MaterialIDs.FRESH_FROZEN_PLASMA), + str(MaterialIDs.LAB_GERAET_1), + str(MaterialIDs.LAB_GERAET_2), + ], + ], + "function": ContinuousVariable.Function.INCREMENT, + }, + { + "actions": [ + str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN), + [ + str(ActionIDs.ANALGETIKUM), + str(ActionIDs.ANTIKOAGULANZ), + ], + ], + "materials": [ + str(MaterialIDs.BEATMUNGSGERAET_STATIONAER), + [ + str(MaterialIDs.FRESH_FROZEN_PLASMA), + str(MaterialIDs.LAB_GERAET_1), + ], + ], + "function": ContinuousVariable.Function.LINEAR, + }, + { + "actions": [str(ActionIDs.TURNIQUET)], + "materials": [], + "function": ContinuousVariable.Function.SIGMOID_DELAYED, + }, + { + "actions": [], + "materials": [str(MaterialIDs.BZ_MESSGERAET)], + "function": ContinuousVariable.Function.SIGMOID_DELAYED, + }, + ], }, )