diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 00000000..f2add210 --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,25 @@ +# k-dPS Team +- [Claas Gade](https://github.com/claasga) +- [Johannes Westergerling](https://github.com/wolkenfarmer) +- [Joshua Riewesell](https://github.com/JoshuaRiewesell) +- [Toni Poredda](https://github.com/Toni000) + +# Other Contributors +The [backend](backend) was partly based on the [dps.training_server repository](https://github.com/hpi-sam/dps.training_server) with following contributors: +- [Nils Cichy](https://github.com/inadicis) +- [Chiara Schirmer](https://github.com/Schirmchens) +- [Patricia Sowa](https://github.com/PatriciaSowa) +- [Julian Baumann](https://github.com/jeriox) +- [Christian Schäffer](https://github.com/christianzoellner) + +# Special Thanks +## Project supervisors +- [Christian Schäffer](https://github.com/christianzoellner) +- [Matthias Barkowsky](https://github.com/mbarkowsky) + +## Data provider +Individuals responsible for creating and auditing the data - see the respective [readme](backend/dps_training_k/data/README.md) and +[license](backend/dps_training_k/data/LICENSE) +- Frank Sensen +- Philipp Rocker +- Wolfram Pohlheim \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..169cc5c7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 k-dPS Team and other contributors, see AUTHORS.md + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 7d61cf55..de65fc06 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,16 @@ The following list describes where to find the documentation for the different p - Tips regarding the project configuration: [docs file](./docs/configuration-tips.md). - MoSCoW and future plans: [docs file](./docs/moscow.md). +## Project Licensing +The majority of this project is licensed under the MIT License, as found in the [LICENSE](./LICENSE) file at the root of this project. However, +some components are licensed differently: + +- **data**: The code and content within `backend/dps_training_k/data` are licensed under the CC BY-NC license, as detailed in the + [backend/dps_training_k/data/LICENSE](./backend/dps_training_k/data/LICENSE) file. This license prohibits the use of the data for commercial use. + Consequently, the data needs to be removed or replaced or licensing addendums have to be negotiated if the project should be used commercially. For + more details, see the [backend/dps_training_k/data/README.md](./backend/dps_training_k/data/README.md) file. + + ## Thank you First and foremost, we would like to thank the [Hasso Plattner Institute](https://hpi.de/) for giving us the opportunity to work on this project as well as our supervisors Christian Schäffer and Matthias Barkowsky for their guidance and organization of the project. @@ -61,6 +71,6 @@ And last but not least, we would like to thank our supporters: Special thanks to the following people for being directly available to us and providing us with valuable insights and feedback: Frank Sensen (ZaNowi), Philipp Rocker (Johanniter) and Daniel Schmitz (Evangelisches Krankenhaus Hubertus). -![](docs/hpi_logo.png) +![](./docs/hpi_logo.png) ![](./docs/johanniter_logo.png) ![](./docs/zanowi_logo.png) \ No newline at end of file diff --git a/backend/README.md b/backend/README.md index 23b3e831..3e6577ee 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,20 +1,25 @@ # Klinik-dPS Backend + The simulation logic and database management for the K-dPS project. For the interactive website see the [frontend folder](../frontend/README.md). For general information on the project like e.g. licensing information or future plans, see the [Project README](../README.md). ## Setup + ### Install Python + - install from official [python website](https://www.python.org/downloads/) - version should be at least 3.12 - ### Install requirements + - navigate into backend folder - `pip install -r requirements.txt` ### Setup Black Formatter + We are using black as a biased formatter for the whole project. For more information about black see: [Black](https://black.readthedocs.io/en/stable/) + - make sure you have python extension installed - download "Black Formatter" from marketplace - right-click on a python file @@ -26,45 +31,52 @@ We are using black as a biased formatter for the whole project. For more informa - enable "Editor: Format on Save" ## Running the project using Docker -Running the project without docker is currently not tested/supported. + +Running the project without docker is currently not tested/supported. For more information on the difference between `prod` and `dev`, see the [docs file](../docs/deployment-process.md). -Note that the `prod` env file here still assumes this is running locally - +Note that the `prod` env file here still assumes this is running locally - meaning it will expect the frontend to run on localhost. Build and run: + ```bash docker compose --env-file .env. up --build ``` -Optionally, to access the database, create a superuser account: +Optionally, to access the database, create a superuser account: + ```bash docker exec -it K-dPS-django python manage.py createsuperuser ``` + Afterwards, you can log into the admin interface at e.g. `http://localhost:80/admin/`
Note: this is only available if DEBUG = true, which is the case in the dev environment. - ## Development ### Migrations + When changing models, you need to create migrations in order to update existing databases. + - Create new migrations: `docker exec -it K-dPS-django python manage.py makemigrations` - Optionally, if you have conflicting migrations: `docker exec -it K-dPS-django python manage.py migrate --merge` - Execute these migrations to update the database: `docker exec -it K-dPS-django python manage.py migrate` ### Running Tests + - start docker container with docker compose(see Running the project using Docker) - wait until Application Startup is Completed - run: `docker exec -it K-dPS-django python manage.py test` ### Working with Fixtures -- (clear database) -- fill database with data you want to export as fixture (e.g. `docker exec -it K-dPS-django python manage.py import_patient_states`) - - if updating a fixture that is used by a model that doesn't allow null fields, make them nullable, migrate and discard the migration file - afterwards. -- create fixture: - - `docker exec -it K-dPS-django bash` - - `export PYTHONIOENCODING=utf8` - - `python manage.py dumpdata template > patient_states.json` -- move the fixture to the "fixtures" directory + +Example given for creating the "patient_states.json" fixture containing all patientstates, statetransitions, subconditions and logicnodes. + +- clear database of the wanted models via e.g. `docker exec -it K-dPS-django python manage.py flush` +- fill database with data you want to export as fixture: `docker exec -it K-dPS-django python manage.py import_patient_states` +- create fixture: + - `docker exec -it K-dPS-django bash` + - `export PYTHONIOENCODING=utf8` + - `python manage.py dumpdata template.patientstate template.statetransition template.subcondition template.logicnode > + data/fixtures/patient_states.json` - now you can load it: `docker exec -it K-dPS-django python manage.py loaddata patient_states.json` diff --git a/backend/dps_training_k/configuration/settings.py b/backend/dps_training_k/configuration/settings.py index 699d5a42..540833e3 100644 --- a/backend/dps_training_k/configuration/settings.py +++ b/backend/dps_training_k/configuration/settings.py @@ -32,7 +32,11 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = env.bool("DEBUG") CORS_ORIGIN_ALLOW_ALL = DEBUG -CORS_ALLOWED_ORIGINS = ["https://klinik-dps.de", "https://www.klinik-dps.de", "http://localhost"] +CORS_ALLOWED_ORIGINS = [ + "https://klinik-dps.de", + "https://www.klinik-dps.de", + "http://localhost", +] RUN_CONFIG = env.str("RUN_CONFIG", default="dev") CSRF_TRUSTED_ORIGINS = ["http://localhost:8000"] @@ -127,18 +131,16 @@ # https://docs.djangoproject.com/en/5.0/topics/i18n/ LANGUAGE_CODE = "en-us" - TIME_ZONE = "UTC" - USE_I18N = True - USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.0/howto/static-files/ - STATIC_URL = "static/" +FIXTURE_DIRS = ["data/fixtures"] + # Default primary key field type # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field diff --git a/backend/dps_training_k/data/LICENSE b/backend/dps_training_k/data/LICENSE new file mode 100644 index 00000000..27c80ecc --- /dev/null +++ b/backend/dps_training_k/data/LICENSE @@ -0,0 +1,6 @@ +Creative Commons Attribution-NonCommercial 4.0 International License + +Copyright (c) 2024 k-dPS Team, Frank Sensen, Philipp Rocker and Wolfram Pohlheim, see AUTHORS.md + +This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit +http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. diff --git a/backend/dps_training_k/data/README.md b/backend/dps_training_k/data/README.md new file mode 100644 index 00000000..a3bbe373 --- /dev/null +++ b/backend/dps_training_k/data/README.md @@ -0,0 +1,24 @@ +# Data Directory Documentation + +## Overview +This directory contains data used by the K-dPS. The data here is integral to various functionalities within the project and is subject to +specific licensing conditions that restrict its use to non-commercial purposes. + +## Licensing +The contents of this directory are licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC). This license +allows for redistribution, derivative creation, and adaptation of this work, strictly for non-commercial purposes, as long as attribution is given to +the original creators. + +### License Summary +- **Non-Commercial Use Only**: The data may only be used for non-commercial purposes. This includes academic research, personal projects, and + educational use. +- **Attribution**: If you redistribute or use the data in any form, appropriate credit must be given, providing a link to the license, and indicating + if changes were made. +- **Redistribution and Sharing**: Redistribution of this data is permitted under the condition that it is not used for commercial purposes. All + redistributed copies or adaptations must also be licensed under the same terms. + +For the full license text, please refer to the [LICENSE](./LICENSE) file in this directory. + +## Removing or Replacing Data for Commercial Use +If you intend to use the project commercially, the data in this directory must be removed, replaced with data that is licensed for commercial use, or +a different license must be negotiated that allows for such use. \ No newline at end of file diff --git a/backend/dps_training_k/data/actions_data.py b/backend/dps_training_k/data/actions_data.py new file mode 100644 index 00000000..8d1f0a66 --- /dev/null +++ b/backend/dps_training_k/data/actions_data.py @@ -0,0 +1,2415 @@ +from template.constants import ActionIDs, MaterialIDs, RoleIDs, role_map +from template.models import Action + + +def update_or_create_actions(): + """ + "category": Action.Category.TREATMENT, // category as defined in Action, short form + "location": BE, // location where action is conducted + "relocates": false // boolean indicating whether action relocates the patient or not + "application_duration: 60, // application duration in seconds + "effect_duration": 60, // effect duration in seconds; None means permanent + "conditions": { + "required_actions": ["A1uuid", "A2uuid", ["A3uuid", "A4uuid"]], // this means action1 AND action2 AND (action3 OR action4); can be None + "prohibitive_actions": ["A1uuid", "A2uuid", ["A3uuid", "A4uuid"]], // this means action1 AND action2 AND (action3 OR action4); can be None + "material": ["M1uuid", "M2uuid", ["M3uuid", "M4uuid"]], // material1 AND material2 AND (material3 OR material4); can be None + "num_personnel": 3, // number of personnel required, must be specified -> CANNOT be None + "lab_devices": ["L1uuid", "L2uuid", ["L3uuid", "L4uuid"]], // labdev1 AND labdev2 AND (labdev3 OR labdev4); can be None + "area": "ZNA", // area patient has to be in for action to be applicable; can be None + "role": [{"Pflegefachkraft": 1}, [{"Arzt": 1}, {"Laborassistent": 1}]] // this means 1 Pflegefachkraft AND (1 Arzt OR 1 Laborassistent); CANNOT be None + 'results': { + "produced_material": {uuid, amount} + "ZVD": {code: value} //for every possible examination + } + } + """ + + Action.objects.update_or_create( + uuid=ActionIDs.BLUTABNAHME, + defaults={ + "name": "Blut abnehmen", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [str(ActionIDs.ART_KANUELE)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.THORAXDRAINAGE, + defaults={ + "name": "Thoraxdrainage", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 300, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.PLEURAPUNKTION, + defaults={ + "name": "Pleurapunktion", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 60, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.TRACHEALTUBUS, + defaults={ + "name": "Trachealtubus", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 120, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": [ + str(ActionIDs.TRACHEALTUBUS), + str(ActionIDs.LARYNXTUBUS), + str(ActionIDs.GUEDELTUBUS), + ], + "material": [str(MaterialIDs.BEATMUNGSBEUTEL)], + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.LARYNXMASKE, + defaults={ + "name": "Larynxmaske", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 60, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": [str(MaterialIDs.BEATMUNGSBEUTEL)], + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.LARYNXTUBUS, + defaults={ + "name": "Larynxtubus", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 60, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": [str(MaterialIDs.BEATMUNGSBEUTEL)], + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.GUEDELTUBUS, + defaults={ + "name": "Guedeltubus", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.WENDELTUBUS, + defaults={ + "name": "Wendeltubus", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.KONIOTOMIETUBUS, + defaults={ + "name": "Koniotomietubus", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 180, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [[str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)]], + "prohibitive_actions": None, + "material": None, + "num_personnel": 3, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 2}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ANALGETIKUM, + defaults={ + "name": "Analgetikum", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 600, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.ZVK)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ANTIASTHMATIKUM, + defaults={ + "name": "Antiasthmatikum", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 600, # None means permanent + "conditions": { + "required_actions": None, # Vernebler oder Inhalator + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.KORTIKOSTEROID, + defaults={ + "name": "Kortikosteroid", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 1800, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.NITRAT, + defaults={ + "name": "Nitrat", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 600, # None means permanent + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.DIURETIKUM, + defaults={ + "name": "Diuretikum", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 1200, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.KATECHOLAMIN, + defaults={ + "name": "Katecholamin", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 60, # None means permanent + "conditions": { + "required_actions": [[str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)]], + "prohibitive_actions": None, + "material": [str(MaterialIDs.SPRITZENPUMPE)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.SEDATIVUM, + defaults={ + "name": "Sedativum", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 600, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.REGIONAL_NARKOTIKUM, + defaults={ + "name": "Regional-Narkotikum", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, # "Freifeld", dunno how do handle that + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, # Spritze und S.C. Kanüle? + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.TETANUSPROPHYLAXE, + defaults={ + "name": "Tetanusprophylaxe", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, # Spritze und I.M. Kanüle? + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ANTIKOAGULANZ, + defaults={ + "name": "Antikoagulanz", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.NARKOTIKUM, + defaults={ + "name": "(Voll-)Narkotikum", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": [str(MaterialIDs.NARKOSEGERAET)], + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ANTIBIOTIKUM, + defaults={ + "name": "Antibioktikum", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, # None means permanent + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.VOLLELEKTROLYT_1000, + defaults={ + "name": "Vollelektrolyt 1000ml", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, # Depends of type of "Zugang" + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.VOLLELEKTROLYT_500, + defaults={ + "name": "Vollelektrolyt 500ml", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, # Depends of type of "Zugang" + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.PLASMAEXPANDER, + defaults={ + "name": "Plasmaexpander", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 120, # Depends of type of "Zugang" + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.IV_ZUGANG, + defaults={ + "name": "i.V. Zugang", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 60, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ZVK, + defaults={ + "name": "ZVK", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 300, + "effect_duration": 360, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.SCHLEUSE, + defaults={ + "name": "Schleuse", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 240, + "effect_duration": 60, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ART_KANUELE, + defaults={ + "name": "art. Kanüle", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 120, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.MEHRLUMEN_ZVK, + defaults={ + "name": "mehrlumen ZVK", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 240, + "effect_duration": 420, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.REGIONAL_NARKOSE, + defaults={ + "name": "Regional-Narkose", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 60, + "effect_duration": None, # abhängig von Medikament + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.DRUCKVERBAND, + defaults={ + "name": "Druckverband", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.TURNIQUET, + defaults={ + "name": "Turniquet", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.WUNDVERSORGUNG, + defaults={ + "name": "Wundversorgung", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.CHIR_BLUTSTILLUNG, + defaults={ + "name": "chir. Blutstillung", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 180, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.STIFNECK, + defaults={ + "name": "Stifneck", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 2}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.VAKUUMSCHIENE, + defaults={ + "name": "Vakuumschiene", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 60, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 2}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.BECKENSCHLINGE, + defaults={ + "name": "Beckenschlinge", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 2}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.GIPSVERBAND, + defaults={ + "name": "Gipsverband", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 300, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.STABILE_SEITENLAGE, + defaults={ + "name": "Stabile Seitenlage", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.SCHOCKLAGE, + defaults={ + "name": "Schocklage", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.DEFI_TRANSKUTANER_PACER, + defaults={ + "name": "Defi + transkutaner Pacer", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.IV_ZUGANG), + [str(ActionIDs.NARKOTIKUM), str(ActionIDs.ANALGETIKUM)], + ], + "prohibitive_actions": None, + "material": [str(MaterialIDs.DEFI_TRANSKUTANER_PACER)], + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.BEATMUNGSGERAET_ANBRINGEN, + defaults={ + "name": "Beatmungsgerät anbringen", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.TRACHEALTUBUS), + ], + "prohibitive_actions": [str(ActionIDs.CPAP_BEATMUNGSGERAET_ANBRINGEN)], + "material": [ + [ + str(MaterialIDs.BEATMUNGSGERAET_STATIONAER), + str(MaterialIDs.BEATMUNGSGERAET_TRAGBAR), + ] + ], + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.CPAP_BEATMUNGSGERAET_ANBRINGEN, + defaults={ + "name": "CPAP-Beatmungsgerät anbringen", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": [str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN)], + "material": [ + [ + str(MaterialIDs.BEATMUNGSGERAET_CPAP), + ] + ], + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.SAUERSTOFF_ANBRINGEN, + defaults={ + "name": "Sauerstoff anbringen", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": [ + [ + str(MaterialIDs.SAUERSTOFF_TRAGBAR), + str(MaterialIDs.SAUERSTOFF_STATIONAER), + ] + ], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.BLUTDRUCK_MESSEN, + defaults={ + "name": "Blutdruck messen", + "category": Action.Category.EXAMINATION, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": { + "Blutdruck": { + 400: "140/90", + 401: "150/90", + 402: "100/40", + 403: "90/50", + 404: "80/50", + 405: "100/60", + 406: "110/60", + 407: "100/50", + 408: "130/90", + 409: "80/35", + 410: "100/45", + 411: "150/85", + 412: "220/125", + 413: "120/50", + 414: "170/100", + 415: "80/65", + 416: "180/105", + 417: "130/60", + 418: "170/70", + 419: "180/85", + 420: "200/90", + 421: "180/90", + 422: "200/105", + 423: "80/55", + 424: "80/40", + 425: "210/120", + 426: "170/75", + 427: "150/75", + 428: "70/50", + 429: "140/100", + 430: "110/80", + 431: "140/75", + 432: "120/55", + 433: "60/45", + 434: "160/80", + 435: "100/80", + 436: "180/95", + 437: "160/110", + 438: "180/75", + 439: "140/80", + 440: "210/115", + 441: "220/100", + 442: "70/40", + 443: "100/75", + 444: "170/85", + 445: "110/45", + 446: "120/80", + 447: "70/55", + 448: "150/95", + 449: "150/80", + 450: "60/40", + 451: "100/65", + 452: "210/110", + 453: "120/70", + 454: "200/110", + 455: "110/50", + 456: "140/85", + 457: "170/90", + 458: "190/90", + 459: "160/100", + 460: "210/80", + 461: "160/85", + 462: "130/65", + 463: "90/40", + 464: "80/60", + 465: "160/75", + 466: "190/80", + 467: "140/65", + 468: "220/95", + 469: "200/95", + 470: "150/70", + 471: "190/85", + 472: "90/75", + 473: "90/60", + 474: "90/45", + 475: "110/85", + 476: "190/75", + 477: "100/70", + 478: "170/95", + 479: "n.m.", + 480: "130/75", + 481: "190/100", + 482: "210/100", + 483: "220/105", + 484: "110/55", + 485: "90/65", + 486: "220/90", + 487: "160/95", + 488: "220/115", + 489: "170/110", + 490: "200/80", + 491: "200/100", + 492: "140/70", + 493: "210/95", + 494: "150/65", + 495: "170/105", + 496: "110/70", + 497: "70/45", + 498: "170/80", + 499: "150/100", + 500: "210/85", + 501: "190/105", + 502: "120/60", + 503: "180/70", + 504: "80/45", + 505: "210/90", + 506: "130/85", + 507: "200/120", + 508: "140/60", + 509: "100/55", + 510: "140/95", + 511: "60/50", + 512: "180/110", + 513: "190/110", + 514: "210/105", + 515: "90/55", + 516: "120/90", + 517: "160/105", + 518: "110/75", + 519: "130/55", + 520: "110/65", + 521: "200/115", + 522: "180/100", + 523: "120/75", + 524: "120/65", + 525: "150/105", + 526: "220/85", + 527: "120/85", + 528: "180/80", + 529: "160/70", + 530: "50/40", + 531: "130/80", + 532: "130/95", + 533: "220/110", + 534: "190/95", + 535: "200/85", + 536: "90/70", + 537: "160/90", + 538: "220/120", + 539: "130/70", + 540: "190/115", + 541: "n.m.", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.SAETTIGUNGSMESSGERAET_ANBRINGEN, + defaults={ + "name": "Sättigungsmessgerät anbringen", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.PASSAGEREN_PACER_ANBRINGEN, + defaults={ + "name": "passageren Pacer anbringen", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.IV_ZUGANG), + str(ActionIDs.ANALGETIKUM), + ], + "prohibitive_actions": None, + "material": [str(MaterialIDs.PASSAGERER_PACER)], + "num_personnel": 2, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.PERFUSORPUMPE_AKTIVIEREN, + defaults={ + "name": "Perfusorpumpe aktivieren", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [[str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)]], + "prohibitive_actions": None, + "material": [str(MaterialIDs.PERFUSORPUMPE)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.PERFUSORPUMPE_MIT_WIRKSTOFF_BESTUECKEN, + defaults={ + "name": "Perfusorpumpe mit Wirkstoff bestücken", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": [str(MaterialIDs.PERFUSORPUMPE)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.GLUCOSE_VERABREICHEN, + defaults={ + "name": "Glucose verabreichen", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [[str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)]], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.LYSE_VERARBREICHEN, + defaults={ + "name": "Lyse verabreichen", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [[str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)]], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.BLUTGASEANALYSE, + defaults={ + "name": "Blutgaseanalyse", + "category": Action.Category.EXAMINATION, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [str(ActionIDs.ART_KANUELE)], + "prohibitive_actions": None, + "material": [str(MaterialIDs.BLUTGASANALYSE)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": { + "BGA-Oxy": { + 600: "schwere Hypoxie", + 601: "leichte Hypoxie", + 602: "gute Oxygenierung", + 603: "schwere Hypoxie", + 604: "mäßige Hypoxie", + 605: "leichte Hypoxie", + 606: "mäßige Hypoxie", + 607: "gute Oxygenierung", + 608: "leichte Hypoxie", + 609: "leichte Hypoxie", + 610: "gute Oxygenierung", + 611: "schwere Hypoxie", + 612: "gute Oxygenierung", + 613: "nicht verwertbar", + 614: "mäßige Hypoxie", + 615: "schwere Hypoxie", + }, + "BGA-SBH": { + 650: "resp. Alkalose", + 651: "kompensierte resp. Alkalose", + 652: "kompensierte metabol. Alkalose", + 653: "metabol. Alkalose", + 654: "resp. Alkalose", + 655: "kompensierte resp. Alkalose", + 656: "ausgeglichener SBH", + 657: "kompensierte resp. Azidose", + 658: "kompensierte metab. Azidose", + 659: "resp. Azidose", + 660: "kompensierte resp. Azidose", + 661: "metabol. Azidose", + 662: "kompensierte resp. Azidose", + 663: "resp. Azidose", + 664: "kompensierte resp. Azidose", + 665: "ausgeglichener SBH", + 666: "kompensierte resp. Alkalose", + 667: "metabol. Azidose", + 668: "resp. Azidose", + 669: "kompensierte metab. Azidose", + 670: "ausgeglichener SBH", + 671: "resp. Azidose", + 672: "kompensierte metab. Azidose", + 673: "metabol. Azidose", + 674: "resp. Alkalose", + 675: "kompensierte metabol. Alkalose", + 676: "ausgeglichener SBH", + 677: "kompensierte resp. Alkalose", + 678: "metabol. Alkalose", + 679: "resp. Alkalose", + 680: "kompensierte metabol. Alkalose", + 681: "metabol. Alkalose", + 682: "kompensierte metabol. Alkalose", + 683: "metabol. Alkalose", + }, + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.BLUTZUCKER_ANALYSIEREN, + defaults={ + "name": "Blutzucker analysieren", + "category": Action.Category.EXAMINATION, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": [str(MaterialIDs.BZ_MESSGERAET)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": { + "BZ": { + 900: 265, + 901: 275, + 902: 170, + 903: 285, + 904: 160, + 905: 395, + 906: 125, + 907: "low", + 908: 155, + 909: 165, + 910: 190, + 911: 355, + 912: 130, + 913: 60, + 914: 180, + 915: 50, + 916: 95, + 917: 245, + 918: 30, + 919: 140, + 920: 120, + 921: 335, + 922: 150, + 923: 175, + 924: 55, + 925: 315, + 926: 135, + 927: 85, + 928: 110, + 929: 70, + 930: 80, + 931: 375, + 932: 195, + 933: 45, + 934: 100, + 935: 35, + 936: 75, + 937: 185, + 938: 365, + 939: 205, + 940: "high", + 941: 225, + 942: 90, + 943: 255, + 944: 215, + 945: 20, + 946: 325, + 947: 15, + 948: 385, + 949: 305, + 950: 65, + 951: 40, + 952: 235, + 953: 105, + 954: 115, + 955: 145, + 956: 25, + 957: 295, + 958: 345, + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.EKG_ANBRINGEN, + defaults={ + "name": "EKG anbringen", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 60, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": [str(MaterialIDs.EKG)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.EKG_ABLESEN, + defaults={ + "name": "EKG ablesen", + "category": Action.Category.EXAMINATION, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [str(ActionIDs.EKG_ANBRINGEN)], + "prohibitive_actions": None, + "material": [str(MaterialIDs.EKG)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": { + "EKG": { + 701: "Absolute Arrhythmie,Linksschenkelblock", + 702: "Sinusrhythmus,ST-Streckensenkungen", + 703: "Schrittmacherrythmus", + 707: "AV-Block III", + 709: "Sinusrhythmus,Rechtsschenkelblock", + 714: "breite Kammerkomplexe", + 716: "Asystolie", + 719: "Kammerflimmern", + 721: "ST-Streckenhebungen, Hinterwandinfarkt", + 722: "Sinusrhythmus", + 725: "Sinusrhythmus,vereinzelt Salven", + 726: "Absolute Arrhythmie,ST-Streckensenkungen", + 728: "Absolute Arrhythmie,Rechtsschenkelblock", + 730: "Absolute Arrhythmie,vereinzelt Salven", + 735: "ST-Streckenhebungen, Hinterwandinfarkt", + 737: "Sinusrhythmus,vereinzelt sVES", + 739: "Absolute Arrhythmie,vereinzelt VES", + 746: "Sinusrhythmus,Linksschenkelblock", + 747: "Absolute Arrhythmie", + 748: "Sinusrhythmus,vereinzelt VES", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ZENTRALEN_VENENDRUCK_MESSEN, + defaults={ + "name": "Zentralen Venendruck messen", + "category": Action.Category.EXAMINATION, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [str(ActionIDs.ZVK)], + "prohibitive_actions": None, + "material": [str(MaterialIDs.ZVD_MESSGERAET)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": { + "ZVD": { + 800: 16, + 801: 12, + 802: -5, + 803: 14, + 804: 6, + 805: 1, + 806: -14, + 807: 13, + 808: 17, + 809: 19, + 810: 3, + 811: -12, + 812: 9, + 813: 5, + 814: -3, + 815: -10, + 816: -15, + 817: -9, + 818: 22, + 819: 21, + 820: 11, + 821: 4, + 822: 0, + 823: -2, + 824: 10, + 825: -13, + 826: 23, + 827: -6, + 828: -7, + 829: -8, + 830: 20, + 831: -4, + 832: 15, + 833: 8, + 834: 18, + 835: -11, + 836: 7, + 837: 2, + 838: -1, + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.EXTREMITAETEN_ROENTGEN, + defaults={ + "name": "Extremitäten Röntgen", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": True, + "application_duration": 240, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": [str(MaterialIDs.ROENTGENGERAET)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.MTRA]: 1}, + ], + }, + "results": { + "Rö-Extremitäten": { + 511: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", + 512: "Dislozierte Handgelenksfraktur; sonst keine Frakturen", + 520: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 523: "HüftTEP; sonst keine Auffälligkeiten", + 524: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 525: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 527: "Extremitäten: Oberschenkelfraktur bds. im mittleren Drittel;", + 530: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 558: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", + 559: "Spiralfraktur rechter Oberarm; sonst keine Frakturen", + 563: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", + 564: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 566: "Oberschenkelfraktur re;", + 567: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 571: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 573: "komplette Unterarmfraktur li. mit dezenter Verschiebung;", + 579: "Extremitäten: Normalbefund; keine Frakturzeichen; mehrere Fremdkörper in beiden Händen;", + 584: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 586: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 590: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 591: "fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.;", + 600: "nicht dislozierte Sprunggelengsfraktur; sonst Extr. OB.", + 602: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 607: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", + 608: "Sprunggelenksfraktur mit deutlicher Dislokation", + 609: "fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.;", + 617: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", + 619: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 625: "Trümmerfraktur des distalen US re.; komplette proximale Unterarmfraktur re.", + 637: "Oberschenkeltrummerfraktur re.", + 640: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", + 649: "Oberschenkelschaftfraktur li mit Fehlstellung", + 650: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", + 652: "fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.;", + 664: "Oberarmamputation li.; sonst keine Frakturzeichen oder Fremdkörper;", + 675: "fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.;", + 680: "komplette Unterarmfraktur re.", + 681: "Extremitäten: Normalbefund; keine Frakturzeichen;", + 682: "Extremitäten: Normalbefund; keine Frakturzeichen;", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.THORAX_ROENTGEN, + defaults={ + "name": "Thorax Röntgen", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": True, + "application_duration": 240, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": [str(MaterialIDs.ROENTGENGERAET)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.MTRA]: 1}, + ], + }, + "results": { + "Rö-Thorax": { + 305: "Lunge noch deutlich überwässert; Pleuraergüsse bds.", + 306: "Thorax: Normalbefund;", + 307: "Thorax: Normalbefund;", + 312: "inhomogene Verschattungen, bds zentrale Infiltrate, Zwerchfellhochstand", + 314: "minimale pulmonale Stauungszeichen im Hilusbereich, seitengleiche Belüftung", + 324: "Rippenserienfraktur re. 4-7; Lunge seitengleich ventiliert", + 327: "minimale pulmonale Stauungszeichen im Hilusbereich, seitengleiche Belüftung; Metallcerclage wie nach Sternotomie;", + 334: "deutlich vergrößertes Herz, Aorta elongiert, Belüftung oB.", + 336: "Thorax: Normalbefund;", + 339: "Thorax: Normalbefund;", + 340: "Pneumothorax re. ca. 2 cm", + 341: "Thorax: Normalbefund;", + 342: "Rippenserienfraktur re. 3-7 ohne Pneu", + 343: "sgl Belüftung; beginnende Infiltrate bds. Basal", + 347: "Thorax: deutliche Überblähung der peripheren Lungenanteile, vereinzelt kleinere Bullä; keine Frakturen, gleiche Belüftung", + 361: "Thorax: großes Herz, geringgradige Stauung der Lunge, Belüftung seitengleich", + 370: "Thorax: Normalbefund;", + 375: "sgl Belüftung; beginnende Infiltrate bds. Basal, kleine Ergüsse", + 376: "inhomogene Verschattungen, bds zentrale Infiltrate", + 377: "Thorax: Zwerchfellhochstand bds.; Belüftung sgl.; keine Frakturzeichen", + 381: "Rippenserienfraktur re. 4-7; Mantelpneu re. ca 3 cm; wenig Blut im unteren Resessus re.; beginnendes Hautemphysem re. lateral; Lunge seitengleich ventiliert", + 382: "Thorax: Lobärpneumonie links; deutliche Überblähung der peripheren Lungenanteile, vereinzelt kleinere Bullä; seitengleiche Belüftung", + 388: "Thorax: Normalbefund;", + 389: "Thorax: Normalbefund;", + 401: "Rippenserienfraktur re. 4-7; Mantelpneu re. ca 1,5 cm; wenig Blut im unteren Resessus re.; Lunge seitengleich ventiliert", + 414: "leichte Stauungszeichen hilär", + 418: "Thorax: Normalbefund;", + 422: "Thorax: Normalbefund;", + 427: "inhomogene Verschattungen, bds zentrale Infiltrate, Zwerchfellhochstand", + 428: "Thorax: Normalbefund;", + 429: "Thorax: Zwerchfellhochstand bds.; Belüftung sgl.; keine Frakturzeichen", + 432: "Thorax: Normalbefund;", + 435: "Sternumfraktur im mittleren Drittel", + 445: "Thorax: seitengleiche Belüftung; keine Ergüsse; kein Pneu; Rippenserienfraktur rechts lateral 3-6;", + 446: "Pleuraergüsse bds, Lunge inhomogen verschattet, Belüftung seitengleich, Thoraxskelet oB;", + 457: "linke Lunge deutlich überbläht, Mediastinum dezent nach links verschoben; mehrere große Bullae; basal bds Infiltrate, Herz grenzwertig groß wie bei Rechtsbelastung", + 460: "inhomogene Verschattungen, bds zentrale Infiltrate. Zwerchfellhochstand", + 471: "seitengleiche Belüftung; keine Ergüsse; kein Pneu; nicht dislozierte, sternumnahe Fraktur 4.Rippe li.;", + 479: "Schrittmacheraggregat links subclavikulär, Kabel an loco tipico, Lunge dezent parahilär gestaut, keine Ergüsse;", + 485: "Rippenserienfraktur re. 4-7; kompletter Pneumothorax re. mit Verlagerung des gesamten Mediastinums; ausgedehntes Hautemphysem; Lunge nur links ventiliert", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.TRAUMA_CT, + defaults={ + "name": "Trauma CT", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": True, + "application_duration": 300, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 3, + "lab_devices": [str(MaterialIDs.COMPUTERTOMOGRAPHIE)], + "area": None, + "role": [ + {role_map[RoleIDs.MTRA]: 1}, + {role_map[RoleIDs.ARZT]: 1}, + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": { + "Trauma-CT": { + 100: "deutlich vergrößertes Herz, Aorta elongiert, Belüftung oB. Extremitäten: Normalbefund; keine Frakturzeichen;", + 105: "inhomogene Verschattungen, bds zentrale Infiltrate, Zwerchfellhochstand Extremitäten: Normalbefund; keine Frakturzeichen; Lunge wie bei ARDS; zentrales vermutlich gekapseltes Hämatom abdominal ca 2 L", + 106: "Thorax: Normalbefund; Spiralfraktur rechter Oberarm; sonst keine Frakturen HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", + 108: "leichte Stauungszeichen hilär komplette Unterarmfraktur re.", + 112: "Rippenserienfraktur re. 4-7; Mantelpneu re. ca 3 cm; wenig Blut im unteren Resessus re.; beginnendes Hautemphysem re. lateral; Lunge seitengleich ventiliert fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.; HWS: oB:; Becken: oB:; Schädel: oB.;", + 121: "Thorax: Normalbefund; komplette Unterarmfraktur li. mit dezenter Verschiebung. HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", + 123: "inhomogene Verschattungen, bds zentrale Infiltrate. Zwerchfellhochstand Extremitäten: Normalbefund; keine Frakturzeichen; Lunge wie bei ARDS; zentrales gekapseltes Hämatom abdominal mind 2 L", + 130: "seitengleiche Belüftung; keine Ergüsse; kein Pneu; nicht dislozierte, sternumnahe Fraktur 4.Rippe li.; Oberarmamputation li.; sonst keine Frakturzeichen oder Fremdkörper; HWS: oB.; Becken: oB.;", + 135: "Rippenserienfraktur re. 4-7; Mantelpneu re. ca 1,5 cm; wenig Blut im unteren Resessus re.; Lunge seitengleich ventiliert fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.; HWS: oB:; Becken: oB:; Schädel: oB.;", + 136: "inhomogene Verschattungen, bds zentrale Infiltrate Extremitäten: Normalbefund; keine Frakturzeichen; Lunge wie bei ARDS; kleines zentrales Hämatom abdominal ca. 300 ml", + 137: "Rippenserienfraktur re. 4-7; kompletter Pneumothorax re. mit Verlagerung des gesamten Mediastinums; ausgedehntes Hautemphysem; Lunge nur links ventiliert fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.; HWS: oB:; Becken: oB:; Schädel: oB.;", + 148: "Lunge noch deutlich überwässert; Pleuraergüsse bds. Extremitäten: Normalbefund; keine Frakturzeichen;", + 152: "sgl Belüftung; beginnende Infiltrate bds. Basal, kleine Ergüsse Extremitäten: Normalbefund; keine Frakturzeichen; mind. 1 L Aszites; Pankreas aufgelockert, mehrere Pseudozysten", + 159: "Thorax: Normalbefund; Oberschenkelfraktur re; HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", + 161: "minimale pulmonale Stauungszeichen im Hilusbereich, seitengleiche Belüftung; Metallcerclage wie nach Sternotomie;", + 162: "Thorax: deutliche Überblähung der peripheren Lungenanteile, vereinzelt kleinere Bullä; keine Frakturen, gleiche Belüftung Extremitäten: Normalbefund; keine Frakturzeichen; HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", + 173: "Thorax: Zwerchfellhochstand bds.; Belüftung sgl.; keine Frakturzeichen Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; mind 2 l Blut im Abdomen; Leber fraglich rupturiert.", + 174: "Thorax: großes Herz, geringgradige Stauung der Lunge, Belüftung seitengleich HüftTEP; sonst keine Auffälligkeiten", + 175: "sgl Belüftung; beginnende Infiltrate bds. Basal Extremitäten: Normalbefund; keine Frakturzeichen;", + 176: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; HWS: oB.; Becken: oB.; Schädel: knöchern oB.; ca 1 cm großes Subduralhämatom li frontal; dezente Mittelllinienverschiebung; beginnendes Hirnödem linkshemisphärisch;", + 185: "inhomogene Verschattungen, bds zentrale Infiltrate, Zwerchfellhochstand Extremitäten: Normalbefund; keine Frakturzeichen; Lunge wie bei ARDS; zentrales ausgedehntes Hämatom abdominal mind 2 - 2,5 L", + 189: "Rippenserienfraktur re. 4-7; Lunge seitengleich ventiliert fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.; HWS: oB:; Becken: oB:; Schädel: oB.;", + 191: "Thorax: Zwerchfellhochstand bds.; Belüftung sgl.; keine Frakturzeichen Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; mind 3 l Blut im Abdomen; Leber fraglich rupturiert.", + 196: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; Dünndarmschlingen aufgetrieben, Darmwand im Ileumbereich deutlich verdickt, ca. 200 ml freie Flüssigkeit", + 205: "Thorax: Normalbefund; Dislozierte Handgelenksfraktur; sonst keine Frakturen HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", + 207: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; mind 1 l Blut im Abdomen; Leber fraglich rupturiert.", + 209: "minimale pulmonale Stauungszeichen im Hilusbereich, seitengleiche Belüftung Oberschenkeltrummerfraktur re.", + 221: "Sternumfraktur im mittleren Drittel Sprunggelenksfraktur mit deutlicher Dislokation", + 228: "Thorax: Normalbefund; nicht dislozierte Sprunggelengsfraktur; sonst Extr. OB. HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: Nasenbeinfraktu; fragliche Orbitabodenfraktur re.; fragliche Fissur Occipital; keine ICB, keine Raumforderung;", + 236: "linke Lunge deutlich überbläht, Mediastinum dezent nach links verschoben; mehrere große Bullae; basal bds Infiltrate, Herz grenzwertig groß wie bei Rechtsbelastung Extremitäten: Normalbefund; keine Frakturzeichen;", + 237: "Thorax: seitengleiche Belüftung; keine Ergüsse; kein Pneu; Rippenserienfraktur rechts lateral 3-6; Extremitäten: Oberschenkelfraktur bds. im mittleren Drittel;", + 238: "Pleuraergüsse bds, Lunge inhomogen verschattet, Belüftung seitengleich, Thoraxskelet oB; Extremitäten: Normalbefund; keine Frakturzeichen;", + 242: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", + 243: "Schrittmacheraggregat links subclavikulär, Kabel an loco tipico, Lunge dezent parahilär gestaut, keine Ergüsse; Extremitäten: Normalbefund; keine Frakturzeichen;", + 248: "Rippenserienfraktur re. 3-7 ohne Pneu Trümmerfraktur des distalen US re.; komplette proximale Unterarmfraktur re.", + 260: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; mehrere Fremdkörper in beiden Händen; HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", + 269: "Pneumothorax re. ca. 2 cm Oberschenkelschaftfraktur li mit Fehlstellung", + 273: "Thorax: Lobärpneumonie links; deutliche Überblähung der peripheren Lungenanteile, vereinzelt kleinere Bullä; seitengleiche Belüftung Extremitäten: Normalbefund; keine Frakturzeichen; Pneumonische Infiltrate links und beginnend rechts, kleiner Pleuraerguss re.", + 274: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; mind 1,5 l Blut im Abdomen; Leber fraglich rupturiert.", + 281: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; HWS: oB.; Becken: oB.; Schädel: knöchern oB.; ca 1 cm großes Subduralhämatom li frontal; keine Mittelllinienverschiebung; kein Hirnödem;", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ULTRASCHALL_ABDOMEN, + defaults={ + "name": "Ultraschall Abdomen", + "category": Action.Category.EXAMINATION, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 120, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": [str(MaterialIDs.SONOGRAPHIE)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + "results": { + "Ultraschall": { + 502: "schlechte Untersuchungsbedingungen; mind 2-3 L freie Flüssigkeit im gesamten Abdomen", + 509: "Leber inhomogen, keine Aszites", + 513: "wenig freie Flüssigkeit im kleinen Becken", + 519: "freie Flüssigkeit im kleinen Becken (ca 100 ml)", + 522: "fraglich kleines Hämatom im mittleren Abdomenbereich", + 541: "schlechte Untersuchungsbedingungen; Darmwand im Ileumbereich deutlich verdickt, ca. 500 ml freie Flüssigkeit im Douglas und um die Leber", + 559: "deutlich freie Flüssigkeit im kleinen Becken (> 500 ml) und um die Leber", + 565: "massiv freie Flüssigkeit im gesamten Abdomen (> 2000 ml)", + 566: "Schlechte Untersuchungsbedingugen. Freie Flüssigkeit auszuschließen.", + 571: "reichlich Aszites; Leber oB.; Pankreas aufgelockert, mehrere Pseudozysten", + 585: "Abdomen o.B.; V.a. Pneumothorax re.", + 589: "keine Pleuraergüsse; keine freie Flüssigkeit im Abdomen; Bauch- und Beckenorgane o.B.", + 591: "großes Hämatom im mittleren Abdomenbereich, viel gekapselte Flüssigkeit um die Aorta", + 612: "großes Hämatom im mittleren Abdomenbereich, viel gekapselte Flüssigkeit um die Aorta", + 614: "freie Flüssigkeit im kleinen Becken und um die Milz", + 615: "Abdomen; Normalbefund; keine pathologischen Veränderungen; Thorax: keine Ergüsse sichtbar", + 621: "Abdomen o.B.; Schwangerschaft mit vitalem Kind", + 624: "schlechte Untersuchungsbedingungen; viel freie Flüssigkeit im Becken und um die Leber", + 626: "schlechte Untersuchungsbedingungen; massive freie Flüssigkeit im gesamten Abdomen", + 647: "Abdomen; Normalbefund; keine pathologischen Veränderungen;", + 658: "sehr großes Hämatom im mittleren Abdomenbereich, massiv Flüssigkeit um die Aorta", + 665: "schlechte Untersuchungsbedingungen; mind 1,5 L freie Flüssigkeit im Becken und um die Leber", + 686: "deutlich verkleinerte Leber mit erhöhter Dichte, mind 1,5 L Aszites", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ULTRASCHALL_THORAX, + defaults={ + "name": "Ultraschall Thorax", + "category": Action.Category.EXAMINATION, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 60, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": [str(MaterialIDs.SONOGRAPHIE)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + "results": { + "Ultraschall": { + 502: "schlechte Untersuchungsbedingungen; mind 2-3 L freie Flüssigkeit im gesamten Abdomen", + 509: "Leber inhomogen, keine Aszites", + 513: "wenig freie Flüssigkeit im kleinen Becken", + 519: "freie Flüssigkeit im kleinen Becken (ca 100 ml)", + 522: "fraglich kleines Hämatom im mittleren Abdomenbereich", + 541: "schlechte Untersuchungsbedingungen; Darmwand im Ileumbereich deutlich verdickt, ca. 500 ml freie Flüssigkeit im Douglas und um die Leber", + 559: "deutlich freie Flüssigkeit im kleinen Becken (> 500 ml) und um die Leber", + 565: "massiv freie Flüssigkeit im gesamten Abdomen (> 2000 ml)", + 566: "Schlechte Untersuchungsbedingugen. Freie Flüssigkeit auszuschließen.", + 571: "reichlich Aszites; Leber oB.; Pankreas aufgelockert, mehrere Pseudozysten", + 585: "Abdomen o.B.; V.a. Pneumothorax re.", + 589: "keine Pleuraergüsse; keine freie Flüssigkeit im Abdomen; Bauch- und Beckenorgane o.B.", + 591: "großes Hämatom im mittleren Abdomenbereich, viel gekapselte Flüssigkeit um die Aorta", + 612: "großes Hämatom im mittleren Abdomenbereich, viel gekapselte Flüssigkeit um die Aorta", + 614: "freie Flüssigkeit im kleinen Becken und um die Milz", + 615: "Abdomen; Normalbefund; keine pathologischen Veränderungen; Thorax: keine Ergüsse sichtbar", + 621: "Abdomen o.B.; Schwangerschaft mit vitalem Kind", + 624: "schlechte Untersuchungsbedingungen; viel freie Flüssigkeit im Becken und um die Leber", + 626: "schlechte Untersuchungsbedingungen; massive freie Flüssigkeit im gesamten Abdomen", + 647: "Abdomen; Normalbefund; keine pathologischen Veränderungen;", + 658: "sehr großes Hämatom im mittleren Abdomenbereich, massiv Flüssigkeit um die Aorta", + 665: "schlechte Untersuchungsbedingungen; mind 1,5 L freie Flüssigkeit im Becken und um die Leber", + 686: "deutlich verkleinerte Leber mit erhöhter Dichte, mind 1,5 L Aszites", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.KREUZBLUT, + defaults={ + "name": "Kreuzblut", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 2700, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.BLUTGRUPPE_BESTIMMEN), + str(ActionIDs.BLUTABNAHME), + ], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [str(MaterialIDs.BLUTBANK)], + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + "results": { + "Kreuzblut": { + 1000: "Erfolg! Das getestete Blut ist kompatibel.", + 1001: "Misserfolg! Das getestete Blut ist inkompatibel.", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.BLUTGRUPPE_BESTIMMEN, + defaults={ + "name": "Blutgruppe bestimmen", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 180, + "effect_duration": None, + "conditions": { + "required_actions": [str(ActionIDs.BLUTABNAHME)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [str(MaterialIDs.BLUTBANK)], + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + "results": { + "Blutgruppe": { + 1: "A Rh pos", + 2: "B Rh pos", + 3: "A rh neg", + 4: "0 Rh pos", + 5: "B rh neg", + 6: "AB rh neg", + 7: "O rh neg", + 8: "AB Rh pos", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.HAEMOGLOBINANALYSE, + defaults={ + "name": "Hämoglobinanalyse", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 120, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.BLUTABNAHME) + ], # This is WIP, as you actually need to have done a blood draw per action + # with blood draw as requirement, which also need to be unique per patient + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [ + [ + str(MaterialIDs.LAB_GERAET_1), + str(MaterialIDs.BLUTGASANALYSE), + ] + ], + "area": None, + "role": [ + [ + {role_map[RoleIDs.ARZT]: 1}, + {role_map[RoleIDs.LABORASSISTENT]: 1}, + ], + ], + }, + "results": { + "Hb": { + 400: 9.5, + 401: 12, + 402: 16, + 403: 11, + 404: 5.5, + 405: 13, + 406: 7.5, + 407: 6, + 408: 9, + 409: 3.5, + 410: 3, + 411: 13, + 412: 17, + 413: 8, + 414: 2.5, + 415: 8.5, + 416: 17, + 417: 6.5, + 418: 12, + 419: 7, + 420: 11, + 421: 14, + 422: 10, + 423: 15, + 424: 16, + 425: 4, + 426: 2, + 427: 15, + 428: 5, + 429: 4.5, + 430: 14, + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.LACTATANALYSE, + defaults={ + "name": "Lactatanalyse", # can also be written as "Laktatanalyse" + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 120, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.BLUTABNAHME) + ], # This is WIP, as you actually need to have done a blood draw per action + # with blood draw as requirement, which also need to be unique per patient + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [str(MaterialIDs.LAB_GERAET_1)], + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": { + "Lactat": { + 140: "negativ", + 141: "stark positiv", + 142: "negativ", + 143: "stark positiv", + 144: "grenzwertig positiv", + 145: "grenzwertig positiv", + 146: "negativ", + 147: "grenzwertig positiv", + 148: "stark positiv", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.GERINNUNGSANALYSE, + defaults={ + "name": "Gerinnungsanalyse", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 120, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.BLUTABNAHME) + ], # This is WIP, as you actually need to have done a blood draw per action + # with blood draw as requirement, which also need to be unique per patient + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [str(MaterialIDs.LAB_GERAET_2)], + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + "results": { + "Gerinnung": { + 100: "leichte Einschränkung", + 101: "Normalwerte", + 102: "leichte Einschränkung", + 103: "leichte Einschränkung", + 104: "Normalwerte", + 105: "Normalwerte", + 106: "schwere Einschränkung", + 107: "schwere Einschränkung", + 108: "schwere Einschränkung", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.LEBERANALYSE, + defaults={ + "name": "Leberanalyse", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 120, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.BLUTABNAHME) + ], # This is WIP, as you actually need to have done a blood draw per action + # with blood draw as requirement, which also need to be unique per patient + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [str(MaterialIDs.LAB_GERAET_3)], + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + "results": { + "Leber": { + 110: "Normalwerte", + 111: "leichte Einschränkung", + 112: "schwere Einschränkung", + 113: "schwere Einschränkung", + 114: "leichte Einschränkung", + 115: "Normalwerte", + 116: "leichte Einschränkung", + 117: "Normalwerte", + 118: "schwere Einschränkung", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.NIERENANALYSE, + defaults={ + "name": "Nierenanalyse", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 120, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.BLUTABNAHME) + ], # This is WIP, as you actually need to have done a blood draw per action + # with blood draw as requirement, which also need to be unique per patient + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [str(MaterialIDs.LAB_GERAET_3)], + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + "results": { + "Niere": { + 120: "schwere Einschränkung", + 121: "schwere Einschränkung", + 122: "Normalwerte", + 123: "leichte Einschränkung", + 124: "leichte Einschränkung", + 125: "leichte Einschränkung", + 126: "Normalwerte", + 127: "Normalwerte", + 128: "schwere Einschränkung", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.INFARKTANALYSE, + defaults={ + "name": "Infarktanalyse", + "category": Action.Category.EXAMINATION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 120, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.BLUTABNAHME) + ], # This is WIP, as you actually need to have done a blood draw per action + # with blood draw as requirement, which also need to be unique per patient + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [str(MaterialIDs.LAB_GERAET_3)], + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + "results": { + "Infarkt": { + 130: "stark positiv", + 131: "negativ", + 132: "stark positiv", + 133: "negativ", + 134: "grenzwertig positiv", + 135: "negativ", + 136: "stark positiv", + 137: "grenzwertig positiv", + 138: "grenzwertig positiv", + } + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.LYOPHILISIERTES_FRISCHPLASMA_VORBEREITEN, + defaults={ + "name": "Lyophilisiertes Frischplasma auflösen", + "category": Action.Category.PRODUCTION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 600, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": { + "produced_material": {str(MaterialIDs.LYOPHILISIERTES_FRISCHPLASMA): 1} + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.LYOPHILISIERTES_FRISCHPLASMA_ANWENDEN, + defaults={ + "name": "Lyophilisiertes Frischplasma anwenden", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 120, # depends on type of "Zugang" + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": [str(MaterialIDs.LYOPHILISIERTES_FRISCHPLASMA)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.FRESH_FROZEN_PLASMA_VORBEREITEN, + defaults={ + "name": "Fresh Frozen Plasma auftauen", + "category": Action.Category.PRODUCTION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 420, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [str(MaterialIDs.WAERMEGERAET_FUER_BLUTPRODUKTE)], + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": {"produced_material": {str(MaterialIDs.FRESH_FROZEN_PLASMA): 1}}, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.FRESH_FROZEN_PLASMA_ANWENDEN, + defaults={ + "name": "Fresh Frozen Plasma anwenden", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": 120, # depends on type of "Zugang" + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": [str(MaterialIDs.FRESH_FROZEN_PLASMA)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ERYTHROZYTENKONZENTRATE_VORBEREITEN, + defaults={ + "name": "Erythrozytenkonzentrat erwärmen", + "category": Action.Category.PRODUCTION, + "location": Action.Location.LAB, + "relocates": False, + "application_duration": 360, + "effect_duration": None, + "conditions": { + "required_actions": None, + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, + "lab_devices": [str(MaterialIDs.WAERMEGERAET_FUER_BLUTPRODUKTE)], + "area": None, + "role": [ + {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, + ], + }, + "results": { + "produced_material": {str(MaterialIDs.ERYTHROZYTENKONZENTRAT): 1} + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN, + defaults={ + "name": "Erythrozytenkonzentrate anwenden", + "category": Action.Category.TREATMENT, + "location": Action.Location.BEDSIDE, + "relocates": False, + "application_duration": 15, + "effect_duration": None, + "conditions": { + "required_actions": [ + str(ActionIDs.IV_ZUGANG), + ], + "prohibitive_actions": None, + "material": [str(MaterialIDs.ERYTHROZYTENKONZENTRAT)], + "num_personnel": 1, + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) + Action.objects.update_or_create( + uuid=ActionIDs.OP_EINLEITEN, + defaults={ + "name": "Operation einleiten", + "category": Action.Category.TREATMENT, + "location": Action.Location.LAB, + "relocates": True, + "application_duration": 360000, # 100h to assure that the operation never finishes during an exercise + "effect_duration": None, + "conditions": { + "required_actions": [str(ActionIDs.IV_ZUGANG)], + "prohibitive_actions": None, + "material": None, + "num_personnel": 1, # garbage values + "lab_devices": None, + "area": None, + "role": [ + {role_map[RoleIDs.ARZT]: 1}, + ], + }, + }, + ) diff --git a/backend/dps_training_k/template/fixtures/patient_state_1004.json b/backend/dps_training_k/data/fixtures/patient_state_1004.json similarity index 100% rename from backend/dps_training_k/template/fixtures/patient_state_1004.json rename to backend/dps_training_k/data/fixtures/patient_state_1004.json diff --git a/backend/dps_training_k/template/fixtures/patient_states.json b/backend/dps_training_k/data/fixtures/patient_states.json similarity index 100% rename from backend/dps_training_k/template/fixtures/patient_states.json rename to backend/dps_training_k/data/fixtures/patient_states.json diff --git a/backend/dps_training_k/data/materials_data.py b/backend/dps_training_k/data/materials_data.py new file mode 100644 index 00000000..6dc41124 --- /dev/null +++ b/backend/dps_training_k/data/materials_data.py @@ -0,0 +1,246 @@ +from template.constants import MaterialIDs +from template.models import Material + + +def update_or_create_materials(): + Material.objects.update_or_create( + uuid=MaterialIDs.ERYTHROZYTENKONZENTRAT, + defaults={ + "name": "Erythrozytenkonzentrat", + "category": Material.Category.BLOOD, + "is_reusable": False, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.FRESH_FROZEN_PLASMA, + defaults={ + "name": "Fresh Frozen Plasma", + "category": Material.Category.BLOOD, + "is_reusable": False, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.LYOPHILISIERTES_FRISCHPLASMA, + defaults={ + "name": "Lyophilisiertes Frischplasma", + "category": Material.Category.BLOOD, + "is_reusable": False, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.WAERMEGERAET_FUER_BLUTPRODUKTE, + defaults={ + "name": "Blutwärmer", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + "is_lab": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.LAB_GERAET_1, + defaults={ + "name": "Gerät 1", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + "is_lab": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.LAB_GERAET_2, + defaults={ + "name": "Gerät 2", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + "is_lab": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.LAB_GERAET_3, + defaults={ + "name": "Gerät 3", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + "is_lab": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.SONOGRAPHIE, + defaults={ + "name": "Sonographie", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.EKG, + defaults={ + "name": "EKG-Gerät", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.COMPUTERTOMOGRAPHIE, + defaults={ + "name": "Computertomographie", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + "is_lab": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.ROENTGENGERAET, + defaults={ + "name": "Röntgengerät", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + "is_lab": True, + }, # in reality there also exist mobile devices + ) + Material.objects.update_or_create( + uuid=MaterialIDs.ZVD_MESSGERAET, + defaults={ + "name": "ZVD-Messgerät", # ZVD = Zentraler Venendruck + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.BZ_MESSGERAET, + defaults={ + "name": "BZ-Messgerät", # BZ = Blutzucker + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.BEATMUNGSGERAET_TRAGBAR, + defaults={ + "name": "Beatmungsgerät (Tragbar)", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.BEATMUNGSGERAET_STATIONAER, + defaults={ + "name": "Beatmungsgerät (Stationäres)", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.BEATMUNGSGERAET_CPAP, + defaults={ + "name": "Beatmungsgerät (CPAP)", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.SAUERSTOFF_TRAGBAR, + defaults={ + "name": "Sauerstoff (Tragbarer)", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.SAUERSTOFF_STATIONAER, + defaults={ + "name": "Sauerstoff (Stationärer)", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.DEFI_TRANSKUTANER_PACER, + defaults={ + "name": "Defi + transkutaner Pacer", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.PASSAGERER_PACER, + defaults={ + "name": "Passagerer Pacer", + "category": Material.Category.DEVICE, + "is_reusable": False, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.PERFUSORPUMPE, + defaults={ + "name": "Perfusorpumpe", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.NARKOSEGERAET, + defaults={ + "name": "Narkosegerät", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.BLUTGASANALYSE, + defaults={ + "name": "Blutgasanalysegerät", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, # in reality there also exist stationary devices + ) + Material.objects.update_or_create( + uuid=MaterialIDs.BLUTBANK, + defaults={ + "name": "Blutbank", # Not really a device but more of a location in a hospital + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": False, + "is_lab": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.BEATMUNGSBEUTEL, + defaults={ + "name": "Beatmungsbeutel", + "category": Material.Category.DEVICE, + "is_reusable": False, + "is_moveable": True, + }, + ) + Material.objects.update_or_create( + uuid=MaterialIDs.SPRITZENPUMPE, + defaults={ + "name": "Spritzenpumpe", + "category": Material.Category.DEVICE, + "is_reusable": True, + "is_moveable": True, + }, + ) diff --git a/backend/dps_training_k/data/subconditions_data.py b/backend/dps_training_k/data/subconditions_data.py new file mode 100644 index 00000000..256f47b6 --- /dev/null +++ b/backend/dps_training_k/data/subconditions_data.py @@ -0,0 +1,296 @@ +from template.constants import ActionIDs, MaterialIDs +from template.models import Subcondition + +CUSTOM_MAXINT = 100000 # doesn't matter, people shouldn't be doing the same thing 100000 times anyway + + +def update_or_create_subconditions(): + """ + name="Lyse", // name of subcondition + upper_limit=CUSTOM_MAXINT, // maximum number of occurrences of fulfilling actions or fulfilling materials + lower_limit=1, // minimum number of occurrences of fulfilling actions or fulfilling materials + fulfilling_measures={ + "actions": {str(ActionIDs.LYSE_VERARBREICHEN): 1}, + "materials": {}, + }, // actions / materials that fulfill this subcondition. everything is or-connected. and-connection is not possible with current implementation + """ + + # corresponds to "Lyse" + Subcondition.objects.update_or_create( + name="Lyse", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": {str(ActionIDs.LYSE_VERARBREICHEN): 1}, + "materials": {}, + }, + ) + # corresponds to "4 EK´s" + Subcondition.objects.update_or_create( + name="4 EK´s", + upper_limit=CUSTOM_MAXINT, + lower_limit=4, + fulfilling_measures={ + "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, + "materials": {}, + }, + ) + # corresponds to "Infusion" + Subcondition.objects.update_or_create( + name="0-1l Infusion", + upper_limit=999, + lower_limit=0, + fulfilling_measures={ + "actions": { + str(ActionIDs.VOLLELEKTROLYT_1000): 1000, + str(ActionIDs.VOLLELEKTROLYT_500): 500, + }, + "materials": {}, + }, + ) + Subcondition.objects.update_or_create( + name="1-2l Infusion", + upper_limit=1999, + lower_limit=1000, + fulfilling_measures={ + "actions": { + str(ActionIDs.VOLLELEKTROLYT_1000): 1000, + str(ActionIDs.VOLLELEKTROLYT_500): 500, + }, + "materials": {}, + }, + ) + Subcondition.objects.update_or_create( + name="2-3l Infusion", + upper_limit=2999, + lower_limit=2000, + fulfilling_measures={ + "actions": { + str(ActionIDs.VOLLELEKTROLYT_1000): 1000, + str(ActionIDs.VOLLELEKTROLYT_500): 500, + }, + "materials": {}, + }, + ) + Subcondition.objects.update_or_create( + name="3l-inf Infusion", + upper_limit=CUSTOM_MAXINT, + lower_limit=3000, + fulfilling_measures={ + "actions": { + str(ActionIDs.VOLLELEKTROLYT_1000): 1000, + str(ActionIDs.VOLLELEKTROLYT_500): 500, + }, + "materials": {}, + }, + ) + # corresponds to "2l Infusion" + Subcondition.objects.update_or_create( + name="2l Infusion", + upper_limit=CUSTOM_MAXINT, + lower_limit=2000, + fulfilling_measures={ + "actions": { + str(ActionIDs.VOLLELEKTROLYT_1000): 1000, + str(ActionIDs.VOLLELEKTROLYT_500): 500, + }, + "materials": {}, + }, + ) + # corresponds to "Thoraxdrainage/ Pleurapunktion" + Subcondition.objects.update_or_create( + name="Thoraxdrainage/ Pleurapunktion", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": { + str(ActionIDs.THORAXDRAINAGE): 1, + str(ActionIDs.PLEURAPUNKTION): 1, + }, + "materials": {}, + }, + ) + # corresponds to "Glucose" + Subcondition.objects.update_or_create( + name="Glucose", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": {str(ActionIDs.GLUCOSE_VERABREICHEN): 1}, + "materials": {}, + }, + ) + # corresponds to "Nitrat" + Subcondition.objects.update_or_create( + name="Nitrat", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": {str(ActionIDs.NITRAT): 1}, + "materials": {}, + }, + ) + # corresponds to O2 + Subcondition.objects.update_or_create( + name="O2", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": { + str(ActionIDs.SAUERSTOFF_ANBRINGEN): 1, + str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN): 1, + }, + "materials": {}, + }, + ) + # corresponds to "OP läuft / ist gelaufen" as well as "keine OP" + Subcondition.objects.update_or_create( + name="OP läuft / ist gelaufen", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={"actions": {}, "materials": {}}, + ) + # corresponds to "Analgesie" + Subcondition.objects.update_or_create( + name="Analgesie", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": {str(ActionIDs.ANALGETIKUM): 1}, + "materials": {}, + }, + ) + # corresponds to "O2 Inhalation" + Subcondition.objects.update_or_create( + name="O2 Inhalation", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": { + str(ActionIDs.SAUERSTOFF_ANBRINGEN): 1, + str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN): 1, + }, + "materials": {}, + }, + ) + # corresponds to "CPAP" + Subcondition.objects.update_or_create( + name="CPAP", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": {str(ActionIDs.CPAP_BEATMUNGSGERAET_ANBRINGEN): 1}, + "materials": {}, + }, + ) + # corresponds to "Antiasthmatikum" + Subcondition.objects.update_or_create( + name="Antiasthmatikum", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": {str(ActionIDs.ANTIASTHMATIKUM): 1}, + "materials": {}, + }, + ) + # corresponds to "Sedativum" + Subcondition.objects.update_or_create( + name="Sedativum", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": {str(ActionIDs.SEDATIVUM): 1}, + "materials": {}, + }, + ) + # corresponds to "freie Atemwege" + Subcondition.objects.update_or_create( + name="freie Atemwege", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": { + str(ActionIDs.STABILE_SEITENLAGE): 1, + str(ActionIDs.GUEDELTUBUS): 1, + str(ActionIDs.WENDELTUBUS): 1, + str(ActionIDs.TRACHEALTUBUS): 1, + str(ActionIDs.LARYNXMASKE): 1, + str(ActionIDs.LARYNXTUBUS): 1, + }, + "materials": {}, + }, + ) + # corresponds to "EK´s" + Subcondition.objects.update_or_create( + name="0-1 EK´s", + upper_limit=1, + lower_limit=0, + fulfilling_measures={ + "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, + "materials": {}, + }, + ) + Subcondition.objects.update_or_create( + name="2-3 EK´s", + upper_limit=3, + lower_limit=2, + fulfilling_measures={ + "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, + "materials": {}, + }, + ) + Subcondition.objects.update_or_create( + name="4-5 EK´s", + upper_limit=5, + lower_limit=4, + fulfilling_measures={ + "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, + "materials": {}, + }, + ) + Subcondition.objects.update_or_create( + name="6-inf EK´s", + upper_limit=CUSTOM_MAXINT, + lower_limit=6, + fulfilling_measures={ + "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, + "materials": {}, + }, + ) + # corresponds to "Beatmet" + Subcondition.objects.update_or_create( + name="Beatmet", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": {str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN): 1}, + "materials": { + str(MaterialIDs.BEATMUNGSGERAET_STATIONAER): 1, + str(MaterialIDs.BEATMUNGSGERAET_TRAGBAR): 1, + }, + }, + ) + # corresponds to Blutstillung + Subcondition.objects.update_or_create( + name="Blutstillung", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": {str(ActionIDs.CHIR_BLUTSTILLUNG): 1}, + "materials": {}, + }, + ) + # corresponds to "Regional-/ Vollnarkose" + Subcondition.objects.update_or_create( + name="Regional-/ Vollnarkose", + upper_limit=CUSTOM_MAXINT, + lower_limit=1, + fulfilling_measures={ + "actions": { + str(ActionIDs.REGIONAL_NARKOSE): 1, + str(ActionIDs.REGIONAL_NARKOTIKUM): 1, + str(ActionIDs.NARKOTIKUM): 1, + }, + "materials": {}, + }, + ) diff --git a/backend/dps_training_k/template/management/commands/import_actions.py b/backend/dps_training_k/template/management/commands/import_actions.py index ba1f438b..a509f004 100644 --- a/backend/dps_training_k/template/management/commands/import_actions.py +++ b/backend/dps_training_k/template/management/commands/import_actions.py @@ -1,2443 +1,13 @@ from django.core.management.base import BaseCommand -from template.constants import ActionIDs, MaterialIDs, RoleIDs, role_map -from template.models import Action +from data.actions_data import update_or_create_actions class Command(BaseCommand): help = "Populates the database with minimal action list" def handle(self, *args, **kwargs): - self.create_actions() + update_or_create_actions() self.stdout.write( self.style.SUCCESS("Successfully added actions to the database") ) - - @staticmethod - def create_actions(): - """ - "category": Action.Category.TREATMENT, // category as defined in Action, short form - "location": BE, // location where action is conducted - "relocates": false // boolean indicating whether action relocates the patient or not - "application_duration: 60, // application duration in seconds - "effect_duration": 60, // effect duration in seconds; None means permanent - "conditions": { - "required_actions": ["A1uuid", "A2uuid", ["A3uuid", "A4uuid"]], // this means action1 AND action2 AND (action3 OR action4); can be None - "prohibitive_actions": ["A1uuid", "A2uuid", ["A3uuid", "A4uuid"]], // this means action1 AND action2 AND (action3 OR action4); can be None - "material": ["M1uuid", "M2uuid", ["M3uuid", "M4uuid"]], // material1 AND material2 AND (material3 OR material4); can be None - "num_personnel": 3, // number of personnel required, must be specified -> CANNOT be None - "lab_devices": ["L1uuid", "L2uuid", ["L3uuid", "L4uuid"]], // labdev1 AND labdev2 AND (labdev3 OR labdev4); can be None - "area": "ZNA", // area patient has to be in for action to be applicable; can be None - "role": [{"Pflegefachkraft": 1}, [{"Arzt": 1}, {"Laborassistent": 1}]] // this means 1 Pflegefachkraft AND (1 Arzt OR 1 Laborassistent); CANNOT be None - 'results': { - "produced_material": {uuid, amount} - "ZVD": {code: value} //for every possible examination - } - } - """ - - Action.objects.update_or_create( - uuid=ActionIDs.BLUTABNAHME, - defaults={ - "name": "Blut abnehmen", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [str(ActionIDs.ART_KANUELE)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.THORAXDRAINAGE, - defaults={ - "name": "Thoraxdrainage", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 300, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.PLEURAPUNKTION, - defaults={ - "name": "Pleurapunktion", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 60, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.TRACHEALTUBUS, - defaults={ - "name": "Trachealtubus", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 120, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": [ - str(ActionIDs.TRACHEALTUBUS), - str(ActionIDs.LARYNXTUBUS), - str(ActionIDs.GUEDELTUBUS), - ], - "material": [str(MaterialIDs.BEATMUNGSBEUTEL)], - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.LARYNXMASKE, - defaults={ - "name": "Larynxmaske", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 60, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": [str(MaterialIDs.BEATMUNGSBEUTEL)], - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.LARYNXTUBUS, - defaults={ - "name": "Larynxtubus", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 60, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": [str(MaterialIDs.BEATMUNGSBEUTEL)], - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.GUEDELTUBUS, - defaults={ - "name": "Guedeltubus", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.WENDELTUBUS, - defaults={ - "name": "Wendeltubus", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.KONIOTOMIETUBUS, - defaults={ - "name": "Koniotomietubus", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 180, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [ - [str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)] - ], - "prohibitive_actions": None, - "material": None, - "num_personnel": 3, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 2}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ANALGETIKUM, - defaults={ - "name": "Analgetikum", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 600, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.ZVK)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ANTIASTHMATIKUM, - defaults={ - "name": "Antiasthmatikum", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 600, # None means permanent - "conditions": { - "required_actions": None, # Vernebler oder Inhalator - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.KORTIKOSTEROID, - defaults={ - "name": "Kortikosteroid", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 1800, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.NITRAT, - defaults={ - "name": "Nitrat", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 600, # None means permanent - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.DIURETIKUM, - defaults={ - "name": "Diuretikum", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 1200, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.KATECHOLAMIN, - defaults={ - "name": "Katecholamin", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 60, # None means permanent - "conditions": { - "required_actions": [ - [str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)] - ], - "prohibitive_actions": None, - "material": [str(MaterialIDs.SPRITZENPUMPE)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.SEDATIVUM, - defaults={ - "name": "Sedativum", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 600, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.REGIONAL_NARKOTIKUM, - defaults={ - "name": "Regional-Narkotikum", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, # "Freifeld", dunno how do handle that - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, # Spritze und S.C. Kanüle? - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.TETANUSPROPHYLAXE, - defaults={ - "name": "Tetanusprophylaxe", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, # Spritze und I.M. Kanüle? - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ANTIKOAGULANZ, - defaults={ - "name": "Antikoagulanz", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.NARKOTIKUM, - defaults={ - "name": "(Voll-)Narkotikum", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": [str(MaterialIDs.NARKOSEGERAET)], - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ANTIBIOTIKUM, - defaults={ - "name": "Antibioktikum", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, # None means permanent - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.VOLLELEKTROLYT_1000, - defaults={ - "name": "Vollelektrolyt 1000ml", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, # Depends of type of "Zugang" - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.VOLLELEKTROLYT_500, - defaults={ - "name": "Vollelektrolyt 500ml", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, # Depends of type of "Zugang" - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.PLASMAEXPANDER, - defaults={ - "name": "Plasmaexpander", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 120, # Depends of type of "Zugang" - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.IV_ZUGANG, - defaults={ - "name": "i.V. Zugang", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 60, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ZVK, - defaults={ - "name": "ZVK", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 300, - "effect_duration": 360, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.SCHLEUSE, - defaults={ - "name": "Schleuse", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 240, - "effect_duration": 60, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ART_KANUELE, - defaults={ - "name": "art. Kanüle", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 120, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.MEHRLUMEN_ZVK, - defaults={ - "name": "mehrlumen ZVK", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 240, - "effect_duration": 420, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.REGIONAL_NARKOSE, - defaults={ - "name": "Regional-Narkose", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 60, - "effect_duration": None, # abhängig von Medikament - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.DRUCKVERBAND, - defaults={ - "name": "Druckverband", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.TURNIQUET, - defaults={ - "name": "Turniquet", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.WUNDVERSORGUNG, - defaults={ - "name": "Wundversorgung", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.CHIR_BLUTSTILLUNG, - defaults={ - "name": "chir. Blutstillung", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 180, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.STIFNECK, - defaults={ - "name": "Stifneck", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 2}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.VAKUUMSCHIENE, - defaults={ - "name": "Vakuumschiene", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 60, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 2}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.BECKENSCHLINGE, - defaults={ - "name": "Beckenschlinge", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 2}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.GIPSVERBAND, - defaults={ - "name": "Gipsverband", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 300, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.STABILE_SEITENLAGE, - defaults={ - "name": "Stabile Seitenlage", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.SCHOCKLAGE, - defaults={ - "name": "Schocklage", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.DEFI_TRANSKUTANER_PACER, - defaults={ - "name": "Defi + transkutaner Pacer", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.IV_ZUGANG), - [str(ActionIDs.NARKOTIKUM), str(ActionIDs.ANALGETIKUM)], - ], - "prohibitive_actions": None, - "material": [str(MaterialIDs.DEFI_TRANSKUTANER_PACER)], - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.BEATMUNGSGERAET_ANBRINGEN, - defaults={ - "name": "Beatmungsgerät anbringen", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.TRACHEALTUBUS), - ], - "prohibitive_actions": [ - str(ActionIDs.CPAP_BEATMUNGSGERAET_ANBRINGEN) - ], - "material": [ - [ - str(MaterialIDs.BEATMUNGSGERAET_STATIONAER), - str(MaterialIDs.BEATMUNGSGERAET_TRAGBAR), - ] - ], - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.CPAP_BEATMUNGSGERAET_ANBRINGEN, - defaults={ - "name": "CPAP-Beatmungsgerät anbringen", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": [str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN)], - "material": [ - [ - str(MaterialIDs.BEATMUNGSGERAET_CPAP), - ] - ], - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.SAUERSTOFF_ANBRINGEN, - defaults={ - "name": "Sauerstoff anbringen", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": [ - [ - str(MaterialIDs.SAUERSTOFF_TRAGBAR), - str(MaterialIDs.SAUERSTOFF_STATIONAER), - ] - ], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.BLUTDRUCK_MESSEN, - defaults={ - "name": "Blutdruck messen", - "category": Action.Category.EXAMINATION, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "Blutdruck": { - 400: "140/90", - 401: "150/90", - 402: "100/40", - 403: "90/50", - 404: "80/50", - 405: "100/60", - 406: "110/60", - 407: "100/50", - 408: "130/90", - 409: "80/35", - 410: "100/45", - 411: "150/85", - 412: "220/125", - 413: "120/50", - 414: "170/100", - 415: "80/65", - 416: "180/105", - 417: "130/60", - 418: "170/70", - 419: "180/85", - 420: "200/90", - 421: "180/90", - 422: "200/105", - 423: "80/55", - 424: "80/40", - 425: "210/120", - 426: "170/75", - 427: "150/75", - 428: "70/50", - 429: "140/100", - 430: "110/80", - 431: "140/75", - 432: "120/55", - 433: "60/45", - 434: "160/80", - 435: "100/80", - 436: "180/95", - 437: "160/110", - 438: "180/75", - 439: "140/80", - 440: "210/115", - 441: "220/100", - 442: "70/40", - 443: "100/75", - 444: "170/85", - 445: "110/45", - 446: "120/80", - 447: "70/55", - 448: "150/95", - 449: "150/80", - 450: "60/40", - 451: "100/65", - 452: "210/110", - 453: "120/70", - 454: "200/110", - 455: "110/50", - 456: "140/85", - 457: "170/90", - 458: "190/90", - 459: "160/100", - 460: "210/80", - 461: "160/85", - 462: "130/65", - 463: "90/40", - 464: "80/60", - 465: "160/75", - 466: "190/80", - 467: "140/65", - 468: "220/95", - 469: "200/95", - 470: "150/70", - 471: "190/85", - 472: "90/75", - 473: "90/60", - 474: "90/45", - 475: "110/85", - 476: "190/75", - 477: "100/70", - 478: "170/95", - 479: "n.m.", - 480: "130/75", - 481: "190/100", - 482: "210/100", - 483: "220/105", - 484: "110/55", - 485: "90/65", - 486: "220/90", - 487: "160/95", - 488: "220/115", - 489: "170/110", - 490: "200/80", - 491: "200/100", - 492: "140/70", - 493: "210/95", - 494: "150/65", - 495: "170/105", - 496: "110/70", - 497: "70/45", - 498: "170/80", - 499: "150/100", - 500: "210/85", - 501: "190/105", - 502: "120/60", - 503: "180/70", - 504: "80/45", - 505: "210/90", - 506: "130/85", - 507: "200/120", - 508: "140/60", - 509: "100/55", - 510: "140/95", - 511: "60/50", - 512: "180/110", - 513: "190/110", - 514: "210/105", - 515: "90/55", - 516: "120/90", - 517: "160/105", - 518: "110/75", - 519: "130/55", - 520: "110/65", - 521: "200/115", - 522: "180/100", - 523: "120/75", - 524: "120/65", - 525: "150/105", - 526: "220/85", - 527: "120/85", - 528: "180/80", - 529: "160/70", - 530: "50/40", - 531: "130/80", - 532: "130/95", - 533: "220/110", - 534: "190/95", - 535: "200/85", - 536: "90/70", - 537: "160/90", - 538: "220/120", - 539: "130/70", - 540: "190/115", - 541: "n.m.", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.SAETTIGUNGSMESSGERAET_ANBRINGEN, - defaults={ - "name": "Sättigungsmessgerät anbringen", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.PASSAGEREN_PACER_ANBRINGEN, - defaults={ - "name": "passageren Pacer anbringen", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.IV_ZUGANG), - str(ActionIDs.ANALGETIKUM), - ], - "prohibitive_actions": None, - "material": [str(MaterialIDs.PASSAGERER_PACER)], - "num_personnel": 2, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.PERFUSORPUMPE_AKTIVIEREN, - defaults={ - "name": "Perfusorpumpe aktivieren", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [ - [str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)] - ], - "prohibitive_actions": None, - "material": [str(MaterialIDs.PERFUSORPUMPE)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.PERFUSORPUMPE_MIT_WIRKSTOFF_BESTUECKEN, - defaults={ - "name": "Perfusorpumpe mit Wirkstoff bestücken", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": [str(MaterialIDs.PERFUSORPUMPE)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.GLUCOSE_VERABREICHEN, - defaults={ - "name": "Glucose verabreichen", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [ - [str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)] - ], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.LYSE_VERARBREICHEN, - defaults={ - "name": "Lyse verabreichen", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [ - [str(ActionIDs.IV_ZUGANG), str(ActionIDs.ZVK)] - ], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.BLUTGASEANALYSE, - defaults={ - "name": "Blutgaseanalyse", - "category": Action.Category.EXAMINATION, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [str(ActionIDs.ART_KANUELE)], - "prohibitive_actions": None, - "material": [str(MaterialIDs.BLUTGASANALYSE)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "BGA-Oxy": { - 600: "schwere Hypoxie", - 601: "leichte Hypoxie", - 602: "gute Oxygenierung", - 603: "schwere Hypoxie", - 604: "mäßige Hypoxie", - 605: "leichte Hypoxie", - 606: "mäßige Hypoxie", - 607: "gute Oxygenierung", - 608: "leichte Hypoxie", - 609: "leichte Hypoxie", - 610: "gute Oxygenierung", - 611: "schwere Hypoxie", - 612: "gute Oxygenierung", - 613: "nicht verwertbar", - 614: "mäßige Hypoxie", - 615: "schwere Hypoxie", - }, - "BGA-SBH": { - 650: "resp. Alkalose", - 651: "kompensierte resp. Alkalose", - 652: "kompensierte metabol. Alkalose", - 653: "metabol. Alkalose", - 654: "resp. Alkalose", - 655: "kompensierte resp. Alkalose", - 656: "ausgeglichener SBH", - 657: "kompensierte resp. Azidose", - 658: "kompensierte metab. Azidose", - 659: "resp. Azidose", - 660: "kompensierte resp. Azidose", - 661: "metabol. Azidose", - 662: "kompensierte resp. Azidose", - 663: "resp. Azidose", - 664: "kompensierte resp. Azidose", - 665: "ausgeglichener SBH", - 666: "kompensierte resp. Alkalose", - 667: "metabol. Azidose", - 668: "resp. Azidose", - 669: "kompensierte metab. Azidose", - 670: "ausgeglichener SBH", - 671: "resp. Azidose", - 672: "kompensierte metab. Azidose", - 673: "metabol. Azidose", - 674: "resp. Alkalose", - 675: "kompensierte metabol. Alkalose", - 676: "ausgeglichener SBH", - 677: "kompensierte resp. Alkalose", - 678: "metabol. Alkalose", - 679: "resp. Alkalose", - 680: "kompensierte metabol. Alkalose", - 681: "metabol. Alkalose", - 682: "kompensierte metabol. Alkalose", - 683: "metabol. Alkalose", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.BLUTZUCKER_ANALYSIEREN, - defaults={ - "name": "Blutzucker analysieren", - "category": Action.Category.EXAMINATION, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": [str(MaterialIDs.BZ_MESSGERAET)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "BZ": { - 900: 265, - 901: 275, - 902: 170, - 903: 285, - 904: 160, - 905: 395, - 906: 125, - 907: "low", - 908: 155, - 909: 165, - 910: 190, - 911: 355, - 912: 130, - 913: 60, - 914: 180, - 915: 50, - 916: 95, - 917: 245, - 918: 30, - 919: 140, - 920: 120, - 921: 335, - 922: 150, - 923: 175, - 924: 55, - 925: 315, - 926: 135, - 927: 85, - 928: 110, - 929: 70, - 930: 80, - 931: 375, - 932: 195, - 933: 45, - 934: 100, - 935: 35, - 936: 75, - 937: 185, - 938: 365, - 939: 205, - 940: "high", - 941: 225, - 942: 90, - 943: 255, - 944: 215, - 945: 20, - 946: 325, - 947: 15, - 948: 385, - 949: 305, - 950: 65, - 951: 40, - 952: 235, - 953: 105, - 954: 115, - 955: 145, - 956: 25, - 957: 295, - 958: 345, - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.EKG_ANBRINGEN, - defaults={ - "name": "EKG anbringen", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 60, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": [str(MaterialIDs.EKG)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.EKG_ABLESEN, - defaults={ - "name": "EKG ablesen", - "category": Action.Category.EXAMINATION, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [str(ActionIDs.EKG_ANBRINGEN)], - "prohibitive_actions": None, - "material": [str(MaterialIDs.EKG)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "EKG": { - 701: "Absolute Arrhythmie,Linksschenkelblock", - 702: "Sinusrhythmus,ST-Streckensenkungen", - 703: "Schrittmacherrythmus", - 707: "AV-Block III", - 709: "Sinusrhythmus,Rechtsschenkelblock", - 714: "breite Kammerkomplexe", - 716: "Asystolie", - 719: "Kammerflimmern", - 721: "ST-Streckenhebungen, Hinterwandinfarkt", - 722: "Sinusrhythmus", - 725: "Sinusrhythmus,vereinzelt Salven", - 726: "Absolute Arrhythmie,ST-Streckensenkungen", - 728: "Absolute Arrhythmie,Rechtsschenkelblock", - 730: "Absolute Arrhythmie,vereinzelt Salven", - 735: "ST-Streckenhebungen, Hinterwandinfarkt", - 737: "Sinusrhythmus,vereinzelt sVES", - 739: "Absolute Arrhythmie,vereinzelt VES", - 746: "Sinusrhythmus,Linksschenkelblock", - 747: "Absolute Arrhythmie", - 748: "Sinusrhythmus,vereinzelt VES", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ZENTRALEN_VENENDRUCK_MESSEN, - defaults={ - "name": "Zentralen Venendruck messen", - "category": Action.Category.EXAMINATION, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [str(ActionIDs.ZVK)], - "prohibitive_actions": None, - "material": [str(MaterialIDs.ZVD_MESSGERAET)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "ZVD": { - 800: 16, - 801: 12, - 802: -5, - 803: 14, - 804: 6, - 805: 1, - 806: -14, - 807: 13, - 808: 17, - 809: 19, - 810: 3, - 811: -12, - 812: 9, - 813: 5, - 814: -3, - 815: -10, - 816: -15, - 817: -9, - 818: 22, - 819: 21, - 820: 11, - 821: 4, - 822: 0, - 823: -2, - 824: 10, - 825: -13, - 826: 23, - 827: -6, - 828: -7, - 829: -8, - 830: 20, - 831: -4, - 832: 15, - 833: 8, - 834: 18, - 835: -11, - 836: 7, - 837: 2, - 838: -1, - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.EXTREMITAETEN_ROENTGEN, - defaults={ - "name": "Extremitäten Röntgen", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": True, - "application_duration": 240, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": [str(MaterialIDs.ROENTGENGERAET)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.MTRA]: 1}, - ], - }, - "results": { - "Rö-Extremitäten": { - 511: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", - 512: "Dislozierte Handgelenksfraktur; sonst keine Frakturen", - 520: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 523: "HüftTEP; sonst keine Auffälligkeiten", - 524: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 525: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 527: "Extremitäten: Oberschenkelfraktur bds. im mittleren Drittel;", - 530: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 558: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", - 559: "Spiralfraktur rechter Oberarm; sonst keine Frakturen", - 563: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", - 564: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 566: "Oberschenkelfraktur re;", - 567: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 571: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 573: "komplette Unterarmfraktur li. mit dezenter Verschiebung;", - 579: "Extremitäten: Normalbefund; keine Frakturzeichen; mehrere Fremdkörper in beiden Händen;", - 584: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 586: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 590: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 591: "fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.;", - 600: "nicht dislozierte Sprunggelengsfraktur; sonst Extr. OB.", - 602: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 607: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", - 608: "Sprunggelenksfraktur mit deutlicher Dislokation", - 609: "fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.;", - 617: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", - 619: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 625: "Trümmerfraktur des distalen US re.; komplette proximale Unterarmfraktur re.", - 637: "Oberschenkeltrummerfraktur re.", - 640: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", - 649: "Oberschenkelschaftfraktur li mit Fehlstellung", - 650: "Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper;", - 652: "fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.;", - 664: "Oberarmamputation li.; sonst keine Frakturzeichen oder Fremdkörper;", - 675: "fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.;", - 680: "komplette Unterarmfraktur re.", - 681: "Extremitäten: Normalbefund; keine Frakturzeichen;", - 682: "Extremitäten: Normalbefund; keine Frakturzeichen;", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.THORAX_ROENTGEN, - defaults={ - "name": "Thorax Röntgen", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": True, - "application_duration": 240, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": [str(MaterialIDs.ROENTGENGERAET)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.MTRA]: 1}, - ], - }, - "results": { - "Rö-Thorax": { - 305: "Lunge noch deutlich überwässert; Pleuraergüsse bds.", - 306: "Thorax: Normalbefund;", - 307: "Thorax: Normalbefund;", - 312: "inhomogene Verschattungen, bds zentrale Infiltrate, Zwerchfellhochstand", - 314: "minimale pulmonale Stauungszeichen im Hilusbereich, seitengleiche Belüftung", - 324: "Rippenserienfraktur re. 4-7; Lunge seitengleich ventiliert", - 327: "minimale pulmonale Stauungszeichen im Hilusbereich, seitengleiche Belüftung; Metallcerclage wie nach Sternotomie;", - 334: "deutlich vergrößertes Herz, Aorta elongiert, Belüftung oB.", - 336: "Thorax: Normalbefund;", - 339: "Thorax: Normalbefund;", - 340: "Pneumothorax re. ca. 2 cm", - 341: "Thorax: Normalbefund;", - 342: "Rippenserienfraktur re. 3-7 ohne Pneu", - 343: "sgl Belüftung; beginnende Infiltrate bds. Basal", - 347: "Thorax: deutliche Überblähung der peripheren Lungenanteile, vereinzelt kleinere Bullä; keine Frakturen, gleiche Belüftung", - 361: "Thorax: großes Herz, geringgradige Stauung der Lunge, Belüftung seitengleich", - 370: "Thorax: Normalbefund;", - 375: "sgl Belüftung; beginnende Infiltrate bds. Basal, kleine Ergüsse", - 376: "inhomogene Verschattungen, bds zentrale Infiltrate", - 377: "Thorax: Zwerchfellhochstand bds.; Belüftung sgl.; keine Frakturzeichen", - 381: "Rippenserienfraktur re. 4-7; Mantelpneu re. ca 3 cm; wenig Blut im unteren Resessus re.; beginnendes Hautemphysem re. lateral; Lunge seitengleich ventiliert", - 382: "Thorax: Lobärpneumonie links; deutliche Überblähung der peripheren Lungenanteile, vereinzelt kleinere Bullä; seitengleiche Belüftung", - 388: "Thorax: Normalbefund;", - 389: "Thorax: Normalbefund;", - 401: "Rippenserienfraktur re. 4-7; Mantelpneu re. ca 1,5 cm; wenig Blut im unteren Resessus re.; Lunge seitengleich ventiliert", - 414: "leichte Stauungszeichen hilär", - 418: "Thorax: Normalbefund;", - 422: "Thorax: Normalbefund;", - 427: "inhomogene Verschattungen, bds zentrale Infiltrate, Zwerchfellhochstand", - 428: "Thorax: Normalbefund;", - 429: "Thorax: Zwerchfellhochstand bds.; Belüftung sgl.; keine Frakturzeichen", - 432: "Thorax: Normalbefund;", - 435: "Sternumfraktur im mittleren Drittel", - 445: "Thorax: seitengleiche Belüftung; keine Ergüsse; kein Pneu; Rippenserienfraktur rechts lateral 3-6;", - 446: "Pleuraergüsse bds, Lunge inhomogen verschattet, Belüftung seitengleich, Thoraxskelet oB;", - 457: "linke Lunge deutlich überbläht, Mediastinum dezent nach links verschoben; mehrere große Bullae; basal bds Infiltrate, Herz grenzwertig groß wie bei Rechtsbelastung", - 460: "inhomogene Verschattungen, bds zentrale Infiltrate. Zwerchfellhochstand", - 471: "seitengleiche Belüftung; keine Ergüsse; kein Pneu; nicht dislozierte, sternumnahe Fraktur 4.Rippe li.;", - 479: "Schrittmacheraggregat links subclavikulär, Kabel an loco tipico, Lunge dezent parahilär gestaut, keine Ergüsse;", - 485: "Rippenserienfraktur re. 4-7; kompletter Pneumothorax re. mit Verlagerung des gesamten Mediastinums; ausgedehntes Hautemphysem; Lunge nur links ventiliert", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.TRAUMA_CT, - defaults={ - "name": "Trauma CT", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": True, - "application_duration": 300, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 3, - "lab_devices": [str(MaterialIDs.COMPUTERTOMOGRAPHIE)], - "area": None, - "role": [ - {role_map[RoleIDs.MTRA]: 1}, - {role_map[RoleIDs.ARZT]: 1}, - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "Trauma-CT": { - 100: "deutlich vergrößertes Herz, Aorta elongiert, Belüftung oB. Extremitäten: Normalbefund; keine Frakturzeichen;", - 105: "inhomogene Verschattungen, bds zentrale Infiltrate, Zwerchfellhochstand Extremitäten: Normalbefund; keine Frakturzeichen; Lunge wie bei ARDS; zentrales vermutlich gekapseltes Hämatom abdominal ca 2 L", - 106: "Thorax: Normalbefund; Spiralfraktur rechter Oberarm; sonst keine Frakturen HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", - 108: "leichte Stauungszeichen hilär komplette Unterarmfraktur re.", - 112: "Rippenserienfraktur re. 4-7; Mantelpneu re. ca 3 cm; wenig Blut im unteren Resessus re.; beginnendes Hautemphysem re. lateral; Lunge seitengleich ventiliert fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.; HWS: oB:; Becken: oB:; Schädel: oB.;", - 121: "Thorax: Normalbefund; komplette Unterarmfraktur li. mit dezenter Verschiebung. HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", - 123: "inhomogene Verschattungen, bds zentrale Infiltrate. Zwerchfellhochstand Extremitäten: Normalbefund; keine Frakturzeichen; Lunge wie bei ARDS; zentrales gekapseltes Hämatom abdominal mind 2 L", - 130: "seitengleiche Belüftung; keine Ergüsse; kein Pneu; nicht dislozierte, sternumnahe Fraktur 4.Rippe li.; Oberarmamputation li.; sonst keine Frakturzeichen oder Fremdkörper; HWS: oB.; Becken: oB.;", - 135: "Rippenserienfraktur re. 4-7; Mantelpneu re. ca 1,5 cm; wenig Blut im unteren Resessus re.; Lunge seitengleich ventiliert fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.; HWS: oB:; Becken: oB:; Schädel: oB.;", - 136: "inhomogene Verschattungen, bds zentrale Infiltrate Extremitäten: Normalbefund; keine Frakturzeichen; Lunge wie bei ARDS; kleines zentrales Hämatom abdominal ca. 300 ml", - 137: "Rippenserienfraktur re. 4-7; kompletter Pneumothorax re. mit Verlagerung des gesamten Mediastinums; ausgedehntes Hautemphysem; Lunge nur links ventiliert fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.; HWS: oB:; Becken: oB:; Schädel: oB.;", - 148: "Lunge noch deutlich überwässert; Pleuraergüsse bds. Extremitäten: Normalbefund; keine Frakturzeichen;", - 152: "sgl Belüftung; beginnende Infiltrate bds. Basal, kleine Ergüsse Extremitäten: Normalbefund; keine Frakturzeichen; mind. 1 L Aszites; Pankreas aufgelockert, mehrere Pseudozysten", - 159: "Thorax: Normalbefund; Oberschenkelfraktur re; HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", - 161: "minimale pulmonale Stauungszeichen im Hilusbereich, seitengleiche Belüftung; Metallcerclage wie nach Sternotomie;", - 162: "Thorax: deutliche Überblähung der peripheren Lungenanteile, vereinzelt kleinere Bullä; keine Frakturen, gleiche Belüftung Extremitäten: Normalbefund; keine Frakturzeichen; HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", - 173: "Thorax: Zwerchfellhochstand bds.; Belüftung sgl.; keine Frakturzeichen Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; mind 2 l Blut im Abdomen; Leber fraglich rupturiert.", - 174: "Thorax: großes Herz, geringgradige Stauung der Lunge, Belüftung seitengleich HüftTEP; sonst keine Auffälligkeiten", - 175: "sgl Belüftung; beginnende Infiltrate bds. Basal Extremitäten: Normalbefund; keine Frakturzeichen;", - 176: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; HWS: oB.; Becken: oB.; Schädel: knöchern oB.; ca 1 cm großes Subduralhämatom li frontal; dezente Mittelllinienverschiebung; beginnendes Hirnödem linkshemisphärisch;", - 185: "inhomogene Verschattungen, bds zentrale Infiltrate, Zwerchfellhochstand Extremitäten: Normalbefund; keine Frakturzeichen; Lunge wie bei ARDS; zentrales ausgedehntes Hämatom abdominal mind 2 - 2,5 L", - 189: "Rippenserienfraktur re. 4-7; Lunge seitengleich ventiliert fragliche Fissur rechter Oberarmkopf; sonstige Extremitäten oB.; HWS: oB:; Becken: oB:; Schädel: oB.;", - 191: "Thorax: Zwerchfellhochstand bds.; Belüftung sgl.; keine Frakturzeichen Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; mind 3 l Blut im Abdomen; Leber fraglich rupturiert.", - 196: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; Dünndarmschlingen aufgetrieben, Darmwand im Ileumbereich deutlich verdickt, ca. 200 ml freie Flüssigkeit", - 205: "Thorax: Normalbefund; Dislozierte Handgelenksfraktur; sonst keine Frakturen HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", - 207: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; mind 1 l Blut im Abdomen; Leber fraglich rupturiert.", - 209: "minimale pulmonale Stauungszeichen im Hilusbereich, seitengleiche Belüftung Oberschenkeltrummerfraktur re.", - 221: "Sternumfraktur im mittleren Drittel Sprunggelenksfraktur mit deutlicher Dislokation", - 228: "Thorax: Normalbefund; nicht dislozierte Sprunggelengsfraktur; sonst Extr. OB. HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: Nasenbeinfraktu; fragliche Orbitabodenfraktur re.; fragliche Fissur Occipital; keine ICB, keine Raumforderung;", - 236: "linke Lunge deutlich überbläht, Mediastinum dezent nach links verschoben; mehrere große Bullae; basal bds Infiltrate, Herz grenzwertig groß wie bei Rechtsbelastung Extremitäten: Normalbefund; keine Frakturzeichen;", - 237: "Thorax: seitengleiche Belüftung; keine Ergüsse; kein Pneu; Rippenserienfraktur rechts lateral 3-6; Extremitäten: Oberschenkelfraktur bds. im mittleren Drittel;", - 238: "Pleuraergüsse bds, Lunge inhomogen verschattet, Belüftung seitengleich, Thoraxskelet oB; Extremitäten: Normalbefund; keine Frakturzeichen;", - 242: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", - 243: "Schrittmacheraggregat links subclavikulär, Kabel an loco tipico, Lunge dezent parahilär gestaut, keine Ergüsse; Extremitäten: Normalbefund; keine Frakturzeichen;", - 248: "Rippenserienfraktur re. 3-7 ohne Pneu Trümmerfraktur des distalen US re.; komplette proximale Unterarmfraktur re.", - 260: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; mehrere Fremdkörper in beiden Händen; HWS: oB.; Becken: oB; Abdomen: oB.; Schädel: oB.;", - 269: "Pneumothorax re. ca. 2 cm Oberschenkelschaftfraktur li mit Fehlstellung", - 273: "Thorax: Lobärpneumonie links; deutliche Überblähung der peripheren Lungenanteile, vereinzelt kleinere Bullä; seitengleiche Belüftung Extremitäten: Normalbefund; keine Frakturzeichen; Pneumonische Infiltrate links und beginnend rechts, kleiner Pleuraerguss re.", - 274: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; mind 1,5 l Blut im Abdomen; Leber fraglich rupturiert.", - 281: "Thorax: Normalbefund; Extremitäten: Normalbefund; keine Frakturzeichen; keine Fremdkörper; HWS: oB.; Becken: oB.; Schädel: knöchern oB.; ca 1 cm großes Subduralhämatom li frontal; keine Mittelllinienverschiebung; kein Hirnödem;", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ULTRASCHALL_ABDOMEN, - defaults={ - "name": "Ultraschall Abdomen", - "category": Action.Category.EXAMINATION, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 120, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": [str(MaterialIDs.SONOGRAPHIE)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - "results": { - "Ultraschall": { - 502: "schlechte Untersuchungsbedingungen; mind 2-3 L freie Flüssigkeit im gesamten Abdomen", - 509: "Leber inhomogen, keine Aszites", - 513: "wenig freie Flüssigkeit im kleinen Becken", - 519: "freie Flüssigkeit im kleinen Becken (ca 100 ml)", - 522: "fraglich kleines Hämatom im mittleren Abdomenbereich", - 541: "schlechte Untersuchungsbedingungen; Darmwand im Ileumbereich deutlich verdickt, ca. 500 ml freie Flüssigkeit im Douglas und um die Leber", - 559: "deutlich freie Flüssigkeit im kleinen Becken (> 500 ml) und um die Leber", - 565: "massiv freie Flüssigkeit im gesamten Abdomen (> 2000 ml)", - 566: "Schlechte Untersuchungsbedingugen. Freie Flüssigkeit auszuschließen.", - 571: "reichlich Aszites; Leber oB.; Pankreas aufgelockert, mehrere Pseudozysten", - 585: "Abdomen o.B.; V.a. Pneumothorax re.", - 589: "keine Pleuraergüsse; keine freie Flüssigkeit im Abdomen; Bauch- und Beckenorgane o.B.", - 591: "großes Hämatom im mittleren Abdomenbereich, viel gekapselte Flüssigkeit um die Aorta", - 612: "großes Hämatom im mittleren Abdomenbereich, viel gekapselte Flüssigkeit um die Aorta", - 614: "freie Flüssigkeit im kleinen Becken und um die Milz", - 615: "Abdomen; Normalbefund; keine pathologischen Veränderungen; Thorax: keine Ergüsse sichtbar", - 621: "Abdomen o.B.; Schwangerschaft mit vitalem Kind", - 624: "schlechte Untersuchungsbedingungen; viel freie Flüssigkeit im Becken und um die Leber", - 626: "schlechte Untersuchungsbedingungen; massive freie Flüssigkeit im gesamten Abdomen", - 647: "Abdomen; Normalbefund; keine pathologischen Veränderungen;", - 658: "sehr großes Hämatom im mittleren Abdomenbereich, massiv Flüssigkeit um die Aorta", - 665: "schlechte Untersuchungsbedingungen; mind 1,5 L freie Flüssigkeit im Becken und um die Leber", - 686: "deutlich verkleinerte Leber mit erhöhter Dichte, mind 1,5 L Aszites", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ULTRASCHALL_THORAX, - defaults={ - "name": "Ultraschall Thorax", - "category": Action.Category.EXAMINATION, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 60, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": [str(MaterialIDs.SONOGRAPHIE)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - "results": { - "Ultraschall": { - 502: "schlechte Untersuchungsbedingungen; mind 2-3 L freie Flüssigkeit im gesamten Abdomen", - 509: "Leber inhomogen, keine Aszites", - 513: "wenig freie Flüssigkeit im kleinen Becken", - 519: "freie Flüssigkeit im kleinen Becken (ca 100 ml)", - 522: "fraglich kleines Hämatom im mittleren Abdomenbereich", - 541: "schlechte Untersuchungsbedingungen; Darmwand im Ileumbereich deutlich verdickt, ca. 500 ml freie Flüssigkeit im Douglas und um die Leber", - 559: "deutlich freie Flüssigkeit im kleinen Becken (> 500 ml) und um die Leber", - 565: "massiv freie Flüssigkeit im gesamten Abdomen (> 2000 ml)", - 566: "Schlechte Untersuchungsbedingugen. Freie Flüssigkeit auszuschließen.", - 571: "reichlich Aszites; Leber oB.; Pankreas aufgelockert, mehrere Pseudozysten", - 585: "Abdomen o.B.; V.a. Pneumothorax re.", - 589: "keine Pleuraergüsse; keine freie Flüssigkeit im Abdomen; Bauch- und Beckenorgane o.B.", - 591: "großes Hämatom im mittleren Abdomenbereich, viel gekapselte Flüssigkeit um die Aorta", - 612: "großes Hämatom im mittleren Abdomenbereich, viel gekapselte Flüssigkeit um die Aorta", - 614: "freie Flüssigkeit im kleinen Becken und um die Milz", - 615: "Abdomen; Normalbefund; keine pathologischen Veränderungen; Thorax: keine Ergüsse sichtbar", - 621: "Abdomen o.B.; Schwangerschaft mit vitalem Kind", - 624: "schlechte Untersuchungsbedingungen; viel freie Flüssigkeit im Becken und um die Leber", - 626: "schlechte Untersuchungsbedingungen; massive freie Flüssigkeit im gesamten Abdomen", - 647: "Abdomen; Normalbefund; keine pathologischen Veränderungen;", - 658: "sehr großes Hämatom im mittleren Abdomenbereich, massiv Flüssigkeit um die Aorta", - 665: "schlechte Untersuchungsbedingungen; mind 1,5 L freie Flüssigkeit im Becken und um die Leber", - 686: "deutlich verkleinerte Leber mit erhöhter Dichte, mind 1,5 L Aszites", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.KREUZBLUT, - defaults={ - "name": "Kreuzblut", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 2700, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.BLUTGRUPPE_BESTIMMEN), - str(ActionIDs.BLUTABNAHME), - ], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [str(MaterialIDs.BLUTBANK)], - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - "results": { - "Kreuzblut": { - 1000: "Erfolg! Das getestete Blut ist kompatibel.", - 1001: "Misserfolg! Das getestete Blut ist inkompatibel.", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.BLUTGRUPPE_BESTIMMEN, - defaults={ - "name": "Blutgruppe bestimmen", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 180, - "effect_duration": None, - "conditions": { - "required_actions": [str(ActionIDs.BLUTABNAHME)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [str(MaterialIDs.BLUTBANK)], - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - "results": { - "Blutgruppe": { - 1: "A Rh pos", - 2: "B Rh pos", - 3: "A rh neg", - 4: "0 Rh pos", - 5: "B rh neg", - 6: "AB rh neg", - 7: "O rh neg", - 8: "AB Rh pos", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.HAEMOGLOBINANALYSE, - defaults={ - "name": "Hämoglobinanalyse", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 120, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.BLUTABNAHME) - ], # This is WIP, as you actually need to have done a blood draw per action - # with blood draw as requirement, which also need to be unique per patient - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [ - [ - str(MaterialIDs.LAB_GERAET_1), - str(MaterialIDs.BLUTGASANALYSE), - ] - ], - "area": None, - "role": [ - [ - {role_map[RoleIDs.ARZT]: 1}, - {role_map[RoleIDs.LABORASSISTENT]: 1}, - ], - ], - }, - "results": { - "Hb": { - 400: 9.5, - 401: 12, - 402: 16, - 403: 11, - 404: 5.5, - 405: 13, - 406: 7.5, - 407: 6, - 408: 9, - 409: 3.5, - 410: 3, - 411: 13, - 412: 17, - 413: 8, - 414: 2.5, - 415: 8.5, - 416: 17, - 417: 6.5, - 418: 12, - 419: 7, - 420: 11, - 421: 14, - 422: 10, - 423: 15, - 424: 16, - 425: 4, - 426: 2, - 427: 15, - 428: 5, - 429: 4.5, - 430: 14, - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.LACTATANALYSE, - defaults={ - "name": "Lactatanalyse", # can also be written as "Laktatanalyse" - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 120, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.BLUTABNAHME) - ], # This is WIP, as you actually need to have done a blood draw per action - # with blood draw as requirement, which also need to be unique per patient - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [str(MaterialIDs.LAB_GERAET_1)], - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "Lactat": { - 140: "negativ", - 141: "stark positiv", - 142: "negativ", - 143: "stark positiv", - 144: "grenzwertig positiv", - 145: "grenzwertig positiv", - 146: "negativ", - 147: "grenzwertig positiv", - 148: "stark positiv", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.GERINNUNGSANALYSE, - defaults={ - "name": "Gerinnungsanalyse", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 120, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.BLUTABNAHME) - ], # This is WIP, as you actually need to have done a blood draw per action - # with blood draw as requirement, which also need to be unique per patient - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [str(MaterialIDs.LAB_GERAET_2)], - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - "results": { - "Gerinnung": { - 100: "leichte Einschränkung", - 101: "Normalwerte", - 102: "leichte Einschränkung", - 103: "leichte Einschränkung", - 104: "Normalwerte", - 105: "Normalwerte", - 106: "schwere Einschränkung", - 107: "schwere Einschränkung", - 108: "schwere Einschränkung", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.LEBERANALYSE, - defaults={ - "name": "Leberanalyse", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 120, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.BLUTABNAHME) - ], # This is WIP, as you actually need to have done a blood draw per action - # with blood draw as requirement, which also need to be unique per patient - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [str(MaterialIDs.LAB_GERAET_3)], - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - "results": { - "Leber": { - 110: "Normalwerte", - 111: "leichte Einschränkung", - 112: "schwere Einschränkung", - 113: "schwere Einschränkung", - 114: "leichte Einschränkung", - 115: "Normalwerte", - 116: "leichte Einschränkung", - 117: "Normalwerte", - 118: "schwere Einschränkung", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.NIERENANALYSE, - defaults={ - "name": "Nierenanalyse", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 120, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.BLUTABNAHME) - ], # This is WIP, as you actually need to have done a blood draw per action - # with blood draw as requirement, which also need to be unique per patient - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [str(MaterialIDs.LAB_GERAET_3)], - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - "results": { - "Niere": { - 120: "schwere Einschränkung", - 121: "schwere Einschränkung", - 122: "Normalwerte", - 123: "leichte Einschränkung", - 124: "leichte Einschränkung", - 125: "leichte Einschränkung", - 126: "Normalwerte", - 127: "Normalwerte", - 128: "schwere Einschränkung", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.INFARKTANALYSE, - defaults={ - "name": "Infarktanalyse", - "category": Action.Category.EXAMINATION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 120, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.BLUTABNAHME) - ], # This is WIP, as you actually need to have done a blood draw per action - # with blood draw as requirement, which also need to be unique per patient - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [str(MaterialIDs.LAB_GERAET_3)], - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - "results": { - "Infarkt": { - 130: "stark positiv", - 131: "negativ", - 132: "stark positiv", - 133: "negativ", - 134: "grenzwertig positiv", - 135: "negativ", - 136: "stark positiv", - 137: "grenzwertig positiv", - 138: "grenzwertig positiv", - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.LYOPHILISIERTES_FRISCHPLASMA_VORBEREITEN, - defaults={ - "name": "Lyophilisiertes Frischplasma auflösen", - "category": Action.Category.PRODUCTION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 600, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "produced_material": { - str(MaterialIDs.LYOPHILISIERTES_FRISCHPLASMA): 1 - } - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.LYOPHILISIERTES_FRISCHPLASMA_ANWENDEN, - defaults={ - "name": "Lyophilisiertes Frischplasma anwenden", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 120, # depends on type of "Zugang" - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": [str(MaterialIDs.LYOPHILISIERTES_FRISCHPLASMA)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.FRESH_FROZEN_PLASMA_VORBEREITEN, - defaults={ - "name": "Fresh Frozen Plasma auftauen", - "category": Action.Category.PRODUCTION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 420, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [str(MaterialIDs.WAERMEGERAET_FUER_BLUTPRODUKTE)], - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "produced_material": {str(MaterialIDs.FRESH_FROZEN_PLASMA): 1} - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.FRESH_FROZEN_PLASMA_ANWENDEN, - defaults={ - "name": "Fresh Frozen Plasma anwenden", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": 120, # depends on type of "Zugang" - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": [str(MaterialIDs.FRESH_FROZEN_PLASMA)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ERYTHROZYTENKONZENTRATE_VORBEREITEN, - defaults={ - "name": "Erythrozytenkonzentrat erwärmen", - "category": Action.Category.PRODUCTION, - "location": Action.Location.LAB, - "relocates": False, - "application_duration": 360, - "effect_duration": None, - "conditions": { - "required_actions": None, - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, - "lab_devices": [str(MaterialIDs.WAERMEGERAET_FUER_BLUTPRODUKTE)], - "area": None, - "role": [ - {role_map[RoleIDs.PFLEGEFACHKRAFT]: 1}, - ], - }, - "results": { - "produced_material": {str(MaterialIDs.ERYTHROZYTENKONZENTRAT): 1} - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN, - defaults={ - "name": "Erythrozytenkonzentrate anwenden", - "category": Action.Category.TREATMENT, - "location": Action.Location.BEDSIDE, - "relocates": False, - "application_duration": 15, - "effect_duration": None, - "conditions": { - "required_actions": [ - str(ActionIDs.IV_ZUGANG), - ], - "prohibitive_actions": None, - "material": [str(MaterialIDs.ERYTHROZYTENKONZENTRAT)], - "num_personnel": 1, - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) - Action.objects.update_or_create( - uuid=ActionIDs.OP_EINLEITEN, - defaults={ - "name": "Operation einleiten", - "category": Action.Category.TREATMENT, - "location": Action.Location.LAB, - "relocates": True, - "application_duration": 360000, # 100h to assure that the operation never finishes during an exercise - "effect_duration": None, - "conditions": { - "required_actions": [str(ActionIDs.IV_ZUGANG)], - "prohibitive_actions": None, - "material": None, - "num_personnel": 1, # garbage values - "lab_devices": None, - "area": None, - "role": [ - {role_map[RoleIDs.ARZT]: 1}, - ], - }, - }, - ) diff --git a/backend/dps_training_k/template/management/commands/import_material.py b/backend/dps_training_k/template/management/commands/import_material.py index 843e25b8..08b80520 100644 --- a/backend/dps_training_k/template/management/commands/import_material.py +++ b/backend/dps_training_k/template/management/commands/import_material.py @@ -1,258 +1,13 @@ from django.core.management.base import BaseCommand -from template.constants import MaterialIDs -from template.models import Material +from data.materials_data import update_or_create_materials class Command(BaseCommand): help = "Populates the database with material list" def handle(self, *args, **kwargs): - self.create_resources() + update_or_create_materials() self.stdout.write( self.style.SUCCESS("Successfully added material list to the database") ) - - @staticmethod - def create_resources(): - Material.objects.update_or_create( - uuid=MaterialIDs.ERYTHROZYTENKONZENTRAT, - defaults={ - "name": "Erythrozytenkonzentrat", - "category": Material.Category.BLOOD, - "is_reusable": False, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.FRESH_FROZEN_PLASMA, - defaults={ - "name": "Fresh Frozen Plasma", - "category": Material.Category.BLOOD, - "is_reusable": False, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.LYOPHILISIERTES_FRISCHPLASMA, - defaults={ - "name": "Lyophilisiertes Frischplasma", - "category": Material.Category.BLOOD, - "is_reusable": False, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.WAERMEGERAET_FUER_BLUTPRODUKTE, - defaults={ - "name": "Blutwärmer", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - "is_lab": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.LAB_GERAET_1, - defaults={ - "name": "Gerät 1", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - "is_lab": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.LAB_GERAET_2, - defaults={ - "name": "Gerät 2", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - "is_lab": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.LAB_GERAET_3, - defaults={ - "name": "Gerät 3", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - "is_lab": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.SONOGRAPHIE, - defaults={ - "name": "Sonographie", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.EKG, - defaults={ - "name": "EKG-Gerät", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.COMPUTERTOMOGRAPHIE, - defaults={ - "name": "Computertomographie", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - "is_lab": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.ROENTGENGERAET, - defaults={ - "name": "Röntgengerät", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - "is_lab": True, - }, # in reality there also exist mobile devices - ) - Material.objects.update_or_create( - uuid=MaterialIDs.ZVD_MESSGERAET, - defaults={ - "name": "ZVD-Messgerät", # ZVD = Zentraler Venendruck - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.BZ_MESSGERAET, - defaults={ - "name": "BZ-Messgerät", # BZ = Blutzucker - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.BEATMUNGSGERAET_TRAGBAR, - defaults={ - "name": "Beatmungsgerät (Tragbar)", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.BEATMUNGSGERAET_STATIONAER, - defaults={ - "name": "Beatmungsgerät (Stationäres)", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.BEATMUNGSGERAET_CPAP, - defaults={ - "name": "Beatmungsgerät (CPAP)", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.SAUERSTOFF_TRAGBAR, - defaults={ - "name": "Sauerstoff (Tragbarer)", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.SAUERSTOFF_STATIONAER, - defaults={ - "name": "Sauerstoff (Stationärer)", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.DEFI_TRANSKUTANER_PACER, - defaults={ - "name": "Defi + transkutaner Pacer", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.PASSAGERER_PACER, - defaults={ - "name": "Passagerer Pacer", - "category": Material.Category.DEVICE, - "is_reusable": False, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.PERFUSORPUMPE, - defaults={ - "name": "Perfusorpumpe", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.NARKOSEGERAET, - defaults={ - "name": "Narkosegerät", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.BLUTGASANALYSE, - defaults={ - "name": "Blutgasanalysegerät", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, # in reality there also exist stationary devices - ) - Material.objects.update_or_create( - uuid=MaterialIDs.BLUTBANK, - defaults={ - "name": "Blutbank", # Not really a device but more of a location in a hospital - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": False, - "is_lab": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.BEATMUNGSBEUTEL, - defaults={ - "name": "Beatmungsbeutel", - "category": Material.Category.DEVICE, - "is_reusable": False, - "is_moveable": True, - }, - ) - Material.objects.update_or_create( - uuid=MaterialIDs.SPRITZENPUMPE, - defaults={ - "name": "Spritzenpumpe", - "category": Material.Category.DEVICE, - "is_reusable": True, - "is_moveable": True, - }, - ) diff --git a/backend/dps_training_k/template/management/commands/import_patient_states.py b/backend/dps_training_k/template/management/commands/import_patient_states.py index 09a6128a..52a2f125 100644 --- a/backend/dps_training_k/template/management/commands/import_patient_states.py +++ b/backend/dps_training_k/template/management/commands/import_patient_states.py @@ -6,7 +6,7 @@ from django.conf import settings from django.core.management.base import BaseCommand -from template.constants import ActionIDs, MaterialIDs +from data.subconditions_data import update_or_create_subconditions from template.models import PatientState, Subcondition, LogicNode, StateTransition CUSTOM_MAXINT = 100000 # doesn't matter, people shouldn't be doing the same thing 100000 times anyway @@ -17,303 +17,12 @@ class Command(BaseCommand): # this relies on patient_state.transition to be null=True and blank=True def handle(self, *args, **kwargs): - self.create_subconditions() + update_or_create_subconditions() self.create_patient_states_and_transitions() self.stdout.write( self.style.SUCCESS("Successfully added patient states to the database") ) - def create_subconditions(self): - """ - name="Lyse", // name of subcondition - upper_limit=CUSTOM_MAXINT, // maximum number of occurrences of fulfilling actions or fulfilling materials - lower_limit=1, // minimum number of occurrences of fulfilling actions or fulfilling materials - fulfilling_measures={ - "actions": {str(ActionIDs.LYSE_VERARBREICHEN): 1}, - "materials": {}, - }, // actions / materials that fulfill this subcondition. everything is or-connected. and-connection is not possible with current implementation - """ - - # corresponds to "Lyse" - Subcondition.objects.update_or_create( - name="Lyse", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": {str(ActionIDs.LYSE_VERARBREICHEN): 1}, - "materials": {}, - }, - ) - # corresponds to "4 EK´s" - Subcondition.objects.update_or_create( - name="4 EK´s", - upper_limit=CUSTOM_MAXINT, - lower_limit=4, - fulfilling_measures={ - "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, - "materials": {}, - }, - ) - # corresponds to "Infusion" - Subcondition.objects.update_or_create( - name="0-1l Infusion", - upper_limit=999, - lower_limit=0, - fulfilling_measures={ - "actions": { - str(ActionIDs.VOLLELEKTROLYT_1000): 1000, - str(ActionIDs.VOLLELEKTROLYT_500): 500, - }, - "materials": {}, - }, - ) - Subcondition.objects.update_or_create( - name="1-2l Infusion", - upper_limit=1999, - lower_limit=1000, - fulfilling_measures={ - "actions": { - str(ActionIDs.VOLLELEKTROLYT_1000): 1000, - str(ActionIDs.VOLLELEKTROLYT_500): 500, - }, - "materials": {}, - }, - ) - Subcondition.objects.update_or_create( - name="2-3l Infusion", - upper_limit=2999, - lower_limit=2000, - fulfilling_measures={ - "actions": { - str(ActionIDs.VOLLELEKTROLYT_1000): 1000, - str(ActionIDs.VOLLELEKTROLYT_500): 500, - }, - "materials": {}, - }, - ) - Subcondition.objects.update_or_create( - name="3l-inf Infusion", - upper_limit=CUSTOM_MAXINT, - lower_limit=3000, - fulfilling_measures={ - "actions": { - str(ActionIDs.VOLLELEKTROLYT_1000): 1000, - str(ActionIDs.VOLLELEKTROLYT_500): 500, - }, - "materials": {}, - }, - ) - # corresponds to "2l Infusion" - Subcondition.objects.update_or_create( - name="2l Infusion", - upper_limit=CUSTOM_MAXINT, - lower_limit=2000, - fulfilling_measures={ - "actions": { - str(ActionIDs.VOLLELEKTROLYT_1000): 1000, - str(ActionIDs.VOLLELEKTROLYT_500): 500, - }, - "materials": {}, - }, - ) - # corresponds to "Thoraxdrainage/ Pleurapunktion" - Subcondition.objects.update_or_create( - name="Thoraxdrainage/ Pleurapunktion", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": { - str(ActionIDs.THORAXDRAINAGE): 1, - str(ActionIDs.PLEURAPUNKTION): 1, - }, - "materials": {}, - }, - ) - # corresponds to "Glucose" - Subcondition.objects.update_or_create( - name="Glucose", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": {str(ActionIDs.GLUCOSE_VERABREICHEN): 1}, - "materials": {}, - }, - ) - # corresponds to "Nitrat" - Subcondition.objects.update_or_create( - name="Nitrat", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": {str(ActionIDs.NITRAT): 1}, - "materials": {}, - }, - ) - # corresponds to O2 - Subcondition.objects.update_or_create( - name="O2", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": { - str(ActionIDs.SAUERSTOFF_ANBRINGEN): 1, - str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN): 1, - }, - "materials": {}, - }, - ) - # corresponds to "OP läuft / ist gelaufen" as well as "keine OP" - Subcondition.objects.update_or_create( - name="OP läuft / ist gelaufen", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={"actions": {}, "materials": {}}, - ) - # corresponds to "Analgesie" - Subcondition.objects.update_or_create( - name="Analgesie", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": {str(ActionIDs.ANALGETIKUM): 1}, - "materials": {}, - }, - ) - # corresponds to "O2 Inhalation" - Subcondition.objects.update_or_create( - name="O2 Inhalation", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": { - str(ActionIDs.SAUERSTOFF_ANBRINGEN): 1, - str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN): 1, - }, - "materials": {}, - }, - ) - # corresponds to "CPAP" - Subcondition.objects.update_or_create( - name="CPAP", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": {str(ActionIDs.CPAP_BEATMUNGSGERAET_ANBRINGEN): 1}, - "materials": {}, - }, - ) - # corresponds to "Antiasthmatikum" - Subcondition.objects.update_or_create( - name="Antiasthmatikum", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": {str(ActionIDs.ANTIASTHMATIKUM): 1}, - "materials": {}, - }, - ) - # corresponds to "Sedativum" - Subcondition.objects.update_or_create( - name="Sedativum", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": {str(ActionIDs.SEDATIVUM): 1}, - "materials": {}, - }, - ) - # corresponds to "freie Atemwege" - Subcondition.objects.update_or_create( - name="freie Atemwege", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": { - str(ActionIDs.STABILE_SEITENLAGE): 1, - str(ActionIDs.GUEDELTUBUS): 1, - str(ActionIDs.WENDELTUBUS): 1, - str(ActionIDs.TRACHEALTUBUS): 1, - str(ActionIDs.LARYNXMASKE): 1, - str(ActionIDs.LARYNXTUBUS): 1, - }, - "materials": {}, - }, - ) - # corresponds to "EK´s" - Subcondition.objects.update_or_create( - name="0-1 EK´s", - upper_limit=1, - lower_limit=0, - fulfilling_measures={ - "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, - "materials": {}, - }, - ) - Subcondition.objects.update_or_create( - name="2-3 EK´s", - upper_limit=3, - lower_limit=2, - fulfilling_measures={ - "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, - "materials": {}, - }, - ) - Subcondition.objects.update_or_create( - name="4-5 EK´s", - upper_limit=5, - lower_limit=4, - fulfilling_measures={ - "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, - "materials": {}, - }, - ) - Subcondition.objects.update_or_create( - name="6-inf EK´s", - upper_limit=CUSTOM_MAXINT, - lower_limit=6, - fulfilling_measures={ - "actions": {str(ActionIDs.ERYTHROZYTENKONZENTRATE_ANWENDEN): 1}, - "materials": {}, - }, - ) - # corresponds to "Beatmet" - Subcondition.objects.update_or_create( - name="Beatmet", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": {str(ActionIDs.BEATMUNGSGERAET_ANBRINGEN): 1}, - "materials": { - str(MaterialIDs.BEATMUNGSGERAET_STATIONAER): 1, - str(MaterialIDs.BEATMUNGSGERAET_TRAGBAR): 1, - }, - }, - ) - # corresponds to Blutstillung - Subcondition.objects.update_or_create( - name="Blutstillung", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": {str(ActionIDs.CHIR_BLUTSTILLUNG): 1}, - "materials": {}, - }, - ) - # corresponds to "Regional-/ Vollnarkose" - Subcondition.objects.update_or_create( - name="Regional-/ Vollnarkose", - upper_limit=CUSTOM_MAXINT, - lower_limit=1, - fulfilling_measures={ - "actions": { - str(ActionIDs.REGIONAL_NARKOSE): 1, - str(ActionIDs.REGIONAL_NARKOTIKUM): 1, - str(ActionIDs.NARKOTIKUM): 1, - }, - "materials": {}, - }, - ) - def create_patient_states_and_transitions(self): # outer loop to create all patients for code in range(1001, 1042): diff --git a/backend/dps_training_k/template/migrations/0011_alter_patientstate_transition.py b/backend/dps_training_k/template/migrations/0011_alter_patientstate_transition.py new file mode 100644 index 00000000..ee275759 --- /dev/null +++ b/backend/dps_training_k/template/migrations/0011_alter_patientstate_transition.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.1 on 2024-10-12 16:35 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("template", "0010_merge_20240710_1548"), + ] + + operations = [ + migrations.AlterField( + model_name="patientstate", + name="transition", + field=models.ForeignKey( + help_text="Should never be null except for during creation", + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="template.statetransition", + ), + ), + ] diff --git a/backend/dps_training_k/template/models/patient_state.py b/backend/dps_training_k/template/models/patient_state.py index 1a93db34..565f836d 100644 --- a/backend/dps_training_k/template/models/patient_state.py +++ b/backend/dps_training_k/template/models/patient_state.py @@ -16,7 +16,9 @@ class Meta: ) transition = models.ForeignKey( "StateTransition", + help_text="Should never be null except for during creation", on_delete=models.CASCADE, + null=True, ) vital_signs = models.JSONField(help_text="data for patient in current phase") examination_codes = models.JSONField(