Added importing of PCR results.

This commit is contained in:
Landon Wark
2023-03-28 14:44:13 -05:00
parent d50a9793c7
commit 3c9f095937
16 changed files with 562 additions and 70 deletions

View File

@@ -1,11 +1,13 @@
'''
Contains miscellaenous functions used by both frontend and backend.
'''
import re
import sys
import numpy as np
import logging
import getpass
from backend.db.models import BasicSubmission, KitType
from typing import Tuple
logger = logging.getLogger(f"submissions.{__name__}")
@@ -115,4 +117,15 @@ def check_if_app(ctx:dict=None) -> bool:
if getattr(sys, 'frozen', False):
return True
else:
return False
return False
def retrieve_rsl_number(in_str:str) -> Tuple[str, str]:
in_str = in_str.split("\\")[-1]
logger.debug(f"Attempting match of {in_str}")
regex = re.compile(r"""
(?P<wastewater>RSL-WW-20\d{6})|(?P<bacterial_culture>RSL-\d{2}-\d{4})
""", re.VERBOSE)
m = regex.search(in_str)
return (m.group(), m.lastgroup)