Development of an Online Sleep Diary for Physician and Patient Use

This paper describes the development of an electronic sleep diary and outlines its advantages over the traditional paper based approach still used by many sleep centres throughout the world. A sleep diary is a record of sleep details filled in by a patient normally over a period of two weeks. This information is then used by a physician as a diagnostic tool for identify sleep disorders in the patient. The development method used was convergent interviews with sleep specialists in order to establish initial requirements. This was followed by a rapid prototyping approach in order to produce the final specification. This paper concludes that an online sleep diary is a low cost, viable alternative offering benefits to both patients and physicians. The benefits to patients include the ability to perform functional analysis of their own sleep habits (referred to as sleep hygiene) and to determine factors affecting their sleep patterns. This knowledge leads to greater patient understanding of their circumstances and can lead to a potential increase in patient, physician collaboration. The physician gains access to timely accessible patient information as well as to an evidence database that will allow for greater analysis of sleep disorders throughout the general public over time.


Introduction
A physician typically receives information on a patient from a number of sources.These sources may be from a referral, previous medical history, test results, or from the patient themselves.The physician makes a decision for patient care after weighing the evidence and applying their training and knowledge to the problem.This projects aims to improve the timing of a major source of information used to diagnose sleep disorders; namely the patient's sleep diary, by developing an online sleep diary.Sleep diaries are a primary aid in the diagnosis of sleep disorders as sleep patterns impact on the symptoms a patient displays.
Sleep disorders have traditionally been under diagnosed by a primary physician, with only those patients who are very symptomatic being referred to sleep specialists (Bailes, et al., 2008).There has been increased awareness of sleep disorders among physician's and the wider community imposing an increased burden of disease on the current health system.This has led to a shortage of sleep specialists (Australian Medical Workforce Advisory Committee, 2000; Patlak, 2005).The burden of disease has led to interest in the sleep community to changing the traditional model of care for sleep disorders to one that leverages information systems to provide efficiencies and timely communication flows (Colten & Alterogt, 2006).Abidi (2001, p. 6) refers to the strategic use of knowledge derived from healthcare data as being "… pertinent towards the improvement of the operational efficiency of the said healthcare enterprise".Hirakis & Karakounos (2006) state that knowledge management in healthcare allows the development of best practice models and encourages innovation through development of the resultant knowledge base.

Sleep Diary
A sleep diary is used to record sleep patterns usually for fourteen nights.The person notes the details of their nights sleep day-by-day building up a picture of sleep habits known as sleep hygiene.Poor sleep hygiene, or insufficient time made available for sleep may be a cause of excessive daytime sleepiness, the main symptom of a sleep disorder.Therefore a sleep diary can be used to identify a cause for daytime sleepiness, lifestyle reasons or a sleep disorder.Sleep diaries are used by a number of health professionals, including psychologists, physicians and sleep specialists and is the primary diagnostic tool for identifying insomnia.It is a very useful aid to the diagnosis of other sleep disorders, as relatively short periods of time taken to fall asleep or frequent awakenings are indicators of poor quality sleep and sleep disorders.
During an exploratory interview early in a project to review sleep diagnosis, the remark was made by a director of a large public health clinic that "… sleep diaries were a good tool which were not being used efficiently due to the timing and the short length of time available in the consultation to extract information from the data" (J Douglas 2009, pers.Comm.23 Sept.).The current format of the sleep diary used in the sleep investigation unit under study is a pen and paper questionnaire in which the patient colour in a square between two times, for example nine and ten o'clock, to indicate bed time and waking up time.This creates a situation where the sleep physician must clarify what time the patient actually meant to mark.The data contained in the completed sleep diary requires manual calculation to extract daily entries, aggregate the data and calculate the required sleep statistics and is in a format that is difficult to quickly assimilate within a time limited consultation.Due to the low utility of this current model of use the physician has difficulty in using a sleep diary effectively.The information in the sleep diary is also in a format in which a patient can not extract information without physician assistance.
Patient access to the information contained in an online sleep diary means the patient gains increased self knowledge of their sleep hygiene, which has been shown to improve health outcomes (Smith, Lang, Sullivan, & Warren, 2004).Patients will be able to self monitor their sleep patterns.Wilde and Garvin (2007, p. 343) define self monitoring as "awareness of symptoms or bodily sensations that is enhanced by periodic measurements recordings and observations to provide information for improved selfmanagement".Self monitoring of sleep patterns means that the patients have an opportunity for shared decision making with their physician on the management of their sleep disorder.Shared decision making is a significant factor in compliance with treatment plans (Sheppard, et al., 2009).This is important in a chronic condition such as a sleep disorder which has an ongoing treatment burden.
The physician gains earlier access to patient sleep hygiene information and can therefore prioritise those patients who need to be seen first; ensuring those in the most need of the service will have the shortest wait times.It is also forecasted that patient satisfaction with the service will increase as during the wait time for an appointment they are able to self-monitor their condition, Therefore the online sleep diary has a number of benefits, namely; 1. the data contained within the diary is presented in a summarised, readily accessible format for both physicians and patients 2. The diary contents are available at any internet access point and in real time (subject to security precautions) 3. The diary facilitates the easy development of a database of sleep patterns and this can be used for historical data analysis.4. The online diary has all the advantages of digital data such as reuse, multiple storage locations and easier transferability of data to other medical professionals and statistical analysis.This paper will discuss the construction of the online diary and its importance to sleep hygiene.

