Добавил отображение процентов заполнения мед осмотра
This commit is contained in:
@@ -107,6 +107,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
modelValue: {
|
||||||
|
immediate: true,
|
||||||
|
handler(value) {
|
||||||
|
this.protocolData[this.data.state] = value;
|
||||||
|
},
|
||||||
|
},
|
||||||
state: {
|
state: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(value) {
|
handler(value) {
|
||||||
|
|||||||
@@ -43,7 +43,9 @@ import MainFactorsForm from "@/pages/newMedicalCard/components/InitialInspection
|
|||||||
import ToothFormulaForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaForm.vue";
|
import ToothFormulaForm from "@/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaForm.vue";
|
||||||
import { protocolForms } from "@/pages/newMedicalCard/utils/medicalConfig.js";
|
import { protocolForms } from "@/pages/newMedicalCard/utils/medicalConfig.js";
|
||||||
import ClinicalForm from "./Forms/ClinicalForm.vue";
|
import ClinicalForm from "./Forms/ClinicalForm.vue";
|
||||||
import { mapGetters, mapState } from "vuex";
|
import { mapState } from "vuex";
|
||||||
|
import { removeEmptyFields } from "@/shared/utils/changesObjects";
|
||||||
|
import toothFormula from "@/store/modules/toothFormula";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MedicalProtocolsInspection",
|
name: "MedicalProtocolsInspection",
|
||||||
@@ -60,6 +62,7 @@ export default {
|
|||||||
props: { inspection: Boolean, fillInspection: Boolean },
|
props: { inspection: Boolean, fillInspection: Boolean },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
initToothFormula: toothFormula.stateInit,
|
||||||
percent: 0,
|
percent: 0,
|
||||||
protocolForms: protocolForms,
|
protocolForms: protocolForms,
|
||||||
list: [
|
list: [
|
||||||
@@ -107,34 +110,64 @@ export default {
|
|||||||
...mapState({
|
...mapState({
|
||||||
protocolData: (state) => state.medical.protocolData,
|
protocolData: (state) => state.medical.protocolData,
|
||||||
}),
|
}),
|
||||||
...mapGetters({
|
|
||||||
protocolDataGet: "getInitProtocol",
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
interestСalculation() {
|
setPercent(data, sum) {
|
||||||
const getTypeOf = (obj) => {
|
switch (data) {
|
||||||
return {}.toString.call(obj).slice(8, -1);
|
case "KPUIndex":
|
||||||
};
|
case "bite":
|
||||||
let sum = 0;
|
case "hygieneIndex":
|
||||||
for (let a in this.protocolData) {
|
if (this.protocolData[data]) sum += 1;
|
||||||
if (
|
break;
|
||||||
Array.isArray(this.protocolData[a]) &&
|
case "anamnesis":
|
||||||
this.protocolData[a].length > 0
|
case "cavity":
|
||||||
)
|
case "clinical":
|
||||||
sum += 1;
|
case "complaints":
|
||||||
|
case "illnesses":
|
||||||
if (this.protocolData[a] && typeof this.protocolData[a] === "string")
|
case "inspection":
|
||||||
sum += 1;
|
case "medications":
|
||||||
|
case "survey":
|
||||||
if (
|
if (this.protocolData[data].length) sum += 1;
|
||||||
getTypeOf(this.protocolData[a]) === "Object" &&
|
break;
|
||||||
Object.keys(this.protocolData[a]).length
|
case "data": {
|
||||||
)
|
if (this.protocolData[data].complaints.length) sum += 0.5;
|
||||||
sum += 1;
|
this.protocolData[data].files.forEach((e) => {
|
||||||
|
if (e.data.length) sum += 0.25;
|
||||||
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
sum = Math.ceil(17 / sum);
|
case "disease":
|
||||||
this.percent = sum > 1 ? sum * 10 : sum * 100;
|
case "preliminary":
|
||||||
|
if (this.protocolData[data].text || this.protocolData[data].change)
|
||||||
|
sum += 1;
|
||||||
|
break;
|
||||||
|
case "thermometry": {
|
||||||
|
let obj = removeEmptyFields(this.protocolData[data]);
|
||||||
|
for (let el in obj) {
|
||||||
|
if (obj[el].result) sum += 0.25;
|
||||||
|
if (obj[el].value) sum += 0.25;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "tonometry": {
|
||||||
|
let obj = removeEmptyFields(this.protocolData[data]);
|
||||||
|
for (let el in obj) if (obj[el].value) sum += 0.5;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "toothFormula":
|
||||||
|
if (
|
||||||
|
JSON.stringify(this.initToothFormula) !==
|
||||||
|
JSON.stringify(this.protocolData[data])
|
||||||
|
)
|
||||||
|
sum += 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
},
|
||||||
|
interestСalculation() {
|
||||||
|
let sum = 0;
|
||||||
|
for (let data in this.protocolData) sum = this.setPercent(data, sum);
|
||||||
|
this.percent = Math.round((100 * Math.round(sum)) / 17);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -753,7 +753,6 @@ export const protocolForms = [
|
|||||||
"Киста в глазу",
|
"Киста в глазу",
|
||||||
"Красные пятна на языке",
|
"Красные пятна на языке",
|
||||||
"Фингал под глазом",
|
"Фингал под глазом",
|
||||||
"Гематома на щеке",
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ const getters = {
|
|||||||
},
|
},
|
||||||
toothFormula: {
|
toothFormula: {
|
||||||
lacticBite: toothFormula.state.lacticBite,
|
lacticBite: toothFormula.state.lacticBite,
|
||||||
formula: toothFormula.state.formula,
|
formula: JSON.parse(JSON.stringify(toothFormula.state.formula)),
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
complaints: [
|
complaints: [
|
||||||
@@ -427,7 +427,7 @@ const getters = {
|
|||||||
preliminary: { text: null },
|
preliminary: { text: null },
|
||||||
toothFormula: {
|
toothFormula: {
|
||||||
lacticBite: toothFormula.stateInit.lacticBite,
|
lacticBite: toothFormula.stateInit.lacticBite,
|
||||||
formula: toothFormula.stateInit.formula,
|
formula: JSON.parse(JSON.stringify(toothFormula.stateInit.formula)),
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
complaints: [],
|
complaints: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user