Import Duty Roster

Upload a CSV file to import nurse duty schedules for {{ $clinic->name }}

@if (session()->has('success'))
{{ session('success') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif

Upload CSV File

Select Week for Import

Important: Importing will REPLACE all existing duties for the selected week. Any previous assignments for that week will be deleted.

Choose which week this duty roster is for. The system will automatically assign duties to the correct dates (Monday to Friday) of the selected week.

@error('selectedWeek') {{ $message }} @enderror @if ($selectedWeek) @php $weekStart = \Carbon\Carbon::parse($selectedWeek)->startOfWeek(); $weekEnd = $weekStart->copy()->addDays(4); @endphp

Selected Week:

@foreach(['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] as $index => $dayName) @php $dayDate = $weekStart->copy()->addDays($index); @endphp
{{ $dayName }}
{{ $dayDate->format('M j') }}
@endforeach

Week of {{ $weekStart->format('M j') }} - {{ $weekEnd->format('M j, Y') }}

@endif

Need a template?

Download our CSV template to ensure your duty roster data is formatted correctly.

@error('csvFile') {{ $message }} @enderror @if ($csvFile)

File selected: {{ $csvFile->getClientOriginalName() }}

@endif

CSV Format Requirements:

Simple 3-Column Format:

nurse_name, day, room

Important Rule:

Every room MUST have a responsible nurse every day!
Example: If you have 4 rooms (A, B, C, D), you need 4 nurses assigned for Monday, 4 for Tuesday, etc.

  • nurse_name: Full name of the nurse (e.g., "PHN Kasimas binti Hussin", "Nurse Sarah")
  • day: Monday, Tuesday, Wednesday, Thursday, or Friday (all 5 working days)
  • room: Room code (e.g., A, B, C, D) - same as Zone code

Example for Monday with 4 Rooms:

Nurse 1,Monday,A
Nurse 2,Monday,B
Nurse 3,Monday,C
Nurse 4,Monday,D

✓ All 4 rooms covered on Monday
✓ Repeat for Tuesday, Wednesday, Thursday, Friday

Note: Room = Zone. If a nurse is assigned to Room A, they are responsible for Zone A. The system automatically calculates dates based on the selected week.

Public Holidays: If there's a public holiday during the week, simply skip that day in your CSV file. For example, if Wednesday is a public holiday, only include Monday, Tuesday, Thursday, and Friday in your roster.

Tip: Download the template above to see a complete example with all rooms assigned for all 5 working days (Monday to Friday).

Back to Duty Management
@if($showResults && !empty($importResults))

Import Results

@foreach($importResults as $result)

{{ $result['message'] }}

@endforeach
@endif