Sleep hygiene
Good sleep hygiene helps to ensure good quality sleep.The guidelines for good sleep quality include having consistent sleep and wake times, avoiding caffeine, nicotine and alcohol before bedtime, avoiding heavy meals close to bedtime, exercise and sleeping in a darkened quiet room (Stepanski & Wyatt, 2003; The Boston Consulting Group, 2003).People who do not follow the sleep hygiene guidelines tend toward having poorer quality sleep, with the extent of sleep quality degradation being dependent upon the individual and the number of sleep hygiene guidelines not followed (Stepanski & Wyatt, 2003).Brown, Buboltz Jr and Soper (2002) found that increasing awareness of sleep hygiene through education did impact favourably on the sleep quality of healthy university students, with Bootzin and Stevens (2005) describing the regularising of sleep patterns as a powerful means of increasing sleep quality.However the following of good sleep hygiene rules in the presence of a sleep disorder such as insomnia is not enough on its own to remove excessive daytime sleepiness (Stepanski & Wyatt, 2003).
The sleep hygiene of a person is determined by looking at sleep patterns over a two week period, documented in a sleep diary that is filled in every day.These sleep patterns are expressed for a health professional in a number of standard sleep measures, described in the development of the online sleep diary section.Lifestyle factors such as caffeine and medication use may also be included in a sleep diary, along with indicators of mood on awakening.
Better quality sleep information is obtained when a sleep diary is filled out every day.This ensures that the person has the best recall of sleep quality and timing of sleep, Libman, Fichten, Bailes, and Amsel (2000) stating that questionnaires looking at respective sleep patterns are susceptible to memory distortion, whereas a sleep diary filled in every day has the ability to capture day to day variations, highlighting variations that may indicate problems such as sleep deficits in sleep patterns.This means that the recording of a persons sleep habits over a two week period in a sleep diary gives a baseline of a person's sleep patterns with greater precision than retrospective sleep quality questionnaires.
Disadvantages of a sleep diary is that a person may change their sleep patterns in reaction to the self-monitoring and the imposition of filling in the diary day to day (Libman, et al., 2000).However a sleep diary is the most widely used, practical and economical method of gauging sleep patterns (Lacks & Morin, 1992).

