Production Ledger Summary and Report Generation for Pharmaceutical Preparations Manufacturing: Deployment and Upgrade

Ledger data for pharmaceutical preparations manufacturing comes from approved formulation processes, MES/electronic batch records, equipment and

This configuration is compatible with FastGPT v4.17.0, adjusted for deployment and upgrade requirements in pharmaceutical preparations manufacturing scenarios.

What this category of data looks like

Ledger data for pharmaceutical preparations manufacturing comes from approved formulation processes, MES/electronic batch records, equipment and environmental monitoring systems, LIMS, and quality management systems. Daily generated documents include master production files, batch production records, batch packaging records, cleaning records, inspection records, deviation/CAPA/change documents, and batch release review forms. Data is updated per batch production, each critical process step, and fixed monitoring plans. Fields include material batch numbers, process parameter values, inspection results, deviation descriptions, release status, and more. Units include kilograms, hours, batch numbers and other compliant formats.

Constraints Imposed by These Characteristics on Deployment and Upgrade

Since data sources cover multiple production and quality systems, deployment requires configuring connection parameters for multiple data sources to ensure consistent cross-system data pulling. Data is updated frequently in batches and requires long-term retention, so database connection pool and storage configurations must adapt to accumulated data volume to avoid connection exhaustion or storage overflow. GMP requirements mandate that ledger data be synchronized with production operations. During deployment, access permissions must be strictly controlled: only production, quality assurance and other authorized departments can access core ledger data to prevent unauthorized modification. Batch record documents require compliant storage, so deployment must integrate with the enterprise’s own storage system to ensure data sovereignty and traceability.

How to Configure the Settings

Configuration ItemRecommended SettingRationale
DB_MAX_LINK200–300The batch data volume for pharmaceutical preparations manufacturing is large. Sufficient connection count avoids connection exhaustion when multiple departments submit ledger summary requests, ensuring query stability.
REDIS_URLredis://192.168.1.100:6379/0High-frequency caching of batch record data requires a low-latency local Redis instance. This significantly shortens ledger summary response times and adapts to rapid updates of each batch of data.
STORAGE_S3_ENDPOINTIntranet endpoint address of the enterprise’s own object storageCompliant documents such as batch production records must be stored in the enterprise’s own storage system to ensure data traceability and compliance, meeting GMP requirements for file storage.
PG_URLPostgreSQL instance address connected to LIMS and quality management systemsLedger data needs to link to LIMS inspection records and deviation/change records from the quality management system. Unified PostgreSQL storage enables fast cross-system associated queries.
FILE_TOKEN_KEYRandomly generated 32-bit stringThis secures access to batch record files, prevents unauthorized users from downloading sensitive production and quality documents, and complies with data security control requirements.
ROOT_KEYKey configured per the enterprise’s internal permission management rulesThis restricts only administrators from production, quality assurance and other departments to access core system configurations, preventing unauthorized modification of ledger summary rules and parameters.

Three Common Configuration Mistakes

  • Phenomenon: After Docker deployment on a Windows environment, accessing the address corresponding to FE_DOMAIN returns a 502 error. Cause: The 80 port of the FastGPT container is not mapped to the correct host port, or the host firewall blocks traffic on the mapped port.
  • Phenomenon: During intranet Docker-Compose deployment, OneAPI reports a MySQL connection refusal error, and logs show MySQL started normally. Cause: No network alias is set for the MySQL service in the Docker Compose configuration, so the FastGPT container cannot resolve the MySQL hostname and establish a connection.
  • Phenomenon: After configuring the model API, ledger summary response speed is much slower than direct model API calls via curl. Cause: Database connection parameters such as DB_MAX_LINK are not adjusted, leading to database connection exhaustion during multiple concurrent requests and blocking the API response process.

How to Confirm Successful Configuration

  • Run the docker ps command to confirm all FastGPT-related containers are in running state, with no abnormal exits or restart records.
  • Call FastGPT’s internal data query interface, attempt to pull simulated batch production record fields, and confirm that LIMS inspection results and quality management system deviation records can be properly associated.
  • Upload a simulated batch packaging record document, verify that the file is stored normally in the storage system corresponding to the configured STORAGE_S3_ENDPOINT, and that it can be accessed normally via an authorized link.
  • Initiate 3–5 concurrent ledger summary requests, confirm that the number of database connections does not exceed the configured DB_MAX_LINK value, and that there are no connection timeout or error logs.

The values provided here are common starting points and should be evaluated against the reader’s own samples.