📄️ 3.1 Introduction to the PSQL Backend
PSQL (Supabase) is used as the backend database for Clinic Edge. It consists of multiple tables for storage and management of data, including case data, patient data, and more. These tables and their associated data interact with each other and represent key components of the Clinic Edge workflow.
📄️ 3.2.10 ref_rx
The ref_rx table in supabase stores the BfArM reference data for pharmacy products and is referenced when patients are prescribed medications.
📄️ 3.2.11 ref_icd
The ref_icd table in supabase stores the ICD-10 diagnosis codes and is referenced when a user assigns a diagnosis to a patient case.
📄️ 3.2.12 classroom_cases
The classroom_cases table in Supabase stores the cases, which are assigned to classrooms.
📄️ 3.2.13 classroom_users
The classroom_users table in Supabase stores the IDs of users assigned to a classroom.
📄️ 3.2.14 classrooms
The classrooms table in Supabase stores the created classrooms, to which several cases can be assigned. To learn how to create a new classroom, see Section 5.4 How to Create a Classroom.
📄️ 3.2.1 CardinalSymptoms
The CardinalSymptoms table in Supabase defines a reference list of common cardinal symptoms in gynecological and obstetrics diagnoses. It serves as a symptom dictionary that allows diagnoses to be grouped based on shared clinical manifestations.
📄️ 3.2.2 CaseTemplates
The CaseTemplates table contains the diagnostic templates used to generate patient cases. Each row represents a diagnosis, with case_data encoded as a JSON object that includes case-specific findings and case-specific such as expected lab values, findings, symptoms, and clinical history. Templates are static and remain unchanged. Randomization are applied at the point of patient case generation.
📄️ 3.2.3 FindingsTemplate
The FindingsTemplate table enables automated rendering of written medical reports. For each diagnostic method (e.g., ultrasound, physical exam, surgery), it defines how findings from pat_data within the PatBase table are converted into a structured report when the user requests a diagnostic examination.
📄️ 3.2.4 PatBase
The PatBase table in Supabase stores all dynamically and statically generated patient cases. Each patient case is assigned a unique patid and is linked to a case/diagnosis via caseid. While multiple patient cases can originate from the same caseid, each patid exists only once.
📄️ 3.2.5 PatChat
Clinic Edge offers the functionality to take the medical history of a patient via chatting with an AI bot (text or audio). The information, which is gathered during the anamnesis, is stored in the PatChat table in Supabase and assigned to the patient case using the pat_id (as in PatBase). In addition to the content of the conversation, the table also contains some audio information if this functionality is used.
📄️ 3.2.6 PatDiagnosis
The PatDiagnosis table in Supabase stores the ICD-10 diagnoses assigned to a patient case by the user. Each diagnosis is defined by a diagnosisid and linked to the corresponding patient via patid as in the PatBase table.
📄️ 3.2.7 PatFindings
The PatFindings table in Supabase contains all diagnostic findings requested by the user for each patient case. Every diagnostic request is represented by a single row and inludes the examination group, item, and type, as well as the generated report. Each finding is linked to the corresponding patient via pat_id.
📄️ 3.2.8 PatReports
The PatReport table in supabase stores the reportinfo and refers to a specific patient via patid. Each report is assigned a report_id.
📄️ 3.2.9 PatRx
The PatRx table in Supabase stores all prescriptions for each patient case. Each medication is linked to a patient via patid and receives a unique rxid. The table supports storage of up to three medications, with metadata including the medication name, Pharmazentralnummer (PZN), the medication regimen and an internal rx_key.
📄️ 3.4.1 logic_server.js
The logic_server.js file contains logic functions to process and transform patient-specific data. It acts as connection between the Supabase database and the Clinic Edge application.
📄️ 3.4.2 requests.js
The requests.js file defines all available diagnostic requests in the ClinicEdge application. It sets the basis for the user interface, organizing diagnostic request categories, subcategories, and the selectable items the user can request.
📄️ 3.4.3 logic.js
The logic.js file contains ...
📄️ 3.5 Reference Data
If a field or value in casedata is defined as "normal" or blank, data is automatically retrieved from predefined reference files and injected into the dynamically generated patdata.