Benefits of a sleep diary
The benefit of a sleep diary is that it provides a tool to gather the details of sleep patterns using a range of easily understood questions in a simple format.While the gathering of day to day information requires commitment from the patient, the information gathered provides an insight into the patient's lifestyle and sleep habits.This information may allow a physician to suggest lifestyle changes, for instance lowering caffeine intake later in the day to reduce sleep disorder symptoms.Another benefit of a sleep diary is that it is less intrusive than a retrospective sleep questionnaire the patient fills in at a clinic.The patient does not need to leave their home and entries can be made as soon as the patient arises potentially improving the quality of the data and removing the stress of trying to recall past events in a waiting room.
Obstructive sleep apnea (OSA) is a common disorder.People with sleep apnea stop breathing repeatedly during their sleep (a apnea) or have episodes of abnormally shallow breathing (hypopnea), as many as hundreds of times in a single night (Young, Peppard, & Gottlieb, 2002).In approximately five percent of patients (Guilleminault & Philip, 1996) of OSA cases persistent excessive daytime sleepiness continues despite compliant treatment.Santamaria et al. (2007) suggest that in this case the existence of bad sleep hygiene and coexisting sleep disorders should be investigated.Coexisting sleep disorders typically worsen symptoms of excessive day time sleepiness.The effective use of a sleep diary by a physician may be used to diagnose a coexisting sleep disorder as well explore sleep hygiene issues.In 8 percent to 43 percent of older OSA patients the coexisting condition is insomnia (Smith, Sullivan, Hopkins, & Douglas, 2004) .Once a coexisting condition is diagnosed, treatment maybe carried out, potentially reducing the patient's symptoms to a level where the need for invasive OSA treatment can be removed (Smith, Sullivan, et al., 2004).

An online approach
The advantage of an online approach from the current pen and paper method has been mentioned earlier in this paper and the increased use and acceptance of the Internet is demonstrated by the following statistic.In the 2007 period 77 percent of Queensland homes had home internet access, which had increased by five percent from the 2006 period (Queensland Government Chief Information Office, 2008a).Minimal difference was shown in internet use between genders.These statistics show strong growth in computer use in over 65 year olds, their internet use having grown strongly in the year to 44 percent a 6 percent increase (Queensland Government Chief Information Office, 2008a).The percentage of home internet user's and the strong growth figures show that online forms are a practical alternative to paper based forms for a large proportion of this population.
One of the difficulties of an online IT approach is the need to design the system for an unknown user.Users of an online system will access it through a broad variety of connection mechanisms, with a wide variety of hardware and technical skill levels.This compares to the development of an organisational system with standardised connection, hardware and a known minimum technical standard (Taylor, Wade, & England, 2003).Useability must be a primary objective of an online tool, with Guenther (2004) stating that having a clear set of objectives for the user helps to make the online system high value.This project has two different sets of users, physicians and patients, so the online tool has to meet two different sets of objectives and expectations adding to the complexity of development.What the user wants to achieve from the site must also be considered (Weir, McKay, & Jack, 2007).This project needs to design the online tools to look and feel like a solid health orientated instrument in order to achieve user satisfaction for both groups.In the patient's case the tool needs to feel like an application that will provide good information to themselves and the physician, while in the physicians case the tool should provide a set of quality information in an easy to assimilate format.

Design and development methods
The concept of an online sleep diary was driven by a series of three one hour interviews with the director of a public Sleep Investigation Unit in Brisbane, Australia to discuss the sleep disorder diagnostic process.A convergent interviewing method as described by Dick (2002) was used, as an informal interviewing technique that is useful when the researchers are in some doubt about the information which is to be collected.Notes and impressions from the interviews were written in a journal and emailed to the interviewee for confirmation that these were aligned with what they intended to convey.An online search was carried out for existing online sleep diaries was carried out, a list of reviewed sleep diaries is contained in table one.Most of these sleep diaries contained the same elements, bed and wake times and questions on mood, caffeine intake and exercise.However the difference with our approach is the focus on both the patient's and physician's information needs.The majority of the sleep diaries accessible on the Internet are pen and paper designed to be printed and then completed.The sleep diary designed in this project offers coverage of reasons for waking, mood, a graph for patient information and a concise report for the physician.
A systems development life cycle approach was used to develop the software, using a rapid prototyping method, where a prototype of the software is developed quickly and goes through a number of iterations in development.This prototype is thrown out at the end of the development cycles and a new robust application coded (Strachan, 2006).A requirements document with the specifications of the new system detailed using Unified Modelling Language (UML) with an object oriented approach was produced.Using this document as a template a paper prototype was produced for approval, by the director of the sleep clinic.The suggested changes were then incorporated in a nonfunctional prototype built in Hypertext Markup Language (HTML) and Javascript.This prototype was placed online and comments requested from two directors of Australian sleep clinic's and sleep researchers, two in Australia, one in New Zealand and one in United Kingdom.The suggested changes were detailed and the online sleep diary sent for coding by an external software development house.The external software development house was an industry partner in the project and they were sent the software requirements document and the link for the online prototype sleep diary.

