Nurse Mobile App REST API
Official API reference for the EduPulse School Nurse & Sickbay Clinic Mobile Application. Supports patient ID barcode scanning, illness/injury triage logging, clinical assessment with vitals (°C, BP, Pulse), sickbay bed ward admission & discharge, pharmacy medicine dispensation, parent emergency SMS alerting with hospital referral authorizations, immunization registry, and GPS shift duty tracking.
Authentication & Security
Protected nurse endpoints require the Authorization: Bearer <API_TOKEN> HTTP header. Tokens are issued upon authenticating with phone/email and PIN.
Authorization: Bearer 8f192b7c61029e8d475a1c2b3e4f5061728394a5b6c7d8e9f0123456789abcde
Content-Type: application/json
Standard Response Envelope
{
"success": true,
"status_code": 200,
"message": "Operation completed successfully",
"data": { ... },
"errors": null
}
{
"success": false,
"status_code": 422,
"message": "student_id and symptoms description are required.",
"data": null,
"errors": null
}
Authentication & Nurse Profile
Authenticates school nurse or medical officer using phone/email and PIN or password.
Request Payload:
{
"login": "nurse@stjulian.edu.ug",
"password": "1234"
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Nurse login successful. Welcome to the EduPulse Clinic Portal!",
"data": {
"token": "8f192b7c61029e8d475a1c2b3e4f5061728394a5b6c7d8e9f0123456789abcde",
"user": {
"id": 31,
"name": "Nurse Grace Mukasa",
"email": "nurse@stjulian.edu.ug",
"phone": "+256772998877",
"role_id": 12,
"role_name": "nurse",
"role_display": "Resident School Nurse",
"school_id": 1,
"school_name": "St. Julian High School",
"school_logo": "uploads/logos/school_logo_1.png"
}
}
}
Request Payload:
{ "login": "+256772998877" }Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Password reset verification code dispatched.",
"data": { "login": "+256772998877", "sms_sent": true, "step": "verify_reset_code" }
}
Request Payload:
{ "login": "+256772998877", "otp_code": "5921", "new_password": "4321" }Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Password reset successfully! You are now logged in.",
"data": { "token": "8f192b7c61029e8d475a1c2b3e4f5061728394a5b6c7d8e9f0123456789abcde", "user": { "id": 31, "name": "Nurse Grace Mukasa" } }
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Logged out successfully.",
"data": null
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Nurse profile retrieved",
"data": {
"user": {
"id": 31,
"name": "Nurse Grace Mukasa",
"email": "nurse@stjulian.edu.ug",
"phone": "+256772998877",
"role_name": "nurse",
"role_display": "Resident School Nurse"
},
"school": {
"name": "St. Julian High School",
"logo_url": "uploads/logos/school_logo_1.png"
},
"stats": {
"active_patients": 4,
"admissions_today": 0,
"critical_cases": 2,
"occupied_beds": 0
}
}
}
Request Payload:
{
"name": "Nurse Grace Mukasa",
"phone": "+256772998877",
"email": "nurse@stjulian.edu.ug"
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Profile updated successfully!",
"data": {
"user": {
"id": 31,
"name": "Nurse Grace Mukasa",
"email": "nurse@stjulian.edu.ug",
"phone": "+256772998877"
}
}
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Nurse digital badge retrieved",
"data": {
"staff": {
"id": 31,
"staff_code": "MED-0031",
"name": "Nurse Grace Mukasa",
"role": "Resident School Nurse & Triage Officer",
"phone": "+256772998877"
},
"school": {
"name": "St. Julian High School",
"logo_url": "uploads/logos/school_logo_1.png"
},
"barcode_data": "MED-0031",
"qr_string": "EDUPULSE-CLINIC:31:MED-0031:SCH-1"
}
}
Clinic Census & Dashboard
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Clinic dashboard census overview retrieved",
"data": {
"metrics": {
"active_patients": 4,
"today_admissions": 0,
"critical_cases": 2,
"discharged_today": 0,
"total_beds": 6,
"occupied_beds": 0,
"available_beds": 6,
"low_stock_medicines": 0
},
"recent_visits": [
{
"id": 1,
"incident_number": "HINC-2026-3125",
"incident_time": "2026-07-26 02:00:00",
"symptoms": "High fever (39.5°C), severe abdominal pain and vomiting",
"severity_level": "Severe / Emergency",
"status": "Discharged / Recovered",
"student_name": "Shafiq Kimuli",
"admission_no": "ADM/2026/810"
}
]
}
}
Universal Patient Health & Barcode Scanner
Scans student admission barcode, incident number, or pharmacy drug barcode.
Scenario A: Request Payload (Student ID Card):
{
"scanned_code": "STU-2026-008"
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Student patient identified: mukibi hr",
"data": {
"entity_type": "student_patient",
"student": {
"id": 8,
"student_code": "STU-2026-008",
"admission_no": "ADM/2026/875",
"full_name": "mukibi hr",
"gender": "Male",
"class_name": "Primary 1",
"parent_name": "Eduvix",
"parent_phone": "0755575803"
},
"medical_profile": {
"blood_group": "O+",
"allergies": "Penicillin (Moderate rash)",
"chronic_conditions": "Mild Asthma",
"special_diet": "Normal"
},
"active_incident": null
}
}
Scenario B: Request Payload (Medicine Barcode):
{
"scanned_code": "BATCH-PCM-01"
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Medicine identified: Paracetamol 500mg Tablets",
"data": {
"entity_type": "medicine",
"medicine": {
"id": 1,
"medicine_name": "Paracetamol 500mg Tablets",
"quantity_in_stock": 100,
"expiry_date": "2027-12-31",
"shelf_location": "Shelf A-01"
}
}
}
Triage & Illness Incident Logging
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Health incidents list retrieved",
"data": [
{
"id": 5,
"incident_number": "HINC-2026-6256",
"incident_time": "2026-07-26 20:39:32",
"symptoms": "High fever (39.2°C) and acute stomach cramps in dorm",
"severity_level": "Severe / Emergency",
"status": "Under Observation",
"student_name": "mukibi hr"
}
]
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Health incident case file retrieved",
"data": {
"incident": {
"id": 1,
"incident_number": "HINC-2026-3125",
"symptoms": "High fever (39.5°C), severe abdominal pain and vomiting",
"severity_level": "Severe / Emergency",
"temperature_celcius": "39.5",
"status": "Discharged / Recovered",
"student_name": "Shafiq Kimuli"
},
"audit_logs": [
{ "action_title": "Health Incident Logged", "actor_name": "Matron Grace Mukasa", "logged_at": "2026-07-26 18:37:36" }
]
}
}
Request Payload:
{
"student_id": 8,
"symptoms": "High fever (39.2°C), headache and nausea following afternoon sports",
"severity_level": "Severe / Emergency",
"incident_time": "2026-08-30 14:15:00"
}
Sample Response (`201 Created`):
{
"success": true,
"status_code": 201,
"message": "Health incident HINC-2026-8812 logged for mukibi hr!",
"data": {
"incident_id": 6,
"incident_number": "HINC-2026-8812",
"student_name": "mukibi hr",
"status": "Logged"
}
}
Clinical Assessment, Vitals & Triage
Request Payload:
{
"incident_id": 6,
"medical_assessment": "Suspected Malaria with dehydration. Rapid Diagnostic Test (RDT) positive.",
"temperature_celcius": 39.2,
"blood_pressure": "105/65",
"pulse_rate": 88,
"respiratory_rate": 20,
"sickbay_bed_number": "Bed #02",
"action_taken": "Triage in Sickbay Bed #02. Administering antipyretic & oral rehydration.",
"medication_given": "Artemether/Lumefantrine 20/120mg, Paracetamol 500mg"
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Medical assessment and vitals recorded successfully! Status updated to Under Observation.",
"data": { "incident_id": 6, "status": "Under Observation" }
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Patient historical vitals trend retrieved",
"data": [
{
"id": 6,
"incident_number": "HINC-2026-8812",
"incident_time": "2026-08-30 14:15:00",
"temperature_celcius": "39.2",
"blood_pressure": "105/65",
"pulse_rate": 88
}
]
}
Parent Emergency Alerts & Referrals
Request Payload:
{ "incident_id": 6 }Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Emergency notification dispatched to parent (0755575803)!",
"data": { "incident_id": 6, "status": "Parent Notified", "sms_sent": true }
}
Request Payload:
{
"incident_id": 6,
"parent_decision": "Authorize Emergency Hospital Transport",
"hospital_name": "St. Francis Hospital Nsambya",
"instructions": "Please transfer immediately, parent is on Entebbe Road en route to hospital."
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Parent emergency hospital transfer authorization recorded.",
"data": { "incident_id": 6, "status": "Hospital Transfer Authorized", "hospital": "St. Francis Hospital Nsambya" }
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Approved emergency referral hospitals retrieved",
"data": [
{ "hospital_name": "St. Francis Hospital Nsambya", "distance_km": "3.5 km", "phone": "+256414267011", "ambulance_available": true },
{ "hospital_name": "Mulago National Specialized Hospital", "distance_km": "6.2 km", "phone": "+256414541577", "ambulance_available": true }
]
}
Sickbay Beds & Ward Management
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Sickbay beds census retrieved",
"data": [
{ "bed_number": "Bed #01", "ward_name": "Boys Ward", "status": "available" },
{ "bed_number": "Bed #02", "ward_name": "Boys Ward", "status": "occupied", "student_name": "mukibi hr" }
]
}
Request Payload:
{
"bed_id": 2,
"student_id": 8,
"incident_id": 6,
"notes": "Admitted for observation under fever protocol"
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Patient admitted to Bed #02 cleanly.",
"data": { "bed_id": 2, "student_id": 8, "status": "occupied" }
}
Request Payload:
{
"incident_id": 6,
"bed_id": 2,
"resolution_notes": "Temperature normalized to 36.8°C. Patient active, symptoms resolved, cleared to return to class."
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Student successfully discharged and bed marked available for next patient.",
"data": { "status": "Discharged / Recovered", "discharged_at": "2026-08-30 16:00:00" }
}
Clinic Pharmacy & Medicine Dispensation
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Pharmacy medicines inventory retrieved",
"data": [
{
"id": 1,
"medicine_name": "Paracetamol 500mg Tablets",
"category": "Analgesic / Antipyretic",
"dosage_form": "Tablets",
"quantity_in_stock": 98,
"expiry_date": "2027-12-31"
}
]
}
Request Payload:
{
"medicine_id": 1,
"student_id": 8,
"incident_id": 6,
"quantity_dispensed": 2,
"dosage": "1 tablet (500mg) stat",
"instructions": "Take with water after food"
}
Sample Response (`201 Created`):
{
"success": true,
"status_code": 201,
"message": "Dispensed 2 units of Paracetamol 500mg Tablets to mukibi hr.",
"data": { "dispensation_id": 1, "remaining_stock": 96 }
}
Request Payload:
{
"medicine_name": "Ibuprofen 400mg Tablets",
"generic_name": "Ibuprofen",
"category": "NSAID / Anti-inflammatory",
"quantity_in_stock": 100,
"expiry_date": "2028-06-30"
}
Sample Response (`201 Created`):
{
"success": true,
"status_code": 201,
"message": "Added Ibuprofen 400mg Tablets to clinic pharmacy catalog!",
"data": { "medicine_id": 6, "quantity_in_stock": 100 }
}
Student Medical Profiles & Allergy Registry
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Student medical profiles directory retrieved",
"data": [
{
"id": 8,
"full_name": "mukibi hr",
"blood_group": "O+",
"allergies": "Penicillin (Moderate rash)",
"chronic_conditions": "Mild Asthma"
}
]
}
Request Payload:
{
"student_id": 8,
"blood_group": "O+",
"allergies": "Penicillin, Peanuts (Severe)",
"chronic_conditions": "Mild Asthma",
"special_diet": "Peanut-Free Diet"
}
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Student medical profile & allergy registry updated successfully!",
"data": null
}
Request Payload:
{
"student_id": 8,
"vaccine_name": "Human Papillomavirus (HPV)",
"dose_number": 2,
"date_administered": "2026-08-30",
"batch_number": "BATCH-HPV-42"
}
Sample Response (`201 Created`):
{
"success": true,
"status_code": 201,
"message": "Recorded Human Papillomavirus (HPV) immunization cleanly.",
"data": { "immunization_id": 2 }
}
Shift GPS Attendance & Duty Clock-In
Request Payload:
{ "latitude": 0.3541, "longitude": 32.5912 }Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Nurse duty shift clock-in recorded at 07:45 AM",
"data": { "action": "clock_in", "check_in_time": "07:45:00", "date": "2026-08-30" }
}
Salary, Shift Allowances & Payslips
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Nurse salary and payslip records retrieved",
"data": {
"salary_structure": {
"basic_salary_ugx": "900000.00",
"medical_allowance_ugx": "150000.00",
"night_duty_allowance": "100000.00",
"net_salary_ugx": "1150000.00"
},
"payment_history": [
{ "month_year": "July 2026", "amount_paid": "1150000.00", "payment_method": "Bank Transfer" }
]
}
}
Messaging & Medical Consultations
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Clinic support and consultation chats retrieved",
"data": [
{ "id": 14, "ticket_number": "MED-20260830-7119", "subject": "Urgent IV Drip Fluid Requisition", "status": "open" }
]
}
Health Bulletins & Alerts
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Nurse notifications retrieved",
"data": {
"unread_count": 1,
"notifications": [
{
"id": 55,
"title": "Hospital Transfer Authorization Granted",
"message": "Parent authorized transfer for student mukibi hr to Nsambya Hospital.",
"is_read": 0
}
]
}
}
Academic Calendar & Health Campaigns
Sample Response (`200 OK`):
{
"success": true,
"status_code": 200,
"message": "Academic calendar events retrieved",
"data": [
{
"id": 6,
"title": "Term 2 Full School Health & Dental Screening",
"start_date": "2026-08-27",
"end_date": "2026-08-28",
"event_type": "Health & Safety"
}
]
}
Red Alert Medical Emergency Panic Dispatch
Request Payload:
{
"emergency_type": "Acute Anaphylaxis / Severe Respiratory Distress",
"location": "School Central Sickbay - Emergency Bay",
"notes": "Student collapsed with severe breathing difficulty and swelling. Epinephrine administered. Ambulance dispatched."
}
Sample Response (`201 Created`):
{
"success": true,
"status_code": 201,
"message": "Medical red alert emergency panic broadcast dispatched to school administration and ambulance units!",
"data": { "incident_id": 29, "emergency_type": "Acute Anaphylaxis / Severe Respiratory Distress", "status": "Dispatched" }
}
SDK Code Examples
import axios from 'axios';
const BASE_URL = 'http://localhost/edupulse/index.php?api=nurse';
export const nurseApi = axios.create({ baseURL: BASE_URL });
export const setNurseAuthToken = (token: string) => {
nurseApi.defaults.headers.common['Authorization'] = `Bearer ${token}`;
};
// 1. Scan Student Patient Barcode / ID
export const scanPatientBarcode = async (scannedCode: string) => {
const res = await nurseApi.post('&action=scan_barcode', { scanned_code: scannedCode });
return res.data;
};
// 2. Log Health Incident
export const logHealthIncident = async (payload: {
student_id: number;
symptoms: string;
severity_level: 'Mild' | 'Moderate' | 'Severe / Emergency';
incident_time?: string;
}) => {
const res = await nurseApi.post('&action=incident_log', payload);
return res.data;
};
// 3. Record Vitals & Clinical Assessment
export const recordAssessment = async (payload: {
incident_id: number;
medical_assessment: string;
temperature_celcius?: number;
blood_pressure?: string;
pulse_rate?: number;
sickbay_bed_number?: string;
medication_given?: string;
}) => {
const res = await nurseApi.post('&action=record_assessment', payload);
return res.data;
};
import 'dart:convert';
import 'package:http/http.dart' as http;
class NurseApiService {
static const String baseUrl = 'http://localhost/edupulse/index.php?api=nurse';
String? _authToken;
void setToken(String token) {
_authToken = token;
}
Map<String, String> get _headers => {
'Content-Type': 'application/json',
if (_authToken != null) 'Authorization': 'Bearer $_authToken',
};
// 1. Universal Patient & Health Barcode Scanner
Future<Map<String, dynamic>> scanBarcode(String code) async {
final response = await http.post(
Uri.parse('$baseUrl&action=scan_barcode'),
headers: _headers,
body: jsonEncode({'scanned_code': code}),
);
return jsonDecode(response.body);
}
// 2. Log Health Incident
Future<Map<String, dynamic>> logIncident(Map<String, dynamic> payload) async {
final response = await http.post(
Uri.parse('$baseUrl&action=incident_log'),
headers: _headers,
body: jsonEncode(payload),
);
return jsonDecode(response.body);
}
// 3. Record Assessment & Vitals
Future<Map<String, dynamic>> recordAssessment(Map<String, dynamic> payload) async {
final response = await http.post(
Uri.parse('$baseUrl&action=record_assessment'),
headers: _headers,
body: jsonEncode(payload),
);
return jsonDecode(response.body);
}
}