Timetabling is a headache for any headteacher, but imagine having to ensure some pupils never cross paths during the school day in case they pass on a potentially fatal infection to each other.
It is just one of a number of logistical problems that Maureen McGeever has to deal with at Ashcraig school, where all 125 S1 to S6 pupils have a physical disability, visual impairment or suffer from a chronic illness.
Pupils' conditions include muscular dystrophy, cerebral palsy, polio and rare conditions such as Pearson's syndrome, which affects the cells of many organs. Half of the students are wheelchair users.
The school, in north-east Glasgow, has a well equipped medical department and team of 10 nurses and therapists. It is not quite a hospital in a school but it comes close. Some Yorkhill Hospital doctors hold clinics in the school because so many of their patients are pupils there.
All the classrooms have emergency buttons with a direct line to the medical bay. Physiotherapy and occupational therapy is factored into the pupils'
timetables. Clinics are also held to help pupils cope with chronic pain.
Natasha Rafiq, aged 14, is one of four girls with cystic fibrosis. They all need physiotherapy three times a day - once during school hours - to clear the excessive mucus that builds up in their lungs.
"The four girls cannot meet," Ms McGeever says. A one-way corridor system has been devised to make ensure they do not bump into each other and they must spend their lunchtime in different allotted places in the school.
There are timetables for physiotherapy. "There has to be a delay of 20 minutes between the sessions to allow any infection to die," Ms McGeever says.
Natasha, who has aspirations to be a lawyer and likes playing football, expresses only occasional irritation about the effect her condition has on her life.
"You can't go near your friends with cystic fibrosis," she says. "I get medicines in the morning and two or three times at night. Whenever I eat I get tablets. I get a nebuliser before my physio. It is just annoying sometimes."
Every four months Natasha spends up to two weeks in hospital. However, because Ashcraig is so well equipped and staffed - there are 39 teachers and 30 support staff, as well as the therapists and nurses - she can attend school during the day and return to the hospital ward at night.
The school offers a broad secondary curriculum organised on traditional lines, with pupils offered a similar range of subjects to mainstream school students. Emphasis is put on supporting and encouraging children to realise their academic and personal potential. They are expected to meet individual targets within the 5-14 curriculum and sit and pass exams, from Access levels to Standard grades, Intermediate and Higher. In 2004-05, more than 70 per cent of leavers went on to full-time further education.
There are no more than eight pupils in a class and they benefit from co-operative teaching by two or more teachers.
The philosophy at Ashcraig is that how a person's disability affects their learning should be understood but pupils are expected to keep up with their work and achieve within the constraints of their illness.
"It is not the curriculum that is different to mainstream schools, it is the delivery of the curriculum that is different," says Ms McGeever.
"There are no general answers in a school like this. In a mainstream school it is all about intellectual capacity. Here it is about intellectual and physical capacity."
School trips are harder to organise than in mainstream schools but they do happen. Students have been to France and Barcelona and a group recently went to Yorkshire to an underground cave accessible to wheelchair users.
Forward planning is crucial. When the students went to France, they travelled by air but a bus was needed to transport oxygen, sleep equipment and hoists.
Despite the jolly atmosphere that greets visitors, some of the pupils have very serious illnesses and the school has bereavement procedures and works with health agencies to support children who have lost close friends.
"Between Easter and summer last year, two pupils and two former pupils died," says Ms McGeever. "That is hard."
Among them was Britain's then youngest heart transplant patient.
But one striking aspect of Ashcraig is how much like a busy, happy mainstream school it feels.
"Everyone expects hushed tones in this special school," says Ms McGeever.
"We work with cheeky, normal, lively children."