Printed
The development of an online application gives the form designer control over the order the form is filled in which means that the user can be constrained to the required pattern of information/collection.An online application also provides an opportunity to conduct validation of the entered data at the point of entry.Using validation in the sleep diary means that the physician does not need to question the patient about the data contained in the sleep diary, but may accept that the sleep statistics reflect the sleep patterns entered by the patient.The provided date and time stamping provide guidance to the physician if any there was any delay between a sleep event and the data entry.
Once the sleep diary is developed each form completion is cost effective, allowing large numbers of respondents or many repeated iterations of the form to be filled in.As the data is captured, automatically stored and is manipulated by the online form, data analysis is low cost and happens in real time for each form (Haynes, Sackett, Guyatt, & Tugwell, 2006).The automatic storage of data, gives an opportunity to collect good quality validated data for future research.This is important as at the moment no aggregated analysis is carried out on the present pen and paper sleep diary.Anecdotal evidence suggests that manually computing the data from a paper based sleep diary and the data entry of the information into a database requires a large time commitment from clinic staff.This means that the routine collection of sleep diary information to build an evidence base is unlikely to be given a priority outside of a specific research project.
To display information online, equity of access must be considered so that online tools have utility for the sight, hearing and physical impaired, users with little technical expertise must also be catered for.Wagner, Hassanein, and Head (2010) has suggested a number of guidelines for older users of web sites, including making sure visual elements are large enough to be seen and deciphered.He suggests that using elements that contrast highly with the background such as black elements on a white background assists.An uncluttered web page without too many elements claiming attention helps the user to make sense of the page, also using graphics only when necessary to illustrate or add to the site's function (Yen, Hu, & Wang, 2007).The expected age range of the users of the online sleep diary is fairly broad and computer literacy is variable.Most of the potential patients are greater than 45 years old and reasonably computer literate but to improve equity of access the sleep diary must be as accessible as possible across the whole spectrum of potential patients.
In the sleep diary interface we have used maximum contrast of black text on a plain white background, with a sans serif font and an uncluttered background.The uncluttered background means that the sleep diary can be personalised with for example an organisations logo without disturbing the readability of the questions.The plain background also helps to minimise the size of web application which means that those patients with slow download speeds are not penalised by having to wait for a graphic to download.
A user tries to make logical sense of the web page displayed at first glance, so that the design of the page must make logical sense, for instance headings are in a larger font.Design elements which are related need to be gathered together graphically, for example a question is contained within a frame.The graphical treatment of these elements needs to be consistent and predictable throughout the web site to aid usability (Williams, 2000).A linear web site plan where the user moves through the web application page by page helps to orientate the user so that they are aware of where in the web site they are (Guenther, 2004;Yen, et al., 2007).
The heuristic evaluation rules for websites detailed by Sharp, Rogers, and Preece (2007) were employed.The website has internal consistency, with phases carrying the same meaning throughout the web site with simple dialog.To aid internal consistency, formatting of pages fonts, font sizes and font colours are consistent.Shortcuts have not been used, as the sleep diary has a simple linear format which must be followed to gather complete information.The user's memory load is minimised with no information being required to be remembered from one part of the web dialog to the other.Validation will exist within the web forms so that for example a wake time before a sleep time can not be chosen, validation will also check each page for completeness.The feedback to the user from the sleep diary is the presentation of the sleep pattern graphic representing entered sleep patterns.To ensure data quality an incomplete sleep day entry will be discarded.
Screen shots of the online sleep diary are used in this section.The entry page of the online sleep diary is a log on page providing the facility to differentiate between physicians and patients and the means to authenticate users through the use of an identification number and user name.Differentiating between physicians and patients is important to customise their interaction with the web site.To facilitate the physician's use of the tool the physician goes directly from log on to the sleep statistic page for the entered patient number.The patient will be taken to the next page of their current sleep diary, so that they may continue to complete their sleep diary.
At the first visit to the web site the patient is required to complete a consent form.This is necessary to ensure that informed consent is given to the use of de-identified data being used to form an evidence database.The withholding of permission by a user however has no impact on how they may use the web application.The online sleep diary therefore fulfils the function of a data collection point.

