A Framework for Systematizing Personalized Thai Herbal Medicine: A Case Study Covering Gynecological Conditions

: Thai Traditional Medicine (TTM) is an integral part of Thai traditional culture, with a history which spans many centuries. As part of this tradition, a significant number of historical pharmacopoeias and herbal textbooks have been preserved but much of the content of these texts is hard to access and interpret and so this paper proposes a framework for applying knowledge management processes to TTM. The outcome of this is the design and development of a system for making personalized prescriptions of Thai herbal medicines. By extracting and capturing knowledge from the TTM text ‘ Pra Kampee Maha-Chotarat ’ (an ancient text on the subject of gynecological conditions) and through consulting with TTM experts, a system was developed to support TTM consultants when making individual prescriptions for traditional medicines. The association rule mining technique was used to obtain recommended herbal compositions and the system was evaluated by experts, who gave feedback on the design, content and usage of the system. The proposed framework and system has the potential to be extended to cover the treatment of other diseases by drawing data from other TTM texts.


Introduction
Traditional Medicine (TM), a broad phrase for medical knowledge, skills and practices which are based on local cultural beliefs and materials, has been used for many centuries for the maintenance of good health and the treatment of both physical and mental illnesses. In many countries, TM is used as part of the primary health care system and this is especially true in developing countries, where local materials and herbs are cheap and easy to access and where their use is in accordance with local beliefs, cultures and traditions (WHO, 2001). Treatment with TM usually takes the form of herbal medications, which may be either general formulations or personalized prescriptions. Thailand is one of many countries with a long history of developing and using traditional medical systems and in the Thai case, these have included traditional herbal formulations, therapeutic massage and herbal steam baths and compresses. As stated, TM is based on local materials, beliefs, cultures and traditions and because of this, different countries or regions have developed different forms of practice. TM has also typically developed in families or local communities and been transferred through either written materials or apprenticeship (WHO, 2014).
In Thailand, many ancient pharmacopoeias and textbooks, which were initially developed based on trialand-error, have been passed down through the generations. These include texts such as 'Kra-sai', the 'Massage' text, 'Moranayanasut' and 'Maha-Chotarat' (Chokevivat et al., 2012). Sadly, many volumes have been lost, burned, or stolen for sale in other countries (HIT, 2012). Most of these texts were written in premodern or non-standard versions of Thai so in order to understand how to formulate Thai herbal medicines, Thai Traditional Medicine (TTM) experts or experienced practitioners are required to help decipher them.
Currently, the Thai Government and National Health Security Office promotes the use of TTM health services in conjunction with modern medicines by encouraging the prescription of personalized Thai herbal medicines (NHSO, 2016). Herbs are key components in TTM and these are traditionally divided into nine groups, according to taste: Sour, sweet, astringent, bitter, salty, spicy, oily, mao-buea, mild and fragrant, but when making Thai herbal medicines, the formulation is classified into one of three properties: hot, cold and su-khum (Tungkwampian et al., 2015).
It is observed that TTM texts typically do not state diseases and symptoms clearly, probably because in the past, diseases and symptoms were explained and defined using names and words specific to that place or period of time. However, the Thai Ministry of Public Health has established standard definitions of diseases and symptoms using the ICD-10 code (International Classification of Disease and Health Related Problems, 10th edition). In addition, the ICD-10 had been extended to support TTM, called ICD-10-TM. ICD-10-TM codes, which begin with U and run from U50 to U77 (THCC, 2015) are used for the diagnosis and treatment of diseases with TTM.
Recently, information systems have been used to support Thai traditional, complementary and alternative medicine, to make recommendations for herbal treatments and to build ontology-based TTM systems (Kato et al., 2010;Tungkwampian et al., 2015;Prakittikornchai, 2007). Such a move makes TTM easier to access and to process efficiently and potentially promotes TTM services, increasing the use of herbal medicines and preserving TTM knowledge. Moreover, some researchers have applied data mining techniques to general formulations and to personalized prescriptions in order to discover useful patterns of treatments and so support TM consultants in planning and decision making for patient treatment and in creating new formulations (Lin et al., 2013;Chen et al., 2016). This paper continues this work by describing a process for designing and developing a system for supporting TTM consultants in their diagnoses and then in prescribing personalized Thai herbal medicines. The proposed framework can be used in general cases, although the implemented prototype is specific to gynecological diseases since the system is based on Maha-Chotarat, which was compiled in the Ayutthaya period and which contains treatments for conditions affecting women, such as premenstrual manifestation and abnormal menstruation (Chokevivat et al., 2012). Due to its age, the language of Maha-Chotarat is however hard to interpret and without consulting TTM experts it is difficult to understand the text's exact meaning. Digitizing the information will help to overcome this. It should be noted that TTM has been used for the treatment of gynecological diseases for a considerable period of time but recently TTM has gained popularity especially in the management of symptoms arising during pregnancy (Somsap and Ingathawornwong, 2014).
The research presented here is divided into several parts. First, data were collected from the Maha-Chotarat, as well as from other TTM texts. TTM experts' requirements for the system were also gathered and related work in the field was reviewed. Second, the system requirements were analyzed and the system designed. The system had to support the diagnostic process of collecting basic information from the patient, providing medical formulations based on information extracted from the text, gathering information on herbs, recommending their use in treatments and indicating herbs' sensory properties. The proposed framework is presented below and the knowledge extraction and system implementation are described with examples of possible uses. Finally, conclusions are offered and possibilities for future work are presented and discussed.

