Spaces:
Runtime error
Runtime error
| { | |
| "docs": [ | |
| { | |
| "id": "f3dd7bef91b9", | |
| "title": "[https___github.com_niki-amini-naieni_CountVid](ht.pdf", | |
| "filename": "f3dd7bef91b9.pdf", | |
| "path": "/Users/athulnambiar/Desktop/PROJECTS/QUADRANT_RAG/uploads/f3dd7bef91b9.pdf", | |
| "pages": 4, | |
| "created_at": "2025-09-22T17:04:06.943407Z" | |
| }, | |
| { | |
| "id": "639a85dd8f1f", | |
| "title": "AI-Powered Company Classification Tool_ Technical Architecture & Data Flow-2.pdf", | |
| "filename": "639a85dd8f1f.pdf", | |
| "path": "/Users/athulnambiar/Desktop/PROJECTS/QUADRANT_RAG/uploads/639a85dd8f1f.pdf", | |
| "pages": 2, | |
| "created_at": "2025-09-22T18:26:30.613458Z" | |
| }, | |
| { | |
| "id": "50f6dc85d40b", | |
| "title": "2262041-Athul Nambiar Final-2.pdf", | |
| "filename": "50f6dc85d40b.pdf", | |
| "pages": 30, | |
| "chunks": 24, | |
| "created_at": "2025-09-23T17:16:16.652638", | |
| "enhanced": true, | |
| "medical_optimized": true | |
| }, | |
| { | |
| "id": "be191882380f", | |
| "title": "MVP Development for AI-Powered Company Classification Tool.pdf", | |
| "filename": "be191882380f.pdf", | |
| "pages": 4, | |
| "chunks": 11, | |
| "created_at": "2025-09-23T17:37:46.782738+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "ff610e38e8b3", | |
| "title": "1. Christ University Policy on Research Internships for Undergraduate and Postgraduate Students.pdf", | |
| "filename": "ff610e38e8b3.pdf", | |
| "pages": 4, | |
| "chunks": 12, | |
| "created_at": "2025-09-25T19:04:11.467669+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "bec87b0367ac", | |
| "title": "Mini-project Report front page_Image and Video Analytics.pdf", | |
| "filename": "bec87b0367ac.pdf", | |
| "pages": 7, | |
| "chunks": 6, | |
| "created_at": "2025-09-25T19:16:09.040014+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "0fd6df206ce2", | |
| "title": "Mini-project Report front page_Image and Video Analytics.pdf", | |
| "filename": "0fd6df206ce2.pdf", | |
| "pages": 7, | |
| "chunks": 6, | |
| "created_at": "2025-09-25T19:19:09.454543+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "9ef4a5805de2", | |
| "title": "Harrison\u2019s Principles of Internal Medicine, 21st edition -- By Joseph Loscalzo, Anthony Fauci, Dennis Kasper, Stephen -- 21th edition, New York, -- 9781259644030 -- 201ae48755c6d5e6625a0d4018a77f49 -- Anna\u2019s Archive_split-merge.pdf", | |
| "filename": "9ef4a5805de2.pdf", | |
| "pages": 51, | |
| "chunks": 491, | |
| "created_at": "2025-09-25T19:21:14.181613+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "83c48ac2fa2f", | |
| "title": "Harrison\u2019s Principles of Internal Medicine, 21st edition -- By Joseph Loscalzo, Anthony Fauci, Dennis Kasper, Stephen -- 21th edition, New York, -- 9781259644030 -- 201ae48755c6d5e6625a0d4018a77f49 -- Anna\u2019s Archive_split-merge.pdf", | |
| "filename": "83c48ac2fa2f.pdf", | |
| "pages": 51, | |
| "chunks": 491, | |
| "created_at": "2025-09-26T07:13:09.540473+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "3d5f4faa9630", | |
| "title": "Harrison\u2019s Principles of Internal Medicine, 21st edition -- By Joseph Loscalzo, Anthony Fauci, Dennis Kasper, Stephen -- 21th edition, New York, -- 9781259644030 -- 201ae48755c6d5e6625a0d4018a77f49 -- Anna\u2019s Archive_split-merge.pdf", | |
| "filename": "3d5f4faa9630.pdf", | |
| "pages": 51, | |
| "chunks": 491, | |
| "created_at": "2025-09-26T11:37:30.064125+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "91e53cac0db8", | |
| "title": "Harrison\u2019s Principles of Internal Medicine, 21st edition -- By Joseph Loscalzo, Anthony Fauci, Dennis Kasper, Stephen -- 21th edition, New York, -- 9781259644030 -- 201ae48755c6d5e6625a0d4018a77f49 -- Anna\u2019s Archive_split-merge.pdf", | |
| "filename": "91e53cac0db8.pdf", | |
| "pages": 51, | |
| "chunks": 247, | |
| "created_at": "2025-09-26T14:50:49.748305+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "e42111b7b18b", | |
| "title": "Harrison\u2019s Principles of Internal Medicine, 21st edition -- By Joseph Loscalzo, Anthony Fauci, Dennis Kasper, Stephen -- 21th edition, New York, -- 9781259644030 -- 201ae48755c6d5e6625a0d4018a77f49 -- Anna\u2019s Archive_split-merge.pdf", | |
| "filename": "e42111b7b18b.pdf", | |
| "pages": 51, | |
| "chunks": 247, | |
| "created_at": "2025-09-26T14:54:02.811504+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "b78c65d6b361", | |
| "title": "Harrison\u2019s Principles of Internal Medicine, 21st edition -- By Joseph Loscalzo, Anthony Fauci, Dennis Kasper, Stephen -- 21th edition, New York, -- 9781259644030 -- 201ae48755c6d5e6625a0d4018a77f49 -- Anna\u2019s Archive_split-merge.pdf", | |
| "filename": "b78c65d6b361.pdf", | |
| "pages": 51, | |
| "chunks": 247, | |
| "created_at": "2025-09-26T14:54:03.053592+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "6200aee12faa", | |
| "title": "Harrison\u2019s Principles of Internal Medicine, 21st edition -- By Joseph Loscalzo, Anthony Fauci, Dennis Kasper, Stephen -- 21th edition, New York, -- 9781259644030 -- 201ae48755c6d5e6625a0d4018a77f49 -- Anna\u2019s Archive_split-merge.pdf", | |
| "filename": "6200aee12faa.pdf", | |
| "pages": 51, | |
| "chunks": 247, | |
| "created_at": "2025-09-26T15:29:57.820092+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "8888d36bfc6e", | |
| "title": "Harrison\u2019s Principles of Internal Medicine, 21st edition -- By Joseph Loscalzo, Anthony Fauci, Dennis Kasper, Stephen -- 21th edition, New York, -- 9781259644030 -- 201ae48755c6d5e6625a0d4018a77f49 -- Anna\u2019s Archive_split-merge.pdf", | |
| "filename": "8888d36bfc6e.pdf", | |
| "pages": 51, | |
| "chunks": 247, | |
| "created_at": "2025-09-29T16:24:46.915516+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| }, | |
| { | |
| "id": "9b2ccd8b9cc9", | |
| "title": "Harrison\u2019s Principles of Internal Medicine, 21st edition -- By Joseph Loscalzo, Anthony Fauci, Dennis Kasper, Stephen -- 21th edition, New York, -- 9781259644030 -- 201ae48755c6d5e6625a0d4018a77f49 -- Anna\u2019s Archive_split-merge.pdf", | |
| "filename": "9b2ccd8b9cc9.pdf", | |
| "pages": 51, | |
| "chunks": 247, | |
| "created_at": "2025-09-29T16:42:35.313291+00:00", | |
| "dynamic_rag": true, | |
| "vector_db": "qdrant", | |
| "llm_model": "gpt-4o-mini" | |
| } | |
| ], | |
| "chunks": { | |
| "50f6dc85d40b": [ | |
| { | |
| "id": "50f6dc85d40b_0", | |
| "text": "SORCOVA HEALTH DEV AN INTERNSHIP REPORT Submitted by ATHUL NAMBIAR (2262041) In partial fulfilment of the requirements for the degree of BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE AND ENGINEERING (Artificial Intelligence and Machine Learning) UNDER THE GUIDANCE OF PROF. CHAITRA P C Department of Computer Science and Engineering, School of Engineering and Technology CHRIST (Deemed to be University) Kumbalgodu, 560074 August 2025", | |
| "page": 1, | |
| "section_title": "Introduction", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_1", | |
| "text": "Department of Computer Science and Engineering School of Engineering and Technology CHRIST (Deemed to be University) BONAFIDE CERTIFICATE This is to certify that ATHUL NAMBIAR (2262041) has successfully completed his summer internship work entitled \u201cSORCOVA HEALTH DEV\u201d in Sorcova Health located at 60 Avenue Charles de Gaulle, 92200 Neuilly-sur-Seine, France from 03-03-2025 to 31-05-2025 for a duration of 3 Months and submitted on 14-08-2025 in partial fulfillment for the award of Bachelor of Technology in Computer Science and Engineering (Artificial Intelligence and Machine Learning) during the academic year . GUIDE (Signature with Date) HEAD OF THE DEPARTMENT (Signature with Seal) EXAMINER 1 (Name & Signature with Date) Examiner 2 (Name & Signature with Date) 2024-2025", | |
| "page": 2, | |
| "section_title": "Introduction", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_2", | |
| "text": "ABSTRACT During my internship at Socvova Health as a Fullstack Developer, I gained invaluable experience by contributing to the development of an innovative technology networking platform. I enhanced my skills in advanced backend development, server-side optimisation, and API integration while collaborating with a dynamic team to drive technological innovation and connectivity among global tech enthusiasts. This experience allowed me to apply theoretical knowledge to real-world applications, solidifying my passion for backend development and inspiring me to pursue further innovation in this field. My work involved designing and testing server-side components, optimising performance, and ensuring code quality, which prepared me for future challenges in the tech industry.This hands-on experience not only enriched my technical expertise but also emphasised the importance of innovation and collaboration in the tech industry.", | |
| "page": 3, | |
| "section_title": "Introduction", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_3", | |
| "text": "PREFACE During my internship at Socvova Health as a Fullstack Developer from March 03, 2025, to May 31, 2025, I had the opportunity to work with a dynamic team committed to technological innovation. This experience allowed me to apply my theoretical knowledge in Computer Science Engineering to real-world backend development projects. I contributed to the development of a global technology networking platform, enhancing my skills in Node.js and server-side optimisation. Collaborating with visionary leaders and talented colleagues provided invaluable insights into the tech industry, solidifying my passion for backend development and inspiring me to pursue further innovation in this field. This report encapsulates the skills and knowledge I gained, the challenges I encountered, and the solutions I implemented during this transformative period.", | |
| "page": 4, | |
| "section_title": "Introduction", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_4", | |
| "text": "INDEX CONTENT PAGE NO. Abstract I Preface II List of Symbols and Abbreviations III List of Figures IV List of Tables V 1 Introduction 1 1.1. Objectives 1 1.2. Company Profile 2 2 Technical Description & Implementation 3 2.1. Actual Work 3 2.1.1. Prerequisites 3 2.1.2. Responsibilities 4 2.1.3. Challenges 4 2.1.4 Implementation Description 4 2.1.5 Methodology 2.2. Learning Outcomes & Key Takeaway 3 Conclusion & Future Scope 5 3.1. Conclusion 5 3.2. Future Scope 5 4 Appendixes A Acceptance letter 7 B Completion Certificate 8 C Code and screenshots 9 5 References 10", | |
| "page": 5, | |
| "section_title": "Introduction", | |
| "medical_terms": [], | |
| "chunk_type": "conclusion", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_5", | |
| "text": "1.2 COMPANY PROFILE Sorcova Health is a digital health platform registered in France focused on monitoring mental well-being, managing stress, and implementing personalized prevention strategies to mitigate chronic stress and burnout. Their mission is to address chronic stress, a significant risk factor for various non-communicable diseases, by using preventative health and lifestyle medicine approaches to improve long-term health outcomes and enhance overall quality of life.", | |
| "page": 8, | |
| "section_title": "4. Troubleshooting and Support: Performed troubles", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_6", | |
| "text": "2.1.2 RESPONSIBILITIES My responsibilities included: During my internship as a Fullstack Developer at Sorcova Health, my primary responsibilities revolved around the successful execution of assigned tasks within specified deadlines. These tasks included designing, developing, and testing server-side components, ensuring optimal performance of database and front-end requests, and integrating server-side logic with user-side components. I was also responsible for writing clean, efficient, and reusable code, developing APIs as needed, and troubleshooting technical issues independently before seeking assistance. Maintaining consistent communication with my mentor through daily reports was crucial in tracking progress and ensuring alignment with project goals. This proactive approach fostered a sense of self-reliance and resourcefulness, enabling me to contribute effectively to the development of the Sorcova Health platform. Feel free to modify or expand on this as needed to better fit your personal experiences and contributions during your internship.", | |
| "page": 10, | |
| "section_title": "CHAPTER 2 TECHNICAL DESCRIPTION & IMPLEMENTATION 2", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_7", | |
| "text": "2.1.3 CHALLENGES I encountered several challenges that tested my problem-solving skills and adaptability. One significant challenge was managing data inconsistencies and ensuring data integrity across the platform. This involved dealing with various data formats and ensuring seamless integration with existing systems. Another challenge was optimising server-side performance to handle high traffic efficiently, which required a deep understanding of backend architecture and careful resource management. Additionally, selecting the appropriate technologies and frameworks for developing scalable backend solutions was a complex task, as it involved balancing performance, security, and maintainability. These challenges, while demanding, provided valuable learning experiences and contributed to my growth as a backend developer. Feel free to adjust or expand on any specific details based on your personal experience during the internship.", | |
| "page": 11, | |
| "section_title": "CHAPTER 2 TECHNICAL DESCRIPTION & IMPLEMENTATION 2", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_8", | |
| "text": "2.1.4 IMPLEMENTATION DESCRIPTION During the internship at Sorcova Health, the implementation primarily focused on developing and enhancing a technology networking platform, particularly its backend functionalities and API integrations. The core of the implementation involved leveraging Node.js for server-side development, as evidenced by the server.js file, which sets up the Express.js server, handles routing for users, emails, and comments, and integrates with dbConfigure.js for database connectivity. Key aspects included creating and managing RESTful APIs for various functionalities, such as retrieving, adding, updating, and deleting announcements, with specific endpoints for managing announcement views and counts. The implementation also incorporated real-time communication through Socket.io for features like instant announcement notifications. Database interactions, likely with a SQL database based on the structure of announcement.model.js and the use of SQL queries, were central to managing user data, announcements, and their seen/unseen status.", | |
| "page": 12, | |
| "section_title": "CHAPTER 2 TECHNICAL DESCRIPTION & IMPLEMENTATION 2", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_9", | |
| "text": "al-time communication through Socket.io for features like instant announcement notifications. Database interactions, likely with a SQL database based on the structure of announcement.model.js and the use of SQL queries, were central to managing user data, announcements, and their seen/unseen status. Furthermore, the development process involved a focus on code quality, reusability, and performance optimization for both database and front-end requests, aiming to translate Figma designs into functional web applications. API testing was conducted using Postman to ensure the robustness and correctness of the implemented endpoints.", | |
| "page": 12, | |
| "section_title": "CHAPTER 2 TECHNICAL DESCRIPTION & IMPLEMENTATION 2", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_10", | |
| "text": "2.1.5 METHODOLOGY The development process at Sorcova Health followed an agile methodology, emphasizing iterative development and continuous feedback to translate Figma workflow designs into functional web applications. Backend development was primarily conducted using Node.js and its Express.js framework for building robust RESTful APIs. For data persistence and retrieval, SQL databases were utilized, with database interactions managed through custom models and direct SQL queries to optimize performance and ensure data integrity. Version control was rigorously maintained using Git, facilitating collaborative development, code merging, and tracking changes. Real-time communication features, such as instant announcement notifications, were implemented using Socket.io. Throughout the implementation, a strong emphasis was placed on writing clean, efficient, and reusable code, while API testing was systematically performed using Postman to validate endpoint functionality and overall system reliability.", | |
| "page": 13, | |
| "section_title": "CHAPTER 2 TECHNICAL DESCRIPTION & IMPLEMENTATION 2", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_11", | |
| "text": "C. CODE & SCREEN SHOT server.js require(\"dotenv\").config() var cors = require(\"cors\") const express = require(\"express\") const db = require(\"./configure/dbConfigure.js\") const logger = require(\"./logger\") const bodyParser = require(\"body-parser\") const https = require(\"http\") const { readFileSync } = require(\"fs\") const path = require(\"path\") const userRoutes = require(\"./routes/user\"); const emailRoutes = require(\"./routes/email.js\"); const commentRoutes = require('./routes/comments.js'); const app = express() app.use(bodyParser.json()) app.use(bodyParser.urlencoded({ extended: false, limit: \"2gb\" })) app.use(bodyParser.json({ type: \"application/*+json\" })) const sslserver = https.createServer( { key: readFileSync(path.join(__dirname, \"certs\", \"key.pem\")), cert: readFileSync(path.join(__dirname, \"certs\", \"cert.pem\")), }, app ) global.io = require(\"socket.io\")(sslserver, { cors: { origin: \"*\", methods: [\"GET\", \"POST\"], },", | |
| "page": 17, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_12", | |
| "text": "}) app.use( cors({ origin: \"*\", }) ) app.use(function (req, res, next) { res.header(\"Access-Control-Allow-Origin\", [\"*\"]) res.header( \"Access-Control-Allow-Headers\", \"Origin,X-Requested-With, Content-Type, Accept\" ) next() }) app.use(express.urlencoded({ extended: true, limit: \"2gb\" })) app.use(express.json()) app.use(\"/users\", userRoutes) app.get(\"/testing\", (req, res) => { res.send(\"Hello Sorcova Healths\").status(200) }) app.get(\"/projection\", (req, res) => { res.send(\"this is the projection page\").status(200) }) app.use(express.static(path.join(__dirname, \"build\"))) //here is important thing - no static directory, because all static :) app.get(\"/*\", function (req, res) { res.sendFile(path.join(__dirname, \"index.html\")) })", | |
| "page": 18, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_13", | |
| "text": "io.on(\"connection\", (socket) => { socket.on(\"announcementAdded\", () => { console.log(\"New announcement added\") io.emit(\"newAnnouncement\", \"New Announcement!\") }) }) const port = process.env.PORT || 8080 sslserver.listen(port, () => { logger.info(`server started at port : ${port}`) }) app.use('/email',emailRoutes); app.use('/comments', commentRoutes); sslserver.setTimeout(300000) Notification Controller API const AnnouncementsModel = require(\"../models/announcement.model\"); const logger = require(\"../logger\"); exports.socketAnnounce = (req, res) => { const {password} = req.body //Sorcova Health@2023 const hash = \"\" try{ io.emit(\"newAnnouncement\", \"New Announcement!\"); res.status(200).json({status:true, msg:\"announcement emitted\"}) }catch(err){ console.log(err) res.status(500).json({status:false, msg:\"failed to emmit announcement \"}) }", | |
| "page": 19, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_14", | |
| "text": "} exports.getAllAnnouncements = (req, res) => { const mad_id = req.params.id; AnnouncementsModel.getAllAnnouncements(mad_id,(err, result) => { try { if (err) { logger.error(\"Error: announcements >> error >>\", err); res.json({ response: err, status: { code: \"02\", status: \"failure\", message: \"error in fetching all announcements\", }, }); } else { res.json({ response: result, status: { code: \"00\", status: \"success\", message: \"Fetched all announcements successfully\", }, }); } } catch (err) { logger.error(\"Error: get All announcements >> error >>\", err); } }); }; exports.getAnnouncementById = (req, res) => { const announcement_id = req.params.id AnnouncementsModel.getAnnouncementById(announcement_id, (err, result) => {", | |
| "page": 20, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_15", | |
| "text": "try { if (err) { logger.error(\"Error: announcements >> error >>\", err); res.json({ response: err, status: { code: \"02\", status: \"failure\", message: \"error in fetching announcement by id\", }, }); } else { res.json({ response: result, status: { code: \"00\", status: \"success\", message: \"Fetched announcement by id successfully\", }, }); } } catch (err) { logger.error(\"Error: get announcement by id >> error >>\", err); } }); }; exports.removeOutdatedAnnouncements = (req, res) => { AnnouncementsModel.removeOutdatedAnnouncements((err, result) => { try { if (err) { logger.error(\"Error: remove outdated announcements >> error >>\", err); res.json({ response: err, status: {", | |
| "page": 21, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_16", | |
| "text": "code: \"02\", status: \"failure\", message: \"error in deleting expired Documents\", }, }); } else { res.json({ response: result, status: { code: \"00\", status: \"success\", message: \"Deleted outdated announcements successfully\", }, }); } } catch (err) { logger.error(\"Error: outdated announcements >> error >>\", err); } }); }; exports.deleteAnnouncementById = (req, res) => { const announcement_id = req.params.id; AnnouncementsModel.deleteAnnouncementById(announcement_id, (err, result) => { try { if (err) { logger.error(\"Error: remove outdated announcements >> error >>\", err); res.json({ response: err, status: { code: \"02\", status: \"failure\", message: \"error in deleting expired Documents\", }, });", | |
| "page": 22, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_17", | |
| "text": "} else { res.json({ response: result, status: { code: \"00\", status: \"success\", message: \"Deleted outdated announcements successfully\", }, }); } } catch (err) { logger.error(\"Error: outdated announcements >> error >>\", err); } }); }; exports.getUnseenAnnouncementCount = (req, res) => { const mad_id = req.params.id; AnnouncementsModel.getUnseenAnnouncementCount(mad_id, (err, result) => { try { if (err) { logger.error(\"Error: get unseen announcements count >> error >>\", err); res.json({ response: err, status: { code: \"02\", status: \"failure\", message: \"error getting unseen announcements count\", }, }); } else { res.json({ response: result[0]??null, status: { code: \"00\", status: \"success\",", | |
| "page": 23, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_18", | |
| "text": "message: \"successfully fetched unseen announcements count\", }, }); } } catch (err) { logger.error(\"Error: get unseen announcements count >> error >>\", err); } }); }; exports.markSeenAnnouncements = (req, res) => { const {announcement_ids, mad_id} = req.body AnnouncementsModel.markSeenAnnouncements(announcement_ids,mad_id, (err, result) => { try { if (err) { logger.error(\"Error: mark seen announcements >> error >>\", err); res.json({ response: err, status: { code: \"02\", status: \"failure\", message: \"error marking seen announcements\", }, }); } else { res.json({ response: result, status: { code: \"00\", status: \"success\", message: \"successfully marked seen announcements\", }, }); } } catch (err) {", | |
| "page": 24, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_19", | |
| "text": "logger.error(\"Error: mark seen announcements >> error >>\", err); } }); }; DB SQL Model Schema const db = require(\"../configure/dbConfigure\"); const logger = require(\"../logger\"); const Announcements = function (announcement) { this.announcement_id = announcement.announcement_id; this.announcement_type = announcement.announcement_type; this.channel = announcement.channel; this.created_date = announcement.created_date; this.duration = announcement.duration; this.priority = announcement.priority; this.content = announcement.content; }; //old // Announcements.getAllAnnouncements = (mad_id, result) => { // var sql = `SELECT A.*,CASE WHEN Av.mad_id IS NOT NULL THEN 'seen' ELSE 'unseen' END AS seen_status // FROM announcements as A Left Join announcements_views as Av // ON A.announcement_id = Av.announcement_id And Av.mad_id = ${mad_id} // WHERE A.announcement_id NOT IN ( // SELECT announcement_id // FROM announcements // WHERE created_date < NOW() - INTERVAL 30 DAY) // ORDER BY A.created_date DESC;`;", | |
| "page": 25, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_20", | |
| "text": "// db.query(sql, (err, res) => { // if (err) { // logger.error(err); // result(err, null); // } else { // result(null, res); // } // }); // }; //new - Test pending Announcements.getAllAnnouncements = (mad_id, result) => { var sql = `SELECT A.*, CASE WHEN Av.mad_id IS NOT NULL THEN 'seen' ELSE 'unseen' END AS seen_status FROM announcements AS A LEFT JOIN ( SELECT announcement_id FROM announcements_views WHERE mad_id = ${mad_id} ) AS Av ON A.announcement_id = Av.announcement_id WHERE A.created_date >= NOW() - INTERVAL 30 DAY OR Av.announcement_id IS NOT NULL ORDER BY A.created_date DESC;`; db.query(sql, (err, res) => { if (err) { logger.error(err); result(err, null); } else { result(null, res); } }); }; Announcements.getAnnouncementById = (announcement_id, result) => {", | |
| "page": 26, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_21", | |
| "text": "const sql = `Select * from announcements where announcement_id = ${announcement_id}`; db.query(sql, (err, res) => { if (err) { logger.error(err); result(err, null); } else { result(null, res); } }); }; Announcements.removeOutdatedAnnouncements = (result) => { const sql = `DELETE from announcements WHERE created_date < NOW() - INTERVAL duration DAY;`; db.query(sql, (err, res) => { if (err) { logger.error(err); result(err, null); } else { result(null, res); } }); }; Announcements.deleteAnnouncementById = (announcement_id, result) => { const sql = `DELETE from announcements WHERE announcement_id = ${announcement_id}`; db.query(sql, (err, res) => { if (err) { logger.error(err); result(err, null); } else { result(null, res); } });", | |
| "page": 27, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_22", | |
| "text": "}; // old // Announcements.getUnseenAnnouncementCount = (mad_id, result) => { // var sql = `SELECT count(*) as unseenCount // FROM announcements as A // WHERE A.announcement_id NOT IN ( // SELECT announcement_id // FROM announcements // WHERE created_date < NOW() - INTERVAL 30 DAY) // AND Not Exists (select * from announcements_views where announcement_id = A.announcement_id and mad_id = ${mad_id} ) // ORDER BY created_date DESC;`; // db.query(sql, (err, res) => { // if (err) { // logger.error(err); // result(err, null); // } else { // result(null, res); // } // }); // }; //new Announcements.getUnseenAnnouncementCount = (mad_id, result) => { var sql = `SELECT COUNT(*) AS unseenCount FROM announcements AS A LEFT JOIN ( SELECT announcement_id FROM announcements_views WHERE mad_id = ${mad_id} ) AS Av ON A.announcement_id = Av.announcement_id WHERE A.created_date >= NOW() - INTERVAL 30 DAY AND Av.announcement_id IS NULL;`;", | |
| "page": 28, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| }, | |
| { | |
| "id": "50f6dc85d40b_23", | |
| "text": "db.query(sql, (err, res) => { if (err) { logger.error(err); result(err, null); } else { result(null, res); } }); }; Announcements.markSeenAnnouncements = (announcement_ids,mad_id, result) => { var values = announcement_ids.map(announcement_id => `(${announcement_id}, ${mad_id})`).join(', '); var sql = `INSERT INTO announcements_views (announcement_id, mad_id) VALUES ${values}`; db.query(sql, (err, res) => { if (err) { logger.error(err); result(err, null); } else { result(null, res); } }); }; module.exports = Announcements;", | |
| "page": 29, | |
| "section_title": "CHAPTER 3 CONCLUSION & FUTURE SCOPE 3.1 CONCLUSION", | |
| "medical_terms": [], | |
| "chunk_type": "general", | |
| "relevance_score": 0.0 | |
| } | |
| ] | |
| } | |
| } |