Figure 1. Bed time page
The bed time page shown in figure one requires the user to pick from a drop down box, the time they went to bed, the time they settled for sleep and an estimate of how long it took them to go to sleep.Bootzin (2005) suggests that for good sleep hygiene a minimum amount of time is spent in bed before settling to sleep, no longer than ten minutes.This is so that bed time is associated with dropping off to sleep quickly.Sleep on-set latency is the amount of time between the person settling for sleep, for example turning of the light and the time when sleep occurred.People with insomnia tend to overestimate sleep latency while people without insomnia tend toward estimating the correct amount of time taken to fall asleep (Smith & Trinder, 2000).Sleep latency is used as an indicator of a sleep disorder.A short sleep latency time indicates a sleep deficit, while a long sleep latency time may indicate insomnia.
The wake time web page is shown in figure two, these four values form part of the sleep statistics used by sleep physicians to confirm a diagnosis.The subtraction of the time the user got up from bed from the time they went to bed gives the time available for sleep.To produce a value of the total sleep period statistic, the time of sleep onset to the time of final awakening is calculated.Total sleep time is the total sleep period less the time spent awake during the sleep period.Total wake time is the addition of wake time during the period available for sleep.Sleep efficiency is a percentage measure of the total sleep period divided by the total sleep time.These sleep statistics help the sleep physician to assess the quality of sleep and some sleep habits.This page also provides an opportunity for the user to perform some functional analysis, for example if sleep environment factors are consistently keeping them awake or affecting their ability to maintain sleep.In this instance the consultation provides an opportunity to ask the sleep physician what they can adjust to change the waking pattern.If choking or suffocating is checked as a reason for waking then a pop-up page is used which requests more information on the episode.This information aids the physician in diagnosing the reason for the feeling of choking or suffocating.
Lack of refreshing sleep and excessive daytime sleepiness can manifest itself as a feeling of irritability and apathy, and is an indicator if excessive daytime sleepiness is a problem in the user's life, the sleep quality page is shown in figure four.The data contained in this page can be used to demonstrate the importance of compliance with treatment, if the user is reporting waking feeling tired and irritable.This data is also useful for research into the impact of sleep patterns on mood.
The statistics page shows a graph of the sleep patterns and a summary of sleep measurements such as sleep efficiency, sleep latency and the number of times the user woke after falling asleep.The presentation of the complete set of summary sleep measures in a format which is immediately usable to the physician will facilitate the physician's diagnosis by removing time pressures and ensuring that the information contained in sleep diary is used efficiently.One of the complications with the implementation of this application is the need to fit the application inside guidelines set by the government for patient privacy, for instance a patient number cannot be used as an identifier.The need for a different number is to satisfy the National Privacy Principles stated in the Queensland Governments information architecture for the Department of Health (Queensland Government, 2001) which was last reviewed in April 2008 (Queensland Government Chief Information Office, 2008b) which states that an identifier that has been assigned by an agency cannot be adopted by an outside application.A user number which is unique and different to a patient number will be assigned.The assignment of a user number by an application outside of our control means that there is no link to identifying user data held in the projects database.

