# Instance-Based Learning Following Physician Reasoning for Assistance during Medical Consultation
## 5 Medical Consultation Flows
### Selecting an Already Defined Case Type
```
1:for i = 1 to length(STUDENT-LIST) do
2:\(\text{student}_{i}\leftarrow\text{STUDENT-LIST[i]}\)
3:\(\text{CKB}_{student_{i}}\leftarrow\emptyset\)
4:for j = 1 to 3 do
5:\(k\text{-index}\leftarrow\text{mod}(3(i-1)+\text{j},\text{length(CASE-SOURCE)})\)
6:\(\text{CT}_{i_{j}}\leftarrow\text{student}_{i}\) records case number \(k\text{-index}\) of CASE-SOURCE
7:\(\text{CKB}_{student_{i}}\leftarrow\text{CKB}_{student_{i}}\bigcup\text{CT}_{i _{j}}\)
8:endfor
9:\(\text{CT}_{i_{1}}\leftarrow\text{first variant of case type included in CKB}_{student_{i}}\)
10:\(\text{CKB}_{student_{i}}\gets\text{CKB}_{student_{i}}\bigcup\text{CT}_{i _{1}}\)
11:\(\text{CT}_{i_{2}}\leftarrow\text{second variant of case type included in CKB}_{student_{i}}\)
12:\(\text{CKB}_{student_{i}}\leftarrow\text{CKB}_{student_{i}}\bigcup\text{CT}_{i _{2}}\)
13:endfor
14:\(\text{CKB}_{all}\leftarrow\emptyset\)
15:for i = 1 to length(STUDENT-LIST) do
16:\(\text{student}_{i}\leftarrow\text{STUDENT-LIST[i]}\)
17:for j = 1 to 5 do
18:\(\text{CT}_{i_{i}exported}\leftarrow\text{export(j,CKB}_{student_{i}})\)
19:\(\text{import(CT}_{i_{i}exported},\text{CKB}_{all})\)
20:endfor
21:endfor
22:return\(\text{CKB}_{all}\)
```

**Algorithm 11** Building case types

Algorithm 11 starts by initializing all CKBs of the students (STUDENT-LIST) selected for recording new CTs (lines 1-3). Each student is expected to treat three fictitious patients suffering from one of the specific conditions of the clinical source (lines 5-6). Moreover, two variants contributed by each student are also registered (line 9 and line 11). Therefore, the CKB of each student is enriched with five new CTs (line 7, line 10, and line 12). The algorithm continues by initializing a single \(\text{CKB}_{all}\) that groups all information recorded by all students (line 14). Each registered CT is exported using the _export_ procedure, and the _import_ procedure is applied to consolidate the exported CT into the \(\text{CKB}_{all}\) (lines 15-21). Finally, the \(\text{CKB}_{all}\) which contains all the 250 registered CTs (five contributed by each of the 50 students) is returned (line 22). ### Parameter Settings of Similarity Weight

For the purposes of the experimental evaluation, the set of clinical section types was defined following the Uruguayan health model. The set of clinical section types was defined as _ALL-SECTION-TYPES = [Diagnosis, Consultation reason, Current illness, Physical examination, Medication, Studies, Procedures, Referral, Message agents, Advisors, Excuse notes, Observations]_. The similarity weight of a clinical section type is given by its medical relevance. A simple medical relevance criteria was applied to give greater weight to the most important section types. Four levels of importance were defined in order to consider qualitative ranges of medical relevance. The level scale used to define medical relevance was: _very important_, _fairly important_, _important_, and _slightly important_. Table 2 presents the weight values of the clinical section types used in the experimental evaluation, grouped by level of medical relevance. Table 2 shows that the weight of the diagnosis section was defined with a high value of \(W_{Diagnosis}=0.16\). On contrary, the excuse notes section was defined with a lower weight of \(W_{Excuses}=0.04\). All weights presented in Table 2 influence the calculation of the similarity metric of the learning method. Equation (16) shows the consistency of presented weights used for the similarity metric. \[ \begin{split}\sum_{sec_{1}}^{sec_{s}}W_{sec}=\sum_{\text{very important}}W_{sec_{s}}+\sum_{\text{fairly important}}W_{sec_{f}}+\sum_{Important}W_{sec_{i}}+\sum_{\text{slightly important}}W_{sec_{s}}\\ \sum_{sec_{1}}^{sec_{s}}W_{sec}=0.16+3\cdot 0.12+4\cdot 0.08+4 \cdot 0.04=1\end{split}  \tag{16}\]

### Performance Evaluation

An experimental evaluation was conducted in order to analyze the lazy nature of the proposed learning method.