{'fraction_non_alphanumeric': 0.02133057695921819, 'fraction_numerical': 0.008457056944183423, 'mean_word_length': 4.709763948497854, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Sleep disorder diagnosis expert system using certainty factor method

Sleep disorders is a disorder experienced by a person when the REM and NREM cycle don’t work normally. Prolonged sleep disorders can cause a variety of bad conditions such as depression, fatigue, reduce work, performance and endurance. It quickly offended till affect to our own safety. The latest study in 2018 conducted by Dr. Welly Sondakh, MPH in Jakarta revealed that there were 10% of people with insomnia from the Indonesian population or around 28 million people. The low public awareness of sleep disorders causes them to need alternative media, namely an expert system to diagnose sleep disorders. Expert system is a system that uses the knowledge of an expert to solve a problem in a particular field where the system is not limited by time and can be used by many people. The method used in this system is Certainty Factor as an inference engine to determine the results of the diagnosis based on the symptoms determined. The calculation of this method combines the MB (measure of increased belief) and MD (measure of increased disbelief) values obtained from experts. From 50 test data, 45 data were obtained so that the accuracy level reached 90%. This shows that the expert system of diagnosing sleep disorders is suitable for early diagnosis of sleep disorders.


Introduction
Sleep is a need that must be fulfilled by everyone in order to maintain their body health optimally. Sleep has many benefits including being able to restore body fitness after activity, eliminating mental anxiety, controlling emotions, etc. [1]. A good sleep pattern can be measured in terms of the quality and quantity of sleep. Sleep quality is seen from how many hours we sleep effectively while the quantity of sleep is seen from the number of hours of sleep [2]. Sleep needs of each individual vary according to the age increase but in general the duration of sleep is around 7-8 hours [3]. A good sleep pattern can maintain our health but if someone's sleep patterns are bad it can trigger sleep disorders. Sleep disorders cannot be considered as a common disease because prolonged sleep disorders can cause a variety of bad conditions such as depression, fatigue, reducing work performance and endurance, quickly offended even to affect our own safety [4]. This is related to cases of sleep disorders such as insomnia which often occur in the United States resulting in accidents. Accident costs associated with sleep disorders reach one hundred million dollars per year [5].
Based on the Sleep Journal study, it was found that there were 150 million people in the world experiencing insomnia [6]. In addition, a recent study conducted by Dr. Welly Sondakh, MPH in Jakarta revealed that there were 10% of people with insomnia from the Indonesian population or around 28 million people [7]. The results of these studies indicate that the most common sleep disorders in the wider community, especially Indonesia, namely insomnia and sleep disorders must be treated immediately, so there will be no more Indonesian people who suffer from the disease. The number of people who consulted about insomnia is very little when compared to the number of people with insomnia in Indonesia which can be seen in the medical record data of one hospital, namely Al-Islam Hospital Bandung. Based on the medical record data in 2016 there were 114 outpatients and 1 inpatient patient and 2017 there were no patients treated with either INAP or outpatient who consulted about insomnia. In 2018 there were 20 outpatient patients who consulted about insomnia [8]. This shows that the lack of public awareness of sleep disturbances so they need alternative media, namely an expert system to diagnose sleep disorders.
In the results of discussions with 2 psychiatrists at Al-Islam Bandung Hospital and 1 psychology lecturer at Sunan Gunung Djati State Islamic University, Bandung, there is no expert system to diagnose sleep disorders so far. Expert system that uses the knowledge of an expert to be applied to a system to solve a problem. Expert systems are not limited by time and can be used by many people [9].
In this system, the inference engine used is the Certainty Factor method. The method is usually used as a clinical parameter that can show the amount of trust the expert [10]. The aim of this study is to build an expert system of sleep disorders using the Certainty Factor method. It is expected that it will help the community to know the results of diagnosed sleep disorders.

Expert system
Expert systems are the most extensive field of artificial intelligence. Fields that are characterized by systems based on knowledge (knowledge based system) allow computers to think and draw conclusions from a set of rules [11]. Experts are someone who has expertise in a special field that is not owned by ordinary people [12].
Many fields have used expert systems to facilitate their work ranging from communication, psychology, health and others. Expert systems try to provide the best solution to solve problems as done by experts. In addition, the expert system can provide reasons for the solutions or conclusions found and an explanation of the steps that have been chosen [13].

Certainty factor method
The Certainty Factor method is a method proposed in 1975 by Shortlife and Buchanan to accommodate the uncertainty of thought. Certainty Factor is a measure of certainty about a rule or fact.

CF [h, e] = MB [h, e] -MD [h, e]
(1) Information: CF (h, e): certainty factor of hypothesis h which is influenced by evidence e. MB (h, e): measure of increased belief in hypotheses h which is influenced by evidence e. MD (h, e): a measure of increase in distrust (measure of increased disbelief) against the hypothesis h which is influenced by evidence e [13].The CF value data is obtained from a reduction between the MB value and the MD value. CF value data is used for the combination calculation process between MB and MD so that the results obtained from the consultation. By studying the results of interviews with experts, we obtained a

Prototype method
Prototype is one of the software development methodologies whose planning is carried out quickly where there is repetitive feedback and system improvements to suit user needs [14]. Following are the stages in the prototype methodology according to Roger S. Pressman.
 Listen to customers: gather the need to build a system by listening to the needs of customers. At this stage, an understanding of the system that is running is needed so that the problem occurs.  Build / revise mock-up: design and create a system prototype that will be made according to customer needs.  Customer test drives mock-up: prototypes of the system will be tested by customers. Then, evaluating the shortcomings of customer needs. In repairing the prototype that has been made, it returns to listening to complaints from customers [15].

Analysis of proposed systems
Based on the problems in the running system described earlier, the proposed system is an expert system for diagnosing sleep disorders. The community environment is the right location to operate this system. People can easily access it anytime and anywhere because this system is website based. In this system, not only can you provide information about the types of sleep disorders experienced but also how to handle them. The system will be built using expert knowledge such as a psychologist or psychologist. Knowledge is in the form of data on types of sleep disorders, symptom data, treatment and treatment data.
The first thing the user does is access the user's page from an expert system diagnosing sleep disorders. After that, users can get information about understanding sleep disorders on the home page. In addition, there is an information page that contains an explanation of the expert system itself as well as a page on the type of sleep disorder that contains an explanation of 6 types of sleep disorders based on the Pocketbook Diagnosis of Mental Disorders, PPDGJ-III and DSM-5.
Users consult with the consultation menu. On the page, users see several symptoms that are displayed based on the symptom database where the symptoms can be chosen by the user by checking these symptoms. Users can check more than one symptom. Symptoms that have previously been chosen by the user will then be checked by the system and adjusted to the database of symptoms and illnesses of sleep disorders. After that, the system calculates the Certainty Factor method which assumes the degree of expert confidence in a symptom in certain sleep disorders. In the calculation process, a relation database is needed that contains the relationship between symptoms and disease along with the MB and MD values. The calculation produces the largest percentage CF value that will be used as the final conclusion in the diagnosis process. After the system performs the calculation process with the Certainty Factor method, the results of a diagnosis of sleep disturbance from the user will appear. Figure 2.4 is a plot of the proposed system in the form of an expert system for diagnosing sleep disorders.

System design
Data Flow Diagrams (DFD) is a diagram consisting of certain symbols to describe the flow of data from the system [17]. Figure 2is one example of DFD found in expert systems diagnosing sleep disorders.

Results and discussion
System accuracy testing is done to test the accuracy of the system made. The manual calculation of the calculation of the Certainty Factor method will be compared with the calculation of the Certainty Factor method from the system. Based on the tests that have been carried out on 50 test data obtained 45 data that is suitable, the expert system diagnoses valid sleep disorders with an accuracy rate of 90%.

Conclusion
Sleep disorder diagnosis expert system is a system that can provide information about sleep disorders experienced by the user based on the symptoms in the right input first. The method used in the process of calculating the diagnosis of the system is certainty factor. Calculation in the method involves an MB (measure of increased belief) or trust value and MD value (measure of increased disbelief) or the value of distrust obtained from previous experts. These experts are psychiatrists and psychologists.
The results of the system t accuracy test, which is from 50 test data, obtained 45 corresponding data so that the accuracy rate reached 90%. This shows that the expert system of diagnosing sleep disorders can run well according to expert diagnoses from the manual calculation of the certainty factor method