From af43e7e4fa2aba7e9bcbba06b0ddb8a0ead4d611 Mon Sep 17 00:00:00 2001 From: Florian Kaiser Date: Sun, 25 Aug 2024 10:59:56 +0200 Subject: [PATCH] Fix regex, change alertingKeywordText --- helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers.py b/helpers.py index 0aa2e9a..4c5f87b 100644 --- a/helpers.py +++ b/helpers.py @@ -1,4 +1,4 @@ -REGEX = r"SDS_ILS_BEGINN(#D#Leitstelle:\s+)(?P\d*)(?Pm|o|i)?(?PRTW|NAW|KTW)? (?PTrauma Gesicht/|Atemnot Akut|Trauma Extremit|Abdomen Akut|Person droht zu spr|Hilflose Person|\S*|) (?P
\D*)(.*) \$GPSN(.*)E(.*)SDS_ILS_ENDE" +REGEX = r"SDS_ILS_BEGINN\s*(#D#Leitstelle:\s*)(?P\d*)(?Pm|o|i)?(?PRTW|NAW|KTW)? (?PTrauma Gesicht\/|Atemnot Akut|Trauma Extremit|Abdomen Akut|Person droht zu spr|Hilflose Person|\S*|)(?P
\D*)(.*) \$GPS\s*N(.*)E(.*)\s*SDS_ILS_ENDE" import os import PyPDF2 @@ -37,7 +37,7 @@ def get_draeger_json(text): data["alertingKeyword"] = "Wachalarm" else: data["alertingKeyword"] = match[0][4] - data["alertingKeywordText"] = match[0][1] + " " + match[0][4] + data["alertingKeywordText"] = match[0][1] + match[0][2] + match[0][3] + " " + match[0][4] data["street"] = match[0][5] data["houseNumber"] = match[0][6]