This codebase implements the integration flow between SOPHIA and Altera systems for managing Standard Operating Procedures (SOPs) and procedure execution data. It ensures that SOPs are created in SOPHIA, pushed to Altera, retrieved directly from SOPHIA during procedure execution in Altera, and procedure execution data is sent back to SOPHIA for compliance tracking.
-
SOP Creation in SOPHIA:
- SOPs are created in SOPHIA.
- SOPHIA uses its API to push the newly created SOPs to Altera.
-
Procedure Execution in Altera:
- When a user initiates a procedure in Altera, the system pulls the relevant SOP directly from SOPHIA.
-
Data Logging and Compliance:
- Altera logs the procedure execution data.
- The logged data is then sent back to SOPHIA for compliance tracking and reporting.
- app.js: Main server file defining endpoints.
- sophiaApi.js: Module for interacting with the SOPHIA API.
- routes/sopRoutes.js: Defines routes and maps them to controller functions.
- controllers/sopControllers.js: Implements business logic for SOP operations.
-
Create SOP in SOPHIA and Push to Altera:
- URL:
/sophia/sops
- Method: POST
- Description: Creates an SOP in SOPHIA and pushes it to Altera.
- URL:
-
Fetch SOP from SOPHIA (Used by Altera during procedure execution):
- URL:
/sophia/sops/:id
- Method: GET
- Description: Retrieves an SOP directly from SOPHIA based on the SOP ID. This is used by Altera when initiating a procedure.
- URL:
-
Log Procedure Execution Data:
- URL:
/sophia/procedures
- Method: POST
- Description: Logs procedure execution data in SOPHIA. Altera sends the procedure data to this endpoint, which then logs it in Sophia system for compliance tracking.
- URL:
- Node.js
- npm (Node Package Manager)
- Clone the repository:
git clone <repository-url> cd <repository-directory> npm install PORT=3000 ALTERA_API_URL=<Altera API base URL> SOPHIA_API_URL=<SOPHIA API base URL> API_KEY=<api_key> node start