github.com/lauslim12/expert-systems@v0.0.0-20221115131159-018513aad29c/pkg/inference/knowledge.go (about)

     1  package inference
     2  
     3  // Simple internationalization, get TB description.
     4  func getTBDescription(locale string) string {
     5  	if locale == "id" {
     6  		return "Tuberculosis (TB) adalah infeksi bakteri yang menyebar dengan cara menghirup droplet ringan dari bekas batuk atau bersin dari seseorang yang sudah terinfeksi. Biasanya, TB menyerang paru-paru, tetapi TB bisa menyerang bagian tubuh lain, seperti perut, kelenjar, tulang, dan sistem saraf pusat. TB adalah kondisi yang berpotensi menjadi serius, tetapi dapat diobati apabila menggunakan antibiotik yang benar. TB menyebar melalui udara. Ketika orang yang menderita TB paru-paru batuk, meludah, atau bersin, mereka mengeluarkan bakteri TB ke udara. Seseorang hanya perlu menghirup sedikit dari bakteri ini untuk menjadi terinfeksi. Sekitar satu per empat populasi dunia menderita TB, yang menandakan bahwa ada orang sudah terinfeksi dengan bakteri TB tetapi belum sakit dan tidak bisa menularkannya."
     7  	}
     8  
     9  	return "Tuberculosis (TB) is a bacterial infection spread through inhaling tiny droplets from the coughs or sneezes of an infected person. It mainly affects the lungs, but it can affect any part of the body, including the tummy (abdomen), glands, bones and nervous system. TB is a potentially serious condition, but it can be cured if it is treated with the right antibiotics. TB is spread from person to person through the air. When people with lung TB cough, sneeze or spit, they propel the TB germs into the air. A person needs to inhale only a few of these germs to become infected. About one-quarter of the world's population has a TB infection, which means people have been infected by TB bacteria but are not (yet) ill with the disease and cannot transmit it."
    10  }
    11  
    12  // Simple internationalization, get TB treatment.
    13  func getTBTreatment(locale string) string {
    14  	if locale == "id" {
    15  		return "TB adalah penyakit yang bisa disembuhkan. Biasanya, diperlukan antibiotik yang berdurasi enam bulan. Biasanya, ada empat buah antibiotik yang diberikan dengan informasi dan dukungan pada pasien oleh petugas kesehatan. Tanpa antibiotik, pengobatan TB menjadi lebih sulit. Sejak 2000, estimasi 66 juta jiwa sudah terselamatkan dari TB karena melakukan diagnosis dan perawatan."
    16  	}
    17  
    18  	return "TB is a treatable and curable disease. Active, drug-susceptible TB disease is treated with a standard 6-month course of 4 antimicrobial drugs that are provided with information and support to the patient by a health worker or trained volunteer. Without such support, treatment adherence is more difficult. Since 2000, an estimated 66 million lives were saved through TB diagnosis and treatment."
    19  }
    20  
    21  // Simple internationalization, get TB prevention.
    22  func getTBPrevention(locale string) string {
    23  	if locale == "id" {
    24  		return "Anda dapat melakukan pencegahan dengan cara menyiapkan ventilasi yang baik, cahaya natural, dan menjaga agar kondisi lingkungan Anda tetap bersih. Direkomendasikan untuk mendapatkan vaksin untuk TB sebagai salah satu pencegahan yang paling efektif. Vaksin membuat sistem imun Anda lebih kuat, yang dapat membuat Anda menjadi lebih terjaga dari terserang TB (ada yang hingga 15 tahun). Karena beberapa faktor eksternal, ada beberapa orang yang memiliki risiko yang lebih besar untuk terkena dan sakit karena TB."
    25  	}
    26  
    27  	return "You can perform several precautions by providing good ventilation, natural light, and keeping everything clean. It is recommended to take vaccinations of TB as well. Vaccinations help you to keep your immune system in prime condition, thus allowing you to resist the virus for a longer time (some up to 15 years). Depending on some external factors, some people are more at risk for being exposed into developing the TB disease."
    28  }
    29  
    30  // All diseases that are in this expert system.
    31  // Data is processed from https://www.kaggle.com/victorcaelina/tuberculosis-symptoms.
    32  func getDiseases(locale string) []Disease {
    33  	diseases := []Disease{
    34  		{
    35  			ID:          "D01",
    36  			Name:        "Tuberculosis",
    37  			Description: getTBDescription(locale),
    38  			Treatment:   getTBTreatment(locale),
    39  			Prevention:  getTBPrevention(locale),
    40  			Source: []SourceAndLink{
    41  				{
    42  					Name: "NHS",
    43  					Link: "https://www.nhs.uk/conditions/tuberculosis-tb/",
    44  				},
    45  				{
    46  					Name: "WHO",
    47  					Link: "https://www.who.int/news-room/fact-sheets/detail/tuberculosis",
    48  				},
    49  				{
    50  					Name: "TBAlert",
    51  					Link: "https://www.tbalert.org/about-tb/what-is-tb/prevention/",
    52  				},
    53  				{
    54  					Name: "CDC Government",
    55  					Link: "https://www.cdc.gov/tb/topic/basics/tbprevention.htm",
    56  				},
    57  			},
    58  			Symptoms: []Symptom{
    59  				{
    60  					ID:     "S1",
    61  					Name:   "Fever for two weeks or more",
    62  					Weight: 0.513,
    63  				},
    64  				{
    65  					ID:     "S2",
    66  					Name:   "Coughing blood",
    67  					Weight: 0.475,
    68  				},
    69  				{
    70  					ID:     "S3",
    71  					Name:   "Sputum mixed with blood",
    72  					Weight: 0.519,
    73  				},
    74  				{
    75  					ID:     "S4",
    76  					Name:   "Night sweats",
    77  					Weight: 0.514,
    78  				},
    79  				{
    80  					ID:     "S5",
    81  					Name:   "Chest pain",
    82  					Weight: 0.494,
    83  				},
    84  				{
    85  					ID:     "S6",
    86  					Name:   "Pleuritic pain",
    87  					Weight: 0.511,
    88  				},
    89  				{
    90  					ID:     "S7",
    91  					Name:   "Shortness of breath",
    92  					Weight: 0.487,
    93  				},
    94  				{
    95  					ID:     "S8",
    96  					Name:   "Weight loss",
    97  					Weight: 0.521,
    98  				},
    99  				{
   100  					ID:     "S9",
   101  					Name:   "Body feels tired",
   102  					Weight: 0.496,
   103  				},
   104  				{
   105  					ID:     "S10",
   106  					Name:   "Lumps that appear around the armpits and neck",
   107  					Weight: 0.484,
   108  				},
   109  				{
   110  					ID:     "S11",
   111  					Name:   "Cough and phlegm continuously for two weeks to four weeks",
   112  					Weight: 0.493,
   113  				},
   114  				{
   115  					ID:     "S12",
   116  					Name:   "Swollen lymph nodes",
   117  					Weight: 0.478,
   118  				},
   119  				{
   120  					ID:     "S13",
   121  					Name:   "Loss of apetite",
   122  					Weight: 0.488,
   123  				},
   124  			},
   125  		},
   126  	}
   127  
   128  	return diseases
   129  }