Conclusions
The initial reaction to the implementation of the sleep diary on an external server has been favourable with a number of organisations outside of Queensland Health expressing interest.The online sleep diary is intended to form part of a group of online tools for use by patients and general practitioners to provide information to the users in a readily accessible, easy to understand format.These tools will provide patients with an avenue to self-assess sleep patterns and habits in a readily assimilated graphical format to support good health.It is also an aim that the physicians will gain standard, validated tools for patient appraisal in sleep disorder treatment; and online tools which facilitate the collection and distribution of high quality data to provide support to physicians in patient assessment.
The current utility of the pen and paper sleep diary is low, with the physicians unable to take the time to use this tool as effectively as they would wish.The patient also gets little reward for the commitment to filling in the dairy every day for a fortnight, as information is difficult to extract without specialist knowledge.Therefore an online sleep diary offers a number of benefits, as both physicians and patients receive readily assimilated information.The physicians have access to the information earlier in the diagnostic interaction.While the patients gain self-knowledge which allows them to potentially become partners with the physician in the management and/ or treatment of symptoms.The provision of increased patient knowledge at the first consultation means that the physician has the opportunity to talk to the patient about their specific sleep hygiene practises during the first consultation.Therefore this consultation moves away from a mainly information gathering exercise toward a collaboration between the patient and physician.
Wait times for an appointment with a sleep physician may be extended Flemons et al.(2004) state that in United Kingdom a wait of six months for non-urgent cases is average, with an average wait time in Australia of nine weeks.An online diary used in a sleep clinic setting has the ability to bring forward information gathering on a patient's sleep hygiene to before a patient's first appointment with a sleep physician.Physician access to an increased amount of patient knowledge early in the patient physician interaction means the physician can better assess the urgency of a patient's need for services.Another benefit to early patient information is that a recommendation that the patient see another health professional during the wait time can be made.For instance a sleep diary coupled with a physician's assessment is the primary diagnostic tool for insomnia (Lacks & Morin, 1992; Morin, Colecchi, Stone, Sood, & Brink, 1999), so that the sleep physician may be able to recommend the patient visits a psychologist for help with insomnia without the need for a extended physical appointment.This means that the patient is spared an extended wait for service, only to be told they need to wait for an allied health professional.This short cut potentially increases satisfaction with the service provided and the physician has increased time to see other patients.
The user is able to enter the date of the sleep event in the online dairy, however the sleep entry is also date and time stamped.This date stamping is to provide the physician with a guideline to the quality of the sleep information contained in the diary.As recollection of past events may degrade the quality of the provided information (Libman, et al., 2000).
The online sleep diary will produce a summary report which may be printed both for the person filling in the diary and a physician.This summary report gives access to sleep statistics, such as mean sleep efficiency, mean sleep length, range of sleep latency and sleep duration in a quickly assimilated format which has direct utility for assistance in a diagnosis of a sleep disorder.The summary report may also be filed in a patient record to provide a baseline for future sleep diary reports for the physician and patient.The summary report of sleep statistics also plays a role in the formation of the evidence base as the statistics give a means to perform cross patient comparisons using well defined parameters of sleep characteristics.The statistics along with the base data will allow the development of a database which facilitates the analysis of the data in a holistic way.This database will expedite the development of an application such as an Artificial Neural Network which can draw inferences from the data to provide an objective second opinion for the physician for a sleep disorder diagnosis.
A summary report of sleep hygiene practises may also be useful for the user to take to their primary care physician if the user is concerned about excessive daytime sleepiness.Potentially this means that primary care physicians may refer patients with moderate symptoms of a sleep disorder to a sleep specialist as sleep disorders are under diagnosed in all but the most symptomatic patients (Kramer, Cook, Carlisle, Corwin, & Millman, 1999).The online sleep diary may also be used by primary physicians to explore alternative explanations such as insomnia, or poor sleep hygiene for symptoms of depression such as fatigue.
The facility to export the data contained in the online sleep diary in an eXtensible Markup Language (XML) format will also be provided.This means that organisations other than that hosting the sleep diary can receive patient data in an electronic format, facilitating use of electronic record keeping.

Figure 2 .
Figure 2. Getting up time