📄️ 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.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). Each requesttype defines how a specific finding in patdata, rendered based on the probabilities in case_data, should be reported, when the user requests a diagnostic method.
📄️ 3.2.4 PatBase
Table Structure
📄️ 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
PatDiagnosis contains the diagnoses, which were assigned to the patients by users. The table cointains the id, which is unique for every given diagnosis, the patid, so it is linked to the right patient (-> PatBase), and the diagnosisid, which refers to the ICD-10 diagnosis codes.
📄️ 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
PatReport 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), 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.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 into the dynamically generated patdata.