Attendance - Sample
Overview
This document provides a structured technical guide for configuring the Attendance Service in the DIGIT Health platform. It details the configuration file structure, supported parameters, step-by-step setup instructions, and best practices.
The Attendance Service in DIGIT Health is responsible for recording, managing, and tracking the attendance of healthcare workers and other personnel. Properly configuring this service ensures accurate data capture and integration with related modules (such as payroll, reporting, and HR).
Pre-requisites
DIGIT backbone services
Idgen
Persister
Project Service
Boundary Service
Functionalities
Allows creation/updation/search of an attendance register
Allows mapping of staff and attendees to a register and enforces permissions.
Log entry and exit timestamps in epoch time for a referenced entity
Staff members can be added or removed from the Attendance Register, with roles (Editor, Approver, Owner) defining permissions: Editors modify records, Approvers validate records, and Owners have full administrative control.
Setup
Clone or download the code from the GitHub repository
The source code for the Attendance module is located in the Git repository here. Clone or download the code from this repository before proceeding.
3. Configuration File Structure
The attendance service is configured through property files and environment variables, typically found at:
Sample Structure:
4. Parameters and Descriptions
attendanceType
String
Mode of attendance marking (IN_OUT, SINGLE_PUNCH, etc.)
"IN_OUT"
locationHierarchy
Array
Administrative units where attendance is captured
["District", "PHC"]
workingHours
Object
Defines official working hours (start, end)
{ "start": "09:00", ...}
allowedRoles
Array
Roles permitted to mark attendance
["HEALTH_WORKER"]
geoFencing
Object
Enable/disable geo-fencing and set radius in meters
{ "enabled": true, ...}
absenceReasons
Array
Pre-defined list of valid absence reasons
["Sick Leave", ...]
notifications
Object
Triggers for absence/late alerts
{ "absentAlert": true }
5. Setup and Configuration Steps
Locate Configuration File: Go to the attendance service configuration path (see Configuration File Structure).
Define Attendance Parameters:
Set
attendanceTypeas per organisational policy.Specify the
locationHierarchyfor relevant administrative levels.Configure
workingHoursaccording to official timings.
Role and Access Setup:
List all roles in
allowedRolespermitted to mark attendance.
Geo-Fencing (Optional):
To restrict attendance marking within a physical radius, enable
geoFencingand set theradius(in meters).
Absence Reasons:
Customise the
absenceReasonslist as per HR policies.
Notifications:
Enable or disable
absentAlertandlateEntryAlertas required.
Save and Deploy:
Save the updated configuration.
Restart or redeploy the attendance service if necessary.
6. Best Practices
Backup: Always backup the existing configuration before making changes.
Validation: Validate JSON/YAML for syntax errors before deployment.
Security: Restrict access to configuration files to authorised personnel only.
Testing: Test attendance flows in a staging environment before deploying to production.
7. Troubleshooting
Attendance not recorded
Verify allowedRoles and user permissions
Geo-fencing blocking valid entries
Check geoFencing.radius and device location accuracy
Absence reasons not visible
Ensure absenceReasons list is populated and valid
Notifications not triggered
Confirm notifications settings and notification service
Configuration Details
To configure the attendance service using the provided attendance-service-persister.yaml, follow the steps given below.
1. Prepare the Environment
Ensure you have access to the
egovernments/configsrepository.Identify the environment (development, QA, production) where you are applying the configuration.
Locate the
attendance-service-persister.ymlfile underhealth/egov-persister/.
2. Understand the Service Map Structure
The configuration file defines how attendance-related data is persisted by mapping incoming Kafka topics to database queries. Each mapping includes:
The topic to listen to (e.g.,
save-attendance-health)The database table and fields to update
JSON paths to extract data from incoming messages
3. Update and Deploy the Configuration
a. Update the YML File (if needed)
If you have custom requirements (e.g., additional fields, different table names, or topics), modify the relevant sections in the YML file:
serviceName: Ensure it matches your service (
attendance-service)mappings: Add or update mappings as needed for your use case
b. Place the File in the Correct Directory
Ensure the updated attendance-service-persister.yml is present in the appropriate directory:
c. Push Changes (if modifying)
If you made changes, commit and push them to the repository:
4. Configure the Persister Service
Make sure the egov-persister service is deployed in your environment.
The persister will automatically pick up the configuration files for each module (like attendance).
5. Kafka Topic Configuration
Ensure the relevant services are publishing messages to the Kafka topics defined in the config (e.g.,
save-attendance-health,update-attendance-health).Topics include:
save-attendance-healthsave-attendee-healthsave-staff-healthsave-attendance-log-healthupdate-attendance-log-healthupdate-attendance-healthupdate-attendee-healthupdate-staff-health
6. Database Preparation
Verify that the required tables exist in your database:
health.eg_wms_attendance_registerhealth.eg_wms_attendance_staffhealth.eg_wms_attendance_attendeehealth.eg_wms_attendance_loghealth.eg_wms_attendance_document
Ensure the columns match the fields defined in the queries inside the YML.
7. Test the Configuration
Produce a sample message to one of the configured Kafka topics.
Check if the data is being persisted in the correct database table.
Inspect logs of the persister service for errors.
8. Monitor and Maintain
Monitor the persister logs for mapping or persistence errors.
Update the YML configuration whenever the data model or requirements change.
Summary Table of Important Elements
save-attendance-health
eg_wms_attendance_register, staff
attendance
save-attendee-health
eg_wms_attendance_attendee
attendee
save-staff-health
eg_wms_attendance_staff
staff registration
save-attendance-log-health
eg_wms_attendance_log, document
Attendance Log
update-attendance-log-health
eg_wms_attendance_log, document
Attendance Log (upd)
update-attendance-health
eg_wms_attendance_register
update Attendance
update-attendee-health
eg_wms_attendance_attendee
update Attendee
update-staff-health
eg_wms_attendance_staff
update staff
Database Schema

Postman Collections
Last updated
Was this helpful?