Skip to content

Commit

Permalink
#330 backend: update continuous_variables_data for more realistic run…
Browse files Browse the repository at this point in the history
… time
  • Loading branch information
Wolkenfarmer committed Oct 16, 2024
1 parent 14deec8 commit 4a89b01
Showing 1 changed file with 85 additions and 15 deletions.
100 changes: 85 additions & 15 deletions backend/dps_training_k/data/continuous_variables_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,113 @@ 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,
},
],
},
)
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,
},
],
},
)

0 comments on commit 4a89b01

Please sign in to comment.