Files
FE_CPONE/test/vuex/cpone-resultentry-so-others-v6-ui-all/components/SixMinuteWalkTest.vue
2026-04-27 10:13:31 +07:00

343 lines
18 KiB
Vue

<template>
<div>
<v-layout row wrap>
<v-flex xs12>
<v-layout pt-1 pb-2 row>
<v-flex pt-1 pb-1 pl-2 pr-2 xs4>
<v-text-field label="BERAT BADAN (KG)" v-model="localData.bb" :disabled="disabled"
@change="countBMI" hide-details></v-text-field>
</v-flex>
<v-flex pt-1 pb-1 pl-2 pr-2 xs4>
<v-text-field label="TINGGI BADAN (CM)" v-model="localData.tb" :disabled="disabled"
@change="countBMI" hide-details></v-text-field>
</v-flex>
<v-flex pt-1 pb-1 pl-2 pr-2 xs4>
<v-text-field label="BMI (KG/M^2)" v-model="localData.bmi" :disabled="disabled"
hide-details></v-text-field>
</v-flex>
</v-layout>
<v-layout pt-1 pb-2 row>
<v-flex pt-1 pb-1 pl-2 pr-2 xs6>
<v-text-field label="JARAK 1 PUTARAN (METER)" v-model="localData.distance" :disabled="disabled"
@change="calculateVO2Max" hide-details></v-text-field>
</v-flex>
<v-flex pt-1 pb-1 pl-2 pr-2 xs6>
<v-text-field label="JUMLAH PUTARAN (PUTARAN)" v-model="localData.rounds" :disabled="disabled"
@change="calculateVO2Max" hide-details></v-text-field>
</v-flex>
</v-layout>
<v-divider class="mt-2 mb-2"></v-divider>
<v-layout pt-1 pb-2 row>
<v-flex pt-1 pb-1 pl-2 pr-1 xs6>
<v-card class="pa-2">
<v-layout mb-2 row>
<v-flex class="text-xs-center" xs12>
<h4 class="subheading">PRE TEST</h4>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="TENSI" v-model="localData.pretest.tensi"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="SPO2" v-model="localData.pretest.spo2"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="NADI" v-model="localData.pretest.nadi"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="DYSPNEA" v-model="localData.pretest.dyspnea"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="FATIGUE" v-model="localData.pretest.fatigue"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
</v-card>
</v-flex>
<v-flex pt-1 pb-1 pl-1 pr-2 xs6>
<v-card class="pa-2">
<v-layout mb-2 row>
<v-flex class="text-xs-center" xs12>
<h4 class="subheading">POST TEST</h4>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="TENSI" v-model="localData.posttest.tensi"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="SPO2" v-model="localData.posttest.spo2"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="NADI" v-model="localData.posttest.nadi"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="DYSPNEA" v-model="localData.posttest.dyspnea"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
<v-layout pl-3 pr-3 row>
<v-flex xs12>
<v-text-field ma-1 label="FATIGUE" v-model="localData.posttest.fatigue"
:disabled="disabled"></v-text-field>
</v-flex>
</v-layout>
</v-card>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-layout class="ml-2 mr-2 mb-2" row>
<v-flex xs12>
<v-data-table :headers="headers" :items="localData.details_6mwt" class="elevation-1" hide-actions>
<template v-slot:items="props">
<td class="text-xs-right">{{ props.item.waktu }}</td>
<td class="text-xs-right">
<v-text-field ma-1 :disabled="disabled" v-model="props.item.spo2"></v-text-field>
</td>
<td class="text-xs-right">
<v-text-field ma-1 v-model="props.item.nadi" :disabled="disabled"></v-text-field>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-layout class="pa-2" row>
<v-flex text-xs-center xs12>
<v-card>
<p class="headline pt-3 pb-1 font-weight-light">
{{ textVO2Max }}
</p>
</v-card>
</v-flex>
</v-layout>
<v-layout class="pa-2" row>
<v-flex text-xs-center xs12>
<v-card color="blue-grey darken-2" class="white--text">
<p class="display-2 pt-3 pb-3 font-weight-bold">
{{ categoryVO2Max.toUpperCase() }}
</p>
</v-card>
</v-flex>
</v-layout>
</div>
</template>
<script>
export default {
name: 'SixMinuteWalkTest',
props: {
value: {
type: Object,
required: true
},
patient: {
type: Object,
required: true
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
localData: this.value,
headers: [
{ text: "WAKTU", sortable: false, width: "30%" },
{ text: "SPO2", sortable: false },
{ text: "NADI", sortable: false }
],
vo2max: 0
}
},
computed: {
patientAge() {
if (!this.patient || !this.patient.age) return 0;
const age = this.patient.age;
const parts = age.split(" ");
return Math.floor((parseInt(parts[0]) + parseFloat(parts[2] / 12)).toFixed(1));
},
textVO2Max() {
if (this.vo2max <= 0) return "-";
return `VO2 MAX = (0.06 x ${this.localData.distance} x ${this.localData.rounds}) - (0.104 x ${this.patientAge}) + (0.052 x ${this.localData.bb}) + 2.9 = ${this.vo2max}`;
},
categoryVO2Max() {
if (this.vo2max <= 0) return "-";
let category = "-";
const age = this.patientAge;
const gender = this.patient.sexcode;
if (gender === "L") { // Male
if (age >= 18 && age <= 25) {
if (this.vo2max > 60) category = "Excellent";
else if (this.vo2max >= 52 && this.vo2max < 61) category = "Good";
else if (this.vo2max >= 47 && this.vo2max < 52) category = "Di atas rata-rata";
else if (this.vo2max >= 42 && this.vo2max < 47) category = "Rata-rata";
else if (this.vo2max >= 37 && this.vo2max < 42) category = "Di bawah rata-rata";
else if (this.vo2max >= 30 && this.vo2max < 37) category = "Di bawah batas nilai normal";
else if (this.vo2max < 30) category = "Di bawah batas nilai normal";
} else if (age >= 26 && age <= 35) {
if (this.vo2max > 56) category = "Excellent";
else if (this.vo2max >= 49 && this.vo2max < 57) category = "Good";
else if (this.vo2max >= 43 && this.vo2max < 49) category = "Di atas rata-rata";
else if (this.vo2max >= 40 && this.vo2max < 43) category = "Rata-rata";
else if (this.vo2max >= 35 && this.vo2max < 40) category = "Di bawah rata-rata";
else if (this.vo2max >= 30 && this.vo2max < 35) category = "Di bawah batas nilai normal";
else if (this.vo2max < 30) category = "Di bawah batas nilai normal";
} else if (age >= 36 && age <= 45) {
if (this.vo2max > 51) category = "Excellent";
else if (this.vo2max >= 43 && this.vo2max < 52) category = "Good";
else if (this.vo2max >= 39 && this.vo2max < 43) category = "Di atas rata-rata";
else if (this.vo2max >= 35 && this.vo2max < 39) category = "Rata-rata";
else if (this.vo2max >= 31 && this.vo2max < 35) category = "Di bawah rata-rata";
else if (this.vo2max >= 26 && this.vo2max < 31) category = "Di bawah batas nilai normal";
else if (this.vo2max < 26) category = "Di bawah batas nilai normal";
} else if (age >= 46 && age <= 55) {
if (this.vo2max > 45) category = "Excellent";
else if (this.vo2max >= 39 && this.vo2max < 46) category = "Good";
else if (this.vo2max >= 36 && this.vo2max < 39) category = "Di atas rata-rata";
else if (this.vo2max >= 32 && this.vo2max < 36) category = "Rata-rata";
else if (this.vo2max >= 29 && this.vo2max < 32) category = "Di bawah rata-rata";
else if (this.vo2max >= 25 && this.vo2max < 29) category = "Di bawah batas nilai normal";
else if (this.vo2max < 25) category = "Di bawah batas nilai normal";
} else if (age >= 56 && age <= 65) {
if (this.vo2max > 41) category = "Excellent";
else if (this.vo2max >= 36 && this.vo2max < 42) category = "Good";
else if (this.vo2max >= 32 && this.vo2max < 36) category = "Di atas rata-rata";
else if (this.vo2max >= 30 && this.vo2max < 32) category = "Rata-rata";
else if (this.vo2max >= 26 && this.vo2max < 30) category = "Di bawah rata-rata";
else if (this.vo2max >= 22 && this.vo2max < 26) category = "Di bawah batas nilai normal";
else if (this.vo2max < 22) category = "Di bawah batas nilai normal";
} else if (age > 65) {
if (this.vo2max > 37) category = "Excellent";
else if (this.vo2max >= 33 && this.vo2max < 38) category = "Good";
else if (this.vo2max >= 29 && this.vo2max < 33) category = "Di atas rata-rata";
else if (this.vo2max >= 26 && this.vo2max < 29) category = "Rata-rata";
else if (this.vo2max >= 22 && this.vo2max < 26) category = "Di bawah rata-rata";
else if (this.vo2max >= 20 && this.vo2max < 22) category = "Di bawah batas nilai normal";
else if (this.vo2max < 20) category = "Di bawah batas nilai normal";
}
} else if (gender === "P") { // Female
if (age >= 18 && age <= 25) {
if (this.vo2max > 56) category = "Excellent";
else if (this.vo2max >= 47 && this.vo2max < 57) category = "Good";
else if (this.vo2max >= 42 && this.vo2max < 47) category = "Di atas rata-rata";
else if (this.vo2max >= 38 && this.vo2max < 42) category = "Rata-rata";
else if (this.vo2max >= 33 && this.vo2max < 38) category = "Di bawah rata-rata";
else if (this.vo2max >= 28 && this.vo2max < 33) category = "Di bawah batas nilai normal";
else if (this.vo2max < 28) category = "Di bawah batas nilai normal";
} else if (age >= 26 && age <= 35) {
if (this.vo2max > 52) category = "Excellent";
else if (this.vo2max >= 45 && this.vo2max < 53) category = "Good";
else if (this.vo2max >= 39 && this.vo2max < 45) category = "Di atas rata-rata";
else if (this.vo2max >= 35 && this.vo2max < 39) category = "Rata-rata";
else if (this.vo2max >= 31 && this.vo2max < 35) category = "Di bawah rata-rata";
else if (this.vo2max >= 26 && this.vo2max < 31) category = "Di bawah batas nilai normal";
else if (this.vo2max < 26) category = "Di bawah batas nilai normal";
} else if (age >= 36 && age <= 45) {
if (this.vo2max > 45) category = "Excellent";
else if (this.vo2max >= 38 && this.vo2max < 46) category = "Good";
else if (this.vo2max >= 34 && this.vo2max < 38) category = "Di atas rata-rata";
else if (this.vo2max >= 31 && this.vo2max < 34) category = "Rata-rata";
else if (this.vo2max >= 27 && this.vo2max < 31) category = "Di bawah rata-rata";
else if (this.vo2max >= 22 && this.vo2max < 27) category = "Di bawah batas nilai normal";
else if (this.vo2max < 22) category = "Di bawah batas nilai normal";
} else if (age >= 46 && age <= 55) {
if (this.vo2max > 40) category = "Excellent";
else if (this.vo2max >= 34 && this.vo2max < 41) category = "Good";
else if (this.vo2max >= 31 && this.vo2max < 34) category = "Di atas rata-rata";
else if (this.vo2max >= 28 && this.vo2max < 31) category = "Rata-rata";
else if (this.vo2max >= 25 && this.vo2max < 28) category = "Di bawah rata-rata";
else if (this.vo2max >= 20 && this.vo2max < 25) category = "Di bawah batas nilai normal";
else if (this.vo2max < 20) category = "Di bawah batas nilai normal";
} else if (age >= 56 && age <= 65) {
if (this.vo2max > 37) category = "Excellent";
else if (this.vo2max >= 32 && this.vo2max < 38) category = "Good";
else if (this.vo2max >= 28 && this.vo2max < 32) category = "Di atas rata-rata";
else if (this.vo2max >= 25 && this.vo2max < 28) category = "Rata-rata";
else if (this.vo2max >= 22 && this.vo2max < 25) category = "Di bawah rata-rata";
else if (this.vo2max >= 18 && this.vo2max < 22) category = "Di bawah batas nilai normal";
else if (this.vo2max < 18) category = "Di bawah batas nilai normal";
} else if (age > 65) {
if (this.vo2max > 32) category = "Excellent";
else if (this.vo2max >= 28 && this.vo2max < 33) category = "Good";
else if (this.vo2max >= 25 && this.vo2max < 28) category = "Di atas rata-rata";
else if (this.vo2max >= 22 && this.vo2max < 25) category = "Rata-rata";
else if (this.vo2max >= 19 && this.vo2max < 22) category = "Di bawah rata-rata";
else if (this.vo2max >= 17 && this.vo2max < 19) category = "Di bawah batas nilai normal";
else if (this.vo2max < 17) category = "Di bawah batas nilai normal";
}
}
return category;
}
},
watch: {
value: {
handler(newVal) {
this.localData = newVal;
this.calculateVO2Max();
},
deep: true
},
localData: {
handler(newVal) {
this.$emit('input', newVal);
},
deep: true
}
},
methods: {
countBMI() {
if (this.localData.tb && this.localData.bb) {
const heightInMeters = this.localData.tb / 100;
this.localData.bmi = (this.localData.bb / (heightInMeters * heightInMeters)).toFixed(2);
}
},
calculateVO2Max() {
if (parseInt(this.localData.distance) > 0 &&
parseInt(this.localData.rounds) > 0 &&
parseInt(this.localData.bb) > 0) {
this.vo2max = (
0.06 * (this.localData.distance * this.localData.rounds) -
0.104 * this.patientAge +
0.052 * this.localData.bb +
2.9
).toFixed(2);
} else {
this.vo2max = 0;
}
}
},
created() {
this.calculateVO2Max();
}
}
</script>