Related Work
Many researchers have proposed the use of information systems to support medical diagnosis and healthcare for Complementary and Alternative Medicine (CAM) and modern medicine. Most of these are based on the concept of Expert System (ES), mainly using rule-based systems. For example, Silva et al., (2014) applied ES to support diagnosis and treatment with Traditional Chinese Medicine (TCM). By integrating data from three sources, which are general patient data, patient's symptoms and diagnosis and treatment information, the system then returned the list of suggested diagnosed. Similar to Nopparatkiat et al. (2014) who proposed the ES on recommending skin problem treatment in TTM, based on rule-based systems with the total of 416 rules from Thai herbal cosmetics formulations texts. Fernandez-Millan et al. (2015) recently proposed the ES on clinical diagnosis in primary healthcare. Moreover, some data mining techniques have been used to support CAM and TM in terms of recommended herbal compositions for treatments. Ali et al. (2016) proposed the CAM database for the treatment of Rheumatoid Arthritis (RA) based on the Indian TM. One source of the proposed database was formed by the data mining and data assimilation.
A series of applying data mining techniques on TM was presented by Chen et al., (2011;2014a). Chen et al. (2014b) studied Chinese Herbal Medicine (CHM) and Chinese Herbal Products (CHP) used to treat gynecological conditions in Taiwan. This was accomplished by using a nationwide database and applying to its records association rule mining to find relational patterns in Chinese personalized prescriptions. These relational patterns uncovered are as follows: • Premenstrual syndrome -From premenstrual syndrome data recorded between 1998 and 2011, the most commonly prescribed herb was Jia Wei Xiao Yao San (JWXYS The literature review shows that there are many proposed attempts to support TM in order to promote and expand the use and knowledge of TM to public and practitioners. However, from our extensive literature search there were no descriptions of approaches to develop a system for personalized herbal medicine. Therefore, this research has proposed the framework based on information technology and computer use for personalized Thai herbal medicines, which was initially introduced for the first time. The review also showed that by applying an association rule mining technique to herbal medicine treatments, useful relational patterns can be extracted from the database. The association rules were anticipated to be a key technique in finding relational patterns between herbs used to manage gynecological conditions. To achieve this, information from Maha-Chotarat was extracted and converted into a form of semi-structured data and then inserted into a database. Following this, an information system to support personalized Thai herbal medicines was constructed.

Proposed Framework
The proposed framework describes the components and processes used in the personalized Thai herbal medicine system. These includes knowledge capture, knowledge storage and knowledge development, as depicted in Fig. 1.

Knowledge Capture
This process is the most important, since it concerns the extraction of pharmacological knowledge from the Maha-Chotarat text (books 1 to 3) and its conversion into a form of semi-structured data, which can then be processed by digital means. This process, however, required the assistance of TTM experts to analyze the data and to categorize it into the three main datasets of herbs, formulations and diseases. This involved retrieving both explicit and tacit knowledge (Kimiz, 2005;Filemon and Uriarte, 2008). Explicit knowledge is knowledge that can be readily articulated, codified, accessed and verbalized and which can be easily transmitted to others. With reference to the text, some parts are understandable by using cognitive mapping, decision trees and techniques involving knowledge taxonomies. In contrast, tacit knowledge (or know-how) is the kind of knowledge that is difficult to transfer to another person by means of writing or verbalizing. Examples might be some kinds of working or cooking skills. As the contents of the text are hard to understand without expert knowledge, individual in-depth interviews and discussions with experts were carried out and their results applied here.

Knowledge Development
Knowledge development is used here to refer to a way of acquiring new knowledge from data or to knowledge captured in a prior process. As the goal of this paper is to develop a system for prescribing personalized Thai herbal medicines, there is a need to obtain key herbal compositions used for the treatment of diseases. In this study, association rule data mining techniques with an a priori algorithm are used as these are one of the most reliable and popular techniques used in the area of TM (Lin et al., 2013;Chen et al., 2011;2014a;Chu et al., 2015;Yang et al., 2015;Chen et al., 2016). The association rules are employed to define common herbs used for the treatment of a specific disease with the goal of supporting expert decision making when prescribing personalized Thai herbal medicines for a particular patient.

Knowledge Storage
Knowledge storage refers to the data center, which is constructed based on the database design and which holds the data and rules gathered and developed in the earlier processes. As shown in Fig. 1, the knowledge storage system contains data on herbs, formulations, diseases, relations and recommended treatments. This serves as the central data depository and it supports the functionalities and user interfaces of the recommendation system. Although in this system, the data are restricted to gynecological conditions and their treatment, the proposed framework could be extended to cover other texts and herbal treatments.

Data Collection
After in-depth interviews and discussions with TTM experts on the text were concluded, the data were grouped into three categories: Herbs, formulations and diseases, with these covering respectively, herbal compositions, ways of formulating herbal medicines and gynecological conditions, with codes based on the ICD-10-TM codes. Some 550 herbs are mentioned in the text, some of which are referred to with ancient and unfamiliar names. The taste of individual herbs was not included in the text, although this information is needed when formulating Thai herbal preparations and therefore, the taste of each was included, the information being drawn from other TTM texts or supplied by TTM experts. Table 1 shows sample records of herbs obtained from the knowledge capture process and approved by the experts. The herb data has five attributes: HerbID, English name, Thai name (vernacular name), used_part and taste.
The formulation category contains data on how to formulate Thai herbal medicines. The source text contains 167 preparations and each entry in the database includes fields for id, formulation name, book no. (of Maha-Chotarat), herbal composition (ingredients), solvent (material used for mixing or dissolving the ingredients, e.g., water, honey, flower oil or alcohol), preparation method (crushing into powder, forming into tablets, etc.), directions for use and indication (symptoms which indicate a particular treatment). An example is shown in Table 2.
The source text describes symptoms in terms of indications, as appear in the formulation data, but to align with standard ICD-10-TM codes, each formulation code was interpreted based on its accompanying indications and mapped to the most relevant ICD-10-TM code. This is shown in Table 3. This research only covers the application of the codes U50 to U52, which are specific to gynecological conditions, although with sub-codes, this gives a total of 47 gynecological codes.

Knowledge Development
After mapping relationships between formulations and diseases, we applied association rule data mining to find herbs commonly used for the treatment of each disease. The association rule was originally created to find patterns in product purchase behavior, using a market basket dataset. Association rules are obtained from items purchased based on the frequency of given items in the basket (Tan et al., 2011;Larose, 2014  Association rules are obtained based on two measures; support and confidence values. Support values refer to how frequently items in {antecedent} and {consequent} appear in market basket datasets relative to the total basket data, while confidence values refer to how confident one can be when the {consequent} will be purchased. The support value shows the frequency of X and Y in the dataset, as in the formula shown in (1): where, Freq(X∪Y) is the number of times X and Y appear in the dataset and N is the total number of records or transactions. The confidence value describes how frequently an item in Y appears in transactions that contain X: where, Freq(X) is the number of times X is found in the dataset. The herbal compositions in the formulations dataset are for each disease transformed into a market basket format before using WEKA to extract possible association rules. For example, as shown in Table 3, U51.01 (premenstrual manifestation, fever) is linked to 8 formulations. After applying association rule techniques in WEKA (by setting a minimum support and confidence of 0.3 and 0.5, respectively), it was found that there are 250 rules, including herbal compositions which were 2-combined, 3-combined, 4combined, etc. Table 4 displays some examples of the association rules for U51.01. The association rules can be further used as recommendations for combined herbal compositions when a TTM consultant is making a prescription. Examples of recommended combined herbal compositions for U51.01 are {haeomoo}→{boraphet} and {boraphet, kot tang ha}→{benjakul}. The data generated here was passed to experts for their approval before being added to the data center. The association rule technique was applied repeatedly for each disease (47 in total) and a set of combined herbal compositions, which were 2-, 3-, 4-, 5-and 6-combined, were then made available for use as recommended treatments for each disease.

System Development
This section describes how the system was developed and implemented. The system is divided into two parts: • Information and tools for any user, including TTM students and experts, to search Maha-Chotarat (books 1 to 3) • A system for TTM consultants to use to make personalized prescriptions of Thai herbal medicines when treating gynecological conditions The system is implemented as a web application using Bootstrap, to make the site responsive and PHP for server-side processing. MySQL is used for database management. Figure 2 shows a screen shot of the user interface allowing for the input of patient data such as name, address, date of birth, age, sex and previous medical conditions. If necessary, further information, such as weight, height, temperature, scale of pain, etiology, body element analysis and important symptoms can be added. After examining the patient, a consultant diagnoses the disease and assigns the diagnosis an ICD10-TM code. In Fig. 2, the diagnostic code is U50.3 (postpartum women not treated with Thai herbal dry sauna). This diagnostic code is used to indicate the association rules.
Following diagnosis and selection of the ICD10-TM codes, rules are generated and displayed as 'Recommended Herbs' (Fig. 3). In the case of Fig. 3, 2-combined herbal compositions have been recommended for the treatment of U50.3. When the consultant selects the treatment, s/he is required to state the quantity to be used (in grams). The 'Herbal Formulation' displays the herbs which are currently selected and the amounts to be used. The individual making the prescription can later deselect or modify these. 'Other Herbs' shows all herbs that can be added to the formulation, which the consultant can select based on his/her professional judgement. When the composition of the prescription is adjusted, the indicator of the sensational property is automatically displayed and this can be used for guidance, since the treatment's sensational property is an essential factor in making the correct prescription.
After inputting the formulation data, the system will display the details, including a list of the herbs to be used and in what amounts, how to prepare them, directions for use and the treatment's sensational properties. An example of this kind of personalized prescription is shown in Fig. 4.

Results and Discussion
Following design and construction, the system was tested and evaluated by four TTM experts, who judged it on three criteria: system quality, information quality and user satisfaction. These were scored out of 5 (the highest) and the system was awarded an average score of 4.027 with a standard deviation of 0.189 across the three categories. The expert evaluators expressed the opinion that the information was accurate, while the system itself was less satisfactory and needed to be improved. This might have been because the user interface and steps involved in formulating a prescription were quite complicated and not easy to follow, especially for those who are not familiar with the technology. Nevertheless, the experts expressed a positive opinion of the system and believed that it could be useful in supporting TTM consultants in formulating personalized Thai herbal medicines. In order to validate the quality and appropriacy of the recommendations obtained from the association rule mining, a questionnaire was distributed to the expert judges. Suitability was defined at three levels (high, medium and low) and three TM experts were asked to judge the appropriacy of 68 herbal treatments recommended for 6 conditions. The results, shown in Table 5, indicate that the prescriptions generated for U52.0 was, with an average score of 2.50 (or 83.33%), the most suitable. Overall, the average score was 2.28 (or 76%). This helps to confirm that the use of association rule mining was appropriate.

Conclusion and Future Work
This research proposes a framework for building an IT system to assist in making prescriptions of personalized Thai herbal medicines. The research applies knowledge management processes in order to collect data on specialized pharmacological knowledge from ancient Thai texts describing herbal treatments. This was done in cooperation with TTM experts, who were consulted during the data collection process. It is hoped that the proposed framework will help to contribute to the development of information technology systems in the Thai herbs and Thai herbal medicines sector. In addition, this project will help to make knowledge of TTM more accessible to the public. The proposed framework also supports the policy of the National Health Security Office, which encourages the use of personalized Thai herbal medicines to increase the effectiveness of treatments. By applying association rule data mining to obtain recommended herbal compositions, TTM experts can easily make use of the information to formulate personalized Thai herbal medicines. This project can therefore be used as a prototype to support the promotion of Thai herbal and traditional medicine (a part of the mainstream medical system) and so support sustainable healthcare policy in Thailand. The system can also be further extended to cover other TTM texts and the treatments of a wider range of conditions.

Author's Contributions
Charinee Prompukdee: Data collection and analysis, system design and development and writing and revising the article. Jaratsri Rungrattanaubol: Participation in discussions on the proposed framework, the organization of ideas and writing and revising the article.
Chayanin Pratoomsoot: TTM expert, results interpretations, contribution to system design, including user interface, mapping of the ICD-10-TM codes and writing and revising the article.

Ethics
No ethical issues were raised by this research.