Welcome to the HL7 FHIR-based Healthcare System repository. This project is a comprehensive healthcare management platform designed to facilitate efficient patient care and streamline communication between healthcare providers and patients, leveraging the power of the HL7 FHIR standard.
Check out the live application here.
The PF-OHS was conceived with the vision of revolutionizing healthcare management by offering a patient-centered approach. The platform aims to reduce the administrative burden on healthcare providers, enhance patient engagement, and improve the overall quality of care. Our goal is to provide a seamless and intuitive experience for both practitioners and patients.
- Next.js: We use Next.js for its powerful features like server-side rendering and static site generation, which enhance the performance and SEO of the application.
- React: The foundation of our user interface, React allows us to build reusable and dynamic components, ensuring a smooth user experience.
- Zod: Zod is employed for schema validation in the frontend forms, ensuring that all data conforms to expected formats before submission.
- Google Cloud Healthcare API: Our application integrates with Google Cloud Healthcare API to securely manage and store healthcare data. This API provides a robust solution for handling sensitive health information.
The Health Level 7 (HL7) Fast Healthcare Interoperability Resources (FHIR) standard is at the core of our system. FHIR enables the seamless exchange of healthcare information between different systems, ensuring that patient data is interoperable and accessible across various platforms. By adhering to the FHIR standard, our system supports:
- Interoperability: Allowing different healthcare systems to communicate effectively, reducing the complexity of healthcare data exchange.
- Scalability: Providing a flexible framework that can be extended to meet the evolving needs of healthcare providers and patients.
- Security: Ensuring that patient data is securely managed and complies with industry standards and regulations.
When working with FHIR resources, data validation is crucial to ensure that the information conforms to the complex and structured standards defined by FHIR. Zod is a powerful schema declaration and validation library that offers several advantages:
- Type Safety: Zod provides strong typing support, which ensures that the data conforms to the expected FHIR resource structures. This helps catch errors during development, leading to more reliable and maintainable code.
- Composability: Zod schemas can be easily composed and reused, which is particularly useful when dealing with nested and complex FHIR resources.
- Runtime Validation: Unlike TypeScript, which only offers compile-time type checking, Zod validates data at runtime. This is critical in scenarios where data might come from external sources (e.g., user input, API responses) and needs to be validated before being processed or stored.
- Ease of Use: Zod’s API is intuitive and integrates seamlessly with TypeScript, making it an excellent choice for developers familiar with modern JavaScript and TypeScript practices.
The Healthcare System is composed of several interconnected modules, each responsible for managing different aspects of healthcare operations. The diagram below provides a visual representation of these modules and their key functionalities.
![System Architecture Diagram](https://private-user-images.githubusercontent.com/70728090/358062148-5fe93712-ae56-4803-af84-fab590cfd072.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4NTQ1NDAsIm5iZiI6MTcyMzg1NDI0MCwicGF0aCI6Ii83MDcyODA5MC8zNTgwNjIxNDgtNWZlOTM3MTItYWU1Ni00ODAzLWFmODQtZmFiNTkwY2ZkMDcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDAwMjQwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRjZjIxNjZhNzk5NDU3NDc5MTNlMWNlODEzNDM0NzIzNjcxMWFjYjg1ZmM4OGMxNTE4ZmM2MTE3OGExZWRmMmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0z2OgXMntRlEdXKY75o8hLgYHgRJCmLfaBhWbPjQ62E)
- Healthcare System (Central Node): Integrates all modules, ensuring smooth operation and data flow between them.
- Gestor de Historia Clínica (Medical Record Manager): Manages medical records.
- Gestor de Examen (Examination Manager): Handles medical examination processes.
- Gestor de Empresas (Company Manager): Oversees company-related information.
- Gestor de Recepcion (Reception Manager): Manages reception-related tasks.
- Gestor de Usuarios (User Manager): Controls user authentication and information.
![Logical Architecture Diagram](https://private-user-images.githubusercontent.com/70728090/358062490-4641cdb6-18f5-4ddc-b7ee-74807fff682d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4NTQ1NDAsIm5iZiI6MTcyMzg1NDI0MCwicGF0aCI6Ii83MDcyODA5MC8zNTgwNjI0OTAtNDY0MWNkYjYtMThmNS00ZGRjLWI3ZWUtNzQ4MDdmZmY2ODJkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDAwMjQwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTllMzEwNjlmNzhhNGNmYTY0YTU3YzRmNDJiZGY3YzAxNjNkOTA5YzllMzI5OTI4NWIxYzJiNWI0MzQyYzRlOGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.VbEJm11Ggrd9Ts5POmELCP-CxZauhwWfNtIMrrDRaPE)
![Role-Based Components Diagram](https://private-user-images.githubusercontent.com/70728090/358062568-9984cf6a-68e6-489c-8e69-908cc6a2f602.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4NTQ1NDAsIm5iZiI6MTcyMzg1NDI0MCwicGF0aCI6Ii83MDcyODA5MC8zNTgwNjI1NjgtOTk4NGNmNmEtNjhlNi00ODljLThlNjktOTA4Y2M2YTJmNjAyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDAwMjQwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBhYmM4M2QwNzRiNjg4Njg4MjE0YzY4MmI2NWQyYzhiZGZkYWMwNTI0NTI0MWRlOWQ4MmQxODQyYzc4NzNjOWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.t_NAAjaJ-xB-jWWgrAnFNXswGqnlyB3uWTvSeNEmMt8)
The authentication feature ensures that only authorized healthcare providers can access the platform. It supports secure login, session management, and protects sensitive patient information, adhering to industry standards like HIPAA for healthcare data security.
![Login Page](https://private-user-images.githubusercontent.com/70728090/358043804-aeb042c7-692a-45d8-98cb-7d325e418821.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4NTQ1NDAsIm5iZiI6MTcyMzg1NDI0MCwicGF0aCI6Ii83MDcyODA5MC8zNTgwNDM4MDQtYWViMDQyYzctNjkyYS00NWQ4LTk4Y2ItN2QzMjVlNDE4ODIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDAwMjQwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThmNmIzNmI3ZjUzOWYzYzZiOTI2MTJjYzI4MjM2YjIyNmNjZTNiNjMwZmRiNDAxMzNkMDY0NDUzMTViZmJhYjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bEJ6oIrNA5eLXwJsagRz6EwuYNGCC1qHzw5JJw57Zc8)
The Welcome Page provides a personalized dashboard that gives users an overview of their tasks, quick access to different sections of the application, and important notifications. This helps users navigate the system efficiently and stay updated with their responsibilities.
![Welcome Page](https://private-user-images.githubusercontent.com/70728090/358049599-661ce9ef-b783-4a47-ac09-a88d35973f2b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4NTQ1NDAsIm5iZiI6MTcyMzg1NDI0MCwicGF0aCI6Ii83MDcyODA5MC8zNTgwNDk1OTktNjYxY2U5ZWYtYjc4My00YTQ3LWFjMDktYTg4ZDM1OTczZjJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDAwMjQwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcwM2IyNGM0ZTZhOGM2MzE0MGI1MTg4MDg4MDdkMmI3ZTc4N2IxODY4ZTcyYThlNDA2OTkxMjBmMWViNTAyNWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.SxPW0uSUTeGUK0JQDTnbHKvVCLYc1QKYe2Pb9UpOge0)
-
Overview: The Patient Overview page displays a list of all patients registered in the system. It provides essential details at a glance, such as patient name, ID, and last encounter date, allowing healthcare providers to quickly access and manage patient information.
-
Details: The Patient Details page gives a comprehensive view of individual patient records, including demographic information, medical history, and encounter summaries. This detailed view helps providers make informed decisions based on accurate and up-to-date patient data.
-
Form: The Patient Form feature allows healthcare providers to add or update patient information. The form is validated using Zod to ensure all data entries conform to the required FHIR schema, reducing errors and maintaining data integrity.
-
Overview: The Questionnaire Overview page provides a list of all questionnaires that have been assigned to patients. It includes details like the questionnaire type, completion status, and associated patient, helping providers track patient engagement and gather valuable health information.
-
Form: The Questionnaire Form enables healthcare providers to create or edit questionnaires. Zod is used here to validate that all questions and responses meet the expected formats, ensuring that the data collected is consistent and useful for patient care.
-
Overview: The Organization Overview page lists all organizations associated with the healthcare system, providing a summary of their details and the ability to manage their information. This is particularly useful for large healthcare networks managing multiple facilities.
-
Form: The Organization Form feature allows administrators to add or update organization details. Using Zod for validation ensures that all organizational data, such as addresses and contact information, is accurate and adheres to the expected structure.
-
Overview: The Encounter Overview page provides a chronological list of all patient encounters, offering quick access to encounter details, including diagnoses, procedures, and practitioner notes. This feature is essential for tracking patient progress and ensuring continuity of care.
-
Questionnaires Response: This feature allows healthcare providers to review responses from patient-completed questionnaires within the context of an encounter. It helps in assessing patient conditions and tailoring care plans accordingly.
- Overview: The Practitioners Overview page lists all healthcare providers registered within the system, including their roles, specialties, and contact information
. This feature facilitates the management of healthcare teams and ensures that the right practitioners are assigned to the right patients.
![Practitioners Overview](https://private-user-images.githubusercontent.com/70728090/358056248-cf6e8ff6-eb27-4808-90a9-769f6c6ba6a3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4NTQ1NDAsIm5iZiI6MTcyMzg1NDI0MCwicGF0aCI6Ii83MDcyODA5MC8zNTgwNTYyNDgtY2Y2ZThmZjYtZWIyNy00ODA4LTkwYTktNzY5ZjZjNmJhNmEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDAwMjQwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM1ZGU4ZmM2YmZlNzEzMjdhZDIwZTIxYWRhMmM5YWFlNzZmMTQ5NTAxZjk0YTkxMDdhMzljYTMyOWVhMWEzYjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gOziNVABl1F8PyT3-BZrGXoKc9imbo-Sl3iHyW2PQkU)
-
Clone the repository:
git clone https://github.com/SJanna/pf_ohs.git
-
Install dependencies:
cd pf_ohs npm install
-
Set up environment variables:
- Create a
.env
file in the root of the project. - Add your Google Cloud Healthcare API credentials and other necessary environment variables.
- Create a
-
Run the development server:
npm run dev
-
Running Tests:
npm run test
We welcome contributions to improve the platform. Please feel free to open issues or submit pull requests.