# Instance-Based Learning Following Physician Reasoning for Assistance during Medical Consultation
## 5 Medical Consultation Flows
### Selecting an Already Defined Case Type
```
1:CT\({}_{current}\leftarrow\) new CT(registerEditor.content)
2:CT\({}_{current}\leftarrow\) removeNonMeaningfulUnits(CT\({}_{current}\))
3:CT\({}_{current}\leftarrow\) removeDuplicateUnits(CT\({}_{current}\))
4:topBest \(\leftarrow\) Initialize array with \(t\) empty values
5:forCT\({}_{i}\) in CKB\({}^{M}\)do
6:similarityMetric \(\leftarrow\)similarity(CT\({}_{current}\),CT\({}_{i}\))
7:ifsimilarityMetric is better that worstSimilarity(topBest) then
8:topBest \(\leftarrow\) replaceWorst(topBest,CT\({}_{i}\))
9:endif
10:endfor
11:topBest \(\leftarrow\) removeEmptyValues(topBest)
12:returntopBest
```
**Algorithm 9** Instance-based learning method

#### 6.1.3 Using Suggested Case Types

A physician can select a suggested case type as a basis of writing a medical consultation. After a case type is applied, the input area of the register editor is updated by using the information defined in the selected case type. By using suggested case types, previously registered phases are re-used and the time spent writing the details of a consultation is reduced. Suggested case types can also remind physicians to verify important clinical aspects of their patients. Moreover, taking advantage of previously written sentences is useful when physicians need to address recurrent aspects of chronic patients. #### 6.2 Similarity Metric

A similarity metric is introduced in order to compare two case types of a clinical knowledge base. The proposed metric takes into account the similarity between conceptual components of different case types. Consequently, the similarity value between two case types is determined by the weighted similarities of their conceptual components. #### 6.2.1 Similarity Metric Definition

[PERSON] [17] introduced the concept of _diagnostic relevance_, which applies fuzzy logic to evaluate the relevance of causal events associated with a clinical diagnosis. The proposed method is based on a similar idea, where the concept of _medical relevance_ is considered to evaluate the relevance of conceptual components associated with a clinical case type. Let \(comp_{i,sec}\) be a conceptual component of case type \(CT_{i}\) defined with \(sec\) section type, where \(sec\) belongs to ALL-SECTION-TYPES. The set ALL-SECTION-TYPES is introduced in Section 4 as a set that defines all possible clinical sections of the patient medical records. The similarity between two case types is denoted as _similarity_, and is defined by Equation (10). \[similarity(CT_{1},CT_{2})=\sum_{sec}w_{sec}\times similarityCC_{sec}(comp_{1,sec}, comp_{2,sec}) \tag{10}\]

In Equation (10), each \(w_{sec}\) defines the weight of a component with \(sec\) section type. Consequently, the conceptual components of case types influence the _similarity_ metric according to their \(sec\) section type. The similarity weight of a clinical section type is determined by its medical relevance. The medical relevance is used to define the weight of each section type belonging to ALL-SECTION-TYPES = {sec\({}_{1}\),..., sec\({}_{n}\)}, as \(W_{sec}=medRelevance(sec)/\sum_{sec_{1}}^{sec_{1}}medRelevance(sec_{1})\). The medical relevance of clinical section types must be defined based on background knowledge of the health area. Accurate weights of conceptual components provide a mechanism for reducing the impact of irrelevant features in the similarity metric [16]. As an example, health background knowledge suggests that the section for excuse notes should weigh less than the diagnosis section. The following subsection presents the _similarityCC_ function, introduced in Equation (10) for comparing two conceptual components of different case types. #### 6.2.2 Similarity between Components

To compare conceptual components, the similarity metric takes into account the units of thought included in all elements of conceptual components. The similarity between conceptual components is defined by Equation (11), which is aimed at comparing components sharing the same section type _sec_. \[similarityCC_{sec}(cc_{1},cc_{2})=