diff --git a/frontend/index.html b/frontend/index.html
index 0bc3edb..685c31e 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -35,6 +35,7 @@
NELA API
v-slot="{ field }"
@keyup="result = null;"
@keypress="isNumber($event, field.type)"
+ @change="result = null"
:type="(field.type === 'integer' || field.type === 'number') ? 'number' : field.type"
:rules="validationRule(field)"
:name="camelCase(field.name)"
@@ -55,6 +56,7 @@ NELA API
id="button-addon"
data-bs-target="#setIndications"
data-bs-toggle="modal"
+ @click="result = null"
>
Set
@@ -75,15 +77,29 @@ Set indications
-
TODO
+
+
{{ key }}
+
+
+
+
+
-
+
Result
@@ -132,6 +148,45 @@ Response received:
schema: {},
result: null,
request: {},
+ chosenIndications: {
+ Bleeding: [],
+ Other: [],
+ Obstruction: [],
+ Sepsis: [],
+ 'Iatrogenic injury': [],
+ Ischaemia: [],
+ },
+ indications: {
+ Bleeding: ['Haemorrhage'],
+ Other: ['Abdominal wound dehiscence', 'Abdominal compartment syndrome', 'Planned relook', 'Other'],
+ Obstruction: [
+ 'Tender Small bowel obstruction',
+ 'Non-Tender Small bowel obstruction',
+ 'Tender Large bowel obstruction',
+ 'Non-Tender Large bowel obstruction',
+ 'Gastric outlet obstruction',
+ 'Incarcerated/strangulated hernia',
+ 'Hiatus Hernia/para-oesophageal hernia',
+ 'Volvulus',
+ 'Internal hernia',
+ 'Obstructing incisional hernia',
+ 'Intussusception',
+ 'Pseudo-obstruction',
+ 'Foreign body',
+ ],
+ Sepsis: [
+ 'Phlegmon',
+ 'Pneumoperitoneum',
+ 'Sepsis',
+ 'Iatrogenic injury',
+ 'Anastomotic leak',
+ 'Peritonitis',
+ 'GI Perforation',
+ 'Abdominal abscess',
+ 'Intestinal fistula',
+ ],
+ Ischaemia: ['Necrosis', 'Ischaemia/infarction', 'Colitis', 'Acidosis'],
+ },
};
},
components: {
@@ -140,6 +195,27 @@ Response received:
ErrorMessage: VeeValidate.ErrorMessage,
},
methods: {
+ changeInd() {
+ const weight = {
+ Bleeding: 1,
+ Other: 2,
+ Obstruction: 2,
+ Sepsis: 3,
+ Ischaemia: 4,
+ };
+ // get highest weight
+ let max = 0;
+ let maxKey = '';
+ for (const key in this.chosenIndications) {
+ for (const option in this.chosenIndications[key]) {
+ if (this.chosenIndications[key][option]) {
+ max = weight[key];
+ maxKey = key;
+ }
+ }
+ }
+ this.schema.indicationForSurgery.value = maxKey.toLowerCase();
+ },
reset() {
this.result = null;
},
@@ -222,7 +298,7 @@ Response received:
this.schema = JSON.parse(data).properties;
})
.catch((error) => {
- console.error('Error fetching test data:', error);
+ console.error('Error fetching schema data:', error);
});
},
}).mount('#app');