Изменил роутинг на страницу новой мед-карты
This commit is contained in:
13
src/pages/oldMedicalCard/TheMedicalCard.vue
Normal file
13
src/pages/oldMedicalCard/TheMedicalCard.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template lang="pug">
|
||||
medical-card-wrapper
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MedicalCardWrapper from "@/pages/oldMedicalCard/components/MedicalCardWrapper";
|
||||
export default {
|
||||
name: "TheMedicalCard",
|
||||
components: { MedicalCardWrapper },
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped></style>
|
||||
92
src/pages/oldMedicalCard/components/MedicalBaseData.vue
Normal file
92
src/pages/oldMedicalCard/components/MedicalBaseData.vue
Normal file
@@ -0,0 +1,92 @@
|
||||
<template lang="pug">
|
||||
.base.flex.flex-col.gap-y-6
|
||||
.flex.flex-col.gap-y-6
|
||||
span.font-bold Основное
|
||||
.flex.flex-col.gap-y-6
|
||||
base-input.w-full(
|
||||
placeholder="ФИО*",
|
||||
v-model="clientDetail.fullName",
|
||||
disabled,
|
||||
outlined
|
||||
)
|
||||
base-radio-buttons-group(
|
||||
:items="gendersList",
|
||||
radioButtonsLabel="Пол",
|
||||
v-model="clientDetail.gender",
|
||||
inline
|
||||
)
|
||||
.flex.gap-x-4
|
||||
.input
|
||||
base-input(
|
||||
type="date",
|
||||
label="Дата рождения",
|
||||
v-model="clientDetail.birth_date",
|
||||
outlined
|
||||
)
|
||||
.input
|
||||
base-input(
|
||||
placeholder="000–000–000 00",
|
||||
mask="###-###-### ##",
|
||||
label="СНИЛС",
|
||||
v-model="clientDetail.insurance_number",
|
||||
outlined
|
||||
)
|
||||
.flex.flex-col.gap-y-6
|
||||
base-input(
|
||||
label="Адрес регистрации",
|
||||
placeholder="Введите полный адрес",
|
||||
v-model="clientDetail.registration_address"
|
||||
outlined
|
||||
)
|
||||
base-input(
|
||||
label="Фактический адрес места жительства",
|
||||
placeholder="Введите полный адрес",
|
||||
v-model="clientDetail.temporary_address"
|
||||
outlined
|
||||
)
|
||||
.flex.gap-x-4
|
||||
.input
|
||||
base-input(
|
||||
label="Номер телефона",
|
||||
placeholder="+7 (915) 644–92–23",
|
||||
mask="+7 (###) ###-##-##",
|
||||
v-model="clientDetail.phone",
|
||||
outlined
|
||||
)
|
||||
.input
|
||||
base-input(
|
||||
label="Email",
|
||||
placeholder="user@yandex.ru"
|
||||
v-model="clientDetail.email",
|
||||
outlined
|
||||
)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseInput from "@/components/base/BaseInput";
|
||||
import BaseSelect from "@/components/base/BaseSelect";
|
||||
import BaseRadioButtonsGroup from "@/components/base/BaseRadioButtonsGroup.vue";
|
||||
import { medicalDetailConfig } from "@/pages/oldMedicalCard/utils/medicalConfig.js";
|
||||
|
||||
export default {
|
||||
name: "MedicalBaseData",
|
||||
components: {
|
||||
BaseInput,
|
||||
BaseSelect,
|
||||
BaseRadioButtonsGroup,
|
||||
},
|
||||
props: {
|
||||
clientDetail: Object,
|
||||
},
|
||||
computed: {
|
||||
gendersList() {
|
||||
return medicalDetailConfig.gendersList;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.input
|
||||
width: 277px
|
||||
</style>
|
||||
29
src/pages/oldMedicalCard/components/MedicalCardHeader.vue
Normal file
29
src/pages/oldMedicalCard/components/MedicalCardHeader.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template lang="pug">
|
||||
.flex.w-full
|
||||
.flex.w-full.text-lgx.font-bold.items-center.justify-center Медицинская карта №{{numberCard}}
|
||||
.flex.h-10.gap-x-2
|
||||
q-btn(
|
||||
outline,
|
||||
icon="icon-download",
|
||||
color="primary",
|
||||
size="12px",
|
||||
padding="8px 24px",
|
||||
)
|
||||
q-btn(
|
||||
color="primary",
|
||||
icon="add",
|
||||
label="Создать",
|
||||
style="width: 146px"
|
||||
padding="6px 24px",
|
||||
no-caps
|
||||
)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "MedicalCardHeader",
|
||||
props: {
|
||||
numberCard: String,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
437
src/pages/oldMedicalCard/components/MedicalCardWrapper.vue
Normal file
437
src/pages/oldMedicalCard/components/MedicalCardWrapper.vue
Normal file
@@ -0,0 +1,437 @@
|
||||
<template lang="pug">
|
||||
.wrapper.flex.w-full.relative.mx-2
|
||||
.wrapper-medical.relative.flex.gap-y-4.flex-col.h-full.w-full( class="pb-52px")
|
||||
.card-upper.flex.flex-col.gap-y-4.px-6.py-6
|
||||
medical-card-header(:number-card="numberCard")
|
||||
.card-basic-info.flex
|
||||
base-detail-info(
|
||||
:title="configData.identity_document.title"
|
||||
:height="configData.identity_document.height"
|
||||
:data="defineEmptyData(configData.identity_document.fields)"
|
||||
)
|
||||
base-detail-input(
|
||||
v-for="field in configData.identity_document.fields"
|
||||
:field="field"
|
||||
:data="medicalDataInit"
|
||||
:mask="field.mask"
|
||||
)
|
||||
.flex.flex-col.gap-30px
|
||||
base-detail-info(
|
||||
:title="configData.registration_address.title"
|
||||
:height="configData.registration_address.height"
|
||||
:data="defineEmptyData(configData.registration_address.fields)"
|
||||
)
|
||||
base-detail-input(
|
||||
v-for="field in configData.registration_address.fields"
|
||||
:field="field"
|
||||
:data="medicalDataInit"
|
||||
)
|
||||
base-detail-info(
|
||||
:title="configData.temporary_address.title"
|
||||
:height="configData.temporary_address.height"
|
||||
:data="defineEmptyData(configData.temporary_address.fields)"
|
||||
)
|
||||
base-detail-input(
|
||||
v-for="field in configData.temporary_address.fields"
|
||||
:field="field"
|
||||
:data="medicalDataInit"
|
||||
)
|
||||
.flex.flex-col.gap-2
|
||||
base-detail-info(
|
||||
:title="configData.snils.title"
|
||||
:height="configData.snils.height"
|
||||
:data="defineEmptyData(configData.snils.fields)"
|
||||
)
|
||||
base-detail-input(
|
||||
v-for="field in configData.snils.fields"
|
||||
:field="field"
|
||||
:data="medicalDataInit"
|
||||
:mask="field.mask"
|
||||
)
|
||||
base-detail-info(
|
||||
:title="configData.policy.title"
|
||||
:height="configData.policy.height"
|
||||
:data="defineEmptyData(configData.policy.fields)"
|
||||
)
|
||||
base-detail-input(
|
||||
v-for="field in configData.policy.fields"
|
||||
:field="field"
|
||||
:data="medicalDataInit"
|
||||
:mask="field.mask"
|
||||
)
|
||||
base-detail-info(
|
||||
:title="configData.policy_organization.title"
|
||||
:height="configData.policy_organization.height"
|
||||
:data="defineEmptyData(configData.policy_organization.fields)"
|
||||
)
|
||||
base-detail-input(
|
||||
v-for="field in configData.policy_organization.fields"
|
||||
:field="field"
|
||||
:data="medicalDataInit"
|
||||
)
|
||||
.flex.flex-col.gap-4
|
||||
base-detail-info(
|
||||
:title="configData.additional.title"
|
||||
:height="configData.additional.height"
|
||||
:data="defineEmptyData(configData.additional.fields)"
|
||||
)
|
||||
base-detail-input(
|
||||
v-for="field in configData.additional.fields"
|
||||
:field="field"
|
||||
:data="medicalDataInit"
|
||||
:mask="field.mask"
|
||||
)
|
||||
base-detail-info(
|
||||
:title="configData.agreement_form.title"
|
||||
:height="configData.agreement_form.height"
|
||||
:data="defineEmptyData(configData.agreement_form.fields)"
|
||||
direction-row
|
||||
)
|
||||
base-detail-input(
|
||||
v-for="field in configData.agreement_form.fields"
|
||||
:field="field"
|
||||
:data="medicalDataInit"
|
||||
)
|
||||
.flex.flex-col(class="px-92px gap-y-60px")
|
||||
.flex.flex-col(class="gap-y-2.5")
|
||||
.flex.flex-col.gap-y-2(v-for="(key, index) in Object.keys(dentalIndications)")
|
||||
span.font-bold.text-xsx {{`${index+1}. ${configData.dental_indications[key]}`}}
|
||||
medical-dental-formula(v-if="key === 'dental_formula'" :formula-data="dentalIndications[key]")
|
||||
base-input(v-model="dentalIndications[key]" outlined v-else)
|
||||
.flex.justify-center
|
||||
q-btn(
|
||||
@click="validateFormCard",
|
||||
color="primary",
|
||||
label="Сохранить",
|
||||
padding="8px 24px",
|
||||
no-caps
|
||||
)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MedicalCardHeader from "@/pages/oldMedicalCard/components/MedicalCardHeader.vue";
|
||||
import MedicalDentalFormula from "@/pages/oldMedicalCard/components/MedicalDentalFormula.vue";
|
||||
import BaseDetailInput from "@/components/base/BaseDetailInput.vue";
|
||||
import BaseDetailInfo from "@/components/base/BaseDetailInfo.vue";
|
||||
import { formulaDataMap } from "@/pages/oldMedicalCard/utils/medicalConfig";
|
||||
import { medicalDetailConfig } from "@/pages/oldMedicalCard/utils/medicalConfig";
|
||||
import { mobilityMap } from "@/pages/oldMedicalCard/utils/medicalConfig";
|
||||
import {
|
||||
getDentalEntiesValue,
|
||||
requestUpdateMedicalCard,
|
||||
requestCreateMedicalCard,
|
||||
getRequestDataPerson,
|
||||
} from "@/pages/oldMedicalCard/utils/wrapperMedicalCard";
|
||||
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||
import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import ClientDetailInput from "@/pages/clients/components/ClientDetailInput.vue";
|
||||
export default {
|
||||
name: "MedicalCardWrapper",
|
||||
components: {
|
||||
ClientDetailInput,
|
||||
BaseInput,
|
||||
BaseDetailInfo,
|
||||
BaseDetailInput,
|
||||
MedicalCardHeader,
|
||||
MedicalDentalFormula,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
personId: "",
|
||||
identityDocumentId: "",
|
||||
responseMedicalCardData: undefined,
|
||||
responseMedicalDentalData: {},
|
||||
numberCard: "",
|
||||
configData: medicalDetailConfig,
|
||||
medicalDataInit: {
|
||||
number_series: undefined,
|
||||
issued_by_org: undefined,
|
||||
issued_by_org_code: undefined,
|
||||
issued_by_date: undefined,
|
||||
registration_address: undefined,
|
||||
temporary_address: undefined,
|
||||
insurance_number: undefined,
|
||||
policy_series: undefined,
|
||||
policy_number: undefined,
|
||||
policy_organization: undefined,
|
||||
name_confidant: undefined,
|
||||
phone_confidant: undefined,
|
||||
benefit_code: undefined,
|
||||
agreement: undefined,
|
||||
agreement_date: undefined,
|
||||
},
|
||||
dentalIndications: {
|
||||
complaints: undefined,
|
||||
allergic: undefined,
|
||||
past_diseases: undefined,
|
||||
medications_taken: undefined,
|
||||
thermometry: undefined,
|
||||
tonometry: undefined,
|
||||
disease_progress: undefined,
|
||||
visual_examination: undefined,
|
||||
oral_examination: undefined,
|
||||
dental_formula: formulaDataMap,
|
||||
dental_bite: undefined,
|
||||
hygiene_index: undefined,
|
||||
dmf_index: undefined,
|
||||
diagnostic_findings: undefined,
|
||||
icd_code: undefined,
|
||||
survey_plan: undefined,
|
||||
survey_data: undefined,
|
||||
clinical_diagnosis: undefined,
|
||||
treatment_plan: undefined,
|
||||
treatment_protocol: undefined,
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
defineEmptyData(fields) {
|
||||
return fields.map((field) => this.medicalDataInit[field.label]);
|
||||
},
|
||||
validateFormCard() {
|
||||
const dataRequestPerson = getRequestDataPerson(
|
||||
this.medicalDataInit,
|
||||
this.dentalIndications
|
||||
);
|
||||
Object.keys(dataRequestPerson).forEach((key) => {
|
||||
let valuesData = [
|
||||
...new Set(
|
||||
Object.values(this.responseMedicalCardData[key]).map((el) =>
|
||||
el === null || el === undefined ? undefined : el
|
||||
)
|
||||
),
|
||||
];
|
||||
let isUpdateData = false;
|
||||
let isCreateData =
|
||||
valuesData.length === 1 &&
|
||||
valuesData[0] === undefined &&
|
||||
Object.values(dataRequestPerson[key]).find((el) => el !== undefined);
|
||||
Object.keys(dataRequestPerson[key]).forEach((entries) => {
|
||||
if (
|
||||
this.responseMedicalCardData[key][entries] &&
|
||||
dataRequestPerson[key][entries] !==
|
||||
this.responseMedicalCardData[key][entries]
|
||||
) {
|
||||
isUpdateData = true;
|
||||
}
|
||||
});
|
||||
if (isUpdateData) {
|
||||
requestUpdateMedicalCard(
|
||||
dataRequestPerson[key],
|
||||
key,
|
||||
key === "identity_document"
|
||||
? this.identityDocumentId
|
||||
: this.personId
|
||||
);
|
||||
}
|
||||
if (isCreateData) {
|
||||
requestCreateMedicalCard(
|
||||
dataRequestPerson[key],
|
||||
key,
|
||||
key === "identity_document"
|
||||
? this.identityDocumentId
|
||||
: this.personId
|
||||
);
|
||||
}
|
||||
});
|
||||
Object.keys(this.dentalIndications).forEach((key) => {
|
||||
if (key === "dental_formula") {
|
||||
const notEmptyEntries =
|
||||
this.dentalIndications.dental_formula[0].columns
|
||||
.concat(this.dentalIndications.dental_formula[1].columns)
|
||||
.filter((el) => el.dental_condition && el.tooth_mobility);
|
||||
notEmptyEntries.forEach((tooth) => {
|
||||
const toothResponse = this.responseMedicalDentalData[key].find(
|
||||
(el) => el.tooth_number === tooth.tooth_number
|
||||
);
|
||||
const isCreate =
|
||||
!toothResponse &&
|
||||
!!tooth.tooth_mobility &&
|
||||
!!tooth.dental_condition;
|
||||
if (isCreate) {
|
||||
requestCreateMedicalCard(
|
||||
tooth,
|
||||
key,
|
||||
localStorage.getItem("medicalId")
|
||||
);
|
||||
}
|
||||
if (
|
||||
toothResponse &&
|
||||
toothResponse.tooth_mobility.label !==
|
||||
tooth.tooth_mobility.label &&
|
||||
toothResponse.dental_condition !== tooth.dental_condition
|
||||
) {
|
||||
requestUpdateMedicalCard(tooth, key, toothResponse.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (
|
||||
key !== "dental_formula" &&
|
||||
!this.responseMedicalDentalData[key] &&
|
||||
this.dentalIndications[key]
|
||||
) {
|
||||
requestCreateMedicalCard(
|
||||
this.dentalIndications[key],
|
||||
key,
|
||||
localStorage.getItem("medicalId")
|
||||
);
|
||||
}
|
||||
if (
|
||||
key !== "dental_formula" &&
|
||||
this.dentalIndications[key] &&
|
||||
getDentalEntiesValue(this.responseMedicalDentalData[key], key) !==
|
||||
this.dentalIndications[key]
|
||||
) {
|
||||
requestUpdateMedicalCard(
|
||||
this.dentalIndications[key],
|
||||
key,
|
||||
this.responseMedicalDentalData[key]?.id
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
saveDataMedical(data) {
|
||||
this.personId = data?.person?.id;
|
||||
this.numberCard = data?.number;
|
||||
const confidant = data ? data["confidant"] : undefined;
|
||||
const pass = data
|
||||
? data?.person?.identity_document?.find((el) => el.kind === "PASSPORT")
|
||||
: null;
|
||||
this.identityDocumentId = pass?.id;
|
||||
this.medicalDataInit = {
|
||||
...this.medicalDataInit,
|
||||
issued_by_org: pass.issued_by_org,
|
||||
issued_by_org_code: pass.issued_by_org_code,
|
||||
number_series: `${pass.series} ${pass.number}`,
|
||||
issued_by_date: new Date(pass.issued_by_date),
|
||||
registration_address: data?.person?.address?.find(
|
||||
(el) => el["registration_flg"]
|
||||
)?.join_address,
|
||||
temporary_address: data?.person?.address?.find(
|
||||
(el) => el["temporary_registration_flg"]
|
||||
)?.join_address,
|
||||
insurance_number: data?.person["insurance_number"] || undefined,
|
||||
policy_number: data?.person["insurance_policy"][0]?.number,
|
||||
policy_series: data?.person["insurance_policy"][0]?.series,
|
||||
policy_organization: data?.person["insurance_policy"][0]?.organization,
|
||||
name_confidant:
|
||||
confidant &&
|
||||
`${confidant?.last_name} ${confidant?.last_name} ${confidant?.patronymic}`,
|
||||
phone_confidant: confidant?.contacts?.find((el) => el?.kind === "PHONE")
|
||||
?.username,
|
||||
benefit_code: data?.person?.benefit_code,
|
||||
agreement: data?.agreement,
|
||||
agreement_date: undefined,
|
||||
};
|
||||
Object.keys(this.dentalIndications).forEach((key) => {
|
||||
if (key === "dental_formula" && data[key].length) {
|
||||
this.responseMedicalDentalData[key] = data[key];
|
||||
data[key].forEach((tooth) => {
|
||||
if (tooth.dental_condition && tooth.tooth_mobility) {
|
||||
if (17 < tooth.tooth_number < 29) {
|
||||
this.dentalIndications.dental_formula[0] = {
|
||||
...this.dentalIndications.dental_formula[0],
|
||||
columns: this.dentalIndications.dental_formula[0].columns.map(
|
||||
(el) => {
|
||||
if (el.tooth_number === tooth.tooth_number) {
|
||||
return {
|
||||
...tooth,
|
||||
tooth_mobility: mobilityMap.find(
|
||||
(el) => el.label === tooth.tooth_mobility
|
||||
),
|
||||
};
|
||||
}
|
||||
return el;
|
||||
}
|
||||
),
|
||||
};
|
||||
}
|
||||
if (37 < tooth.tooth_number < 49) {
|
||||
this.dentalIndications.dental_formula[1] = {
|
||||
...this.dentalIndications.dental_formula[1],
|
||||
columns: this.dentalIndications.dental_formula[1].columns.map(
|
||||
(el) => {
|
||||
if (el.tooth_number === tooth.tooth_number) {
|
||||
return {
|
||||
...tooth,
|
||||
tooth_mobility: mobilityMap.find(
|
||||
(el) => el.label === tooth.tooth_mobility
|
||||
),
|
||||
};
|
||||
}
|
||||
return el;
|
||||
}
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.dentalIndications[key] = data[key]?.length
|
||||
? getDentalEntiesValue(data[key].at(-1), key)
|
||||
: this.dentalIndications[key];
|
||||
this.dentalIndications.allergic = data?.person?.allergic
|
||||
? data?.person?.allergic
|
||||
: this.dentalIndications.allergic;
|
||||
this.responseMedicalDentalData[key] = data[key]?.length
|
||||
? data[key].at(-1)
|
||||
: this.dentalIndications[key];
|
||||
}
|
||||
});
|
||||
this.responseMedicalCardData = getRequestDataPerson(
|
||||
this.medicalDataInit,
|
||||
this.dentalIndications
|
||||
);
|
||||
},
|
||||
async fetchDataMedicalCard() {
|
||||
await fetchWrapper
|
||||
.get(
|
||||
`medical_card/medical_history/${localStorage.getItem(
|
||||
"medicalId"
|
||||
)}/detail/`
|
||||
)
|
||||
.then((res) => this.saveDataMedical(res));
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.fetchDataMedicalCard();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.wrapper
|
||||
overflow: auto
|
||||
border-top-left-radius: 4px
|
||||
border-top-right-radius: 4px
|
||||
.wrapper-medical
|
||||
background-color: var(--default-white)
|
||||
height: calc(100vh - 64px)
|
||||
overflow: auto
|
||||
&::-webkit-scrollbar
|
||||
height: 4px
|
||||
width: 4px
|
||||
&::-webkit-scrollbar-track
|
||||
background-color: rgba(211, 212, 220, 0.5)
|
||||
border-radius: 8px
|
||||
&::-webkit-scrollbar-thumb
|
||||
border-radius: 8px
|
||||
background-color: var(--btn-blue-color)
|
||||
.card-basic-info
|
||||
display: grid
|
||||
grid-template-columns: 280px 292px 180px 360px 463px
|
||||
gap: 16px
|
||||
padding: 0 20px 20px 0
|
||||
overflow-x: auto
|
||||
&::-webkit-scrollbar
|
||||
height: 4px
|
||||
width: 4px
|
||||
&::-webkit-scrollbar-track
|
||||
background-color: rgba(211, 212, 220, 0.5)
|
||||
border-radius: 8px
|
||||
&::-webkit-scrollbar-thumb
|
||||
border-radius: 8px
|
||||
background-color: var(--btn-blue-color)
|
||||
.card-upper
|
||||
border-bottom: 1px solid var(--border-light-grey-color)
|
||||
</style>
|
||||
50
src/pages/oldMedicalCard/components/MedicalDentalFormula.vue
Normal file
50
src/pages/oldMedicalCard/components/MedicalDentalFormula.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<template lang="pug">
|
||||
.wrapper.flex.w-full.px-52px.py-7.gap-x-102px
|
||||
.flex.flex-col.gap-y-5
|
||||
.flex.flex-col.gap-y-4
|
||||
span.font-bold.text-base Состояние зубов:
|
||||
.flex.flex-col.gap-y-1
|
||||
div(v-for="condition in dentalCondition")
|
||||
span.font-bold.text-base {{condition.name}}
|
||||
span.text-base {{` - ${condition.discription}`}}
|
||||
.flex.flex-col.gap-y-1
|
||||
.font-bold.text-base Подвижность:
|
||||
span.text-base Степень -
|
||||
span.font-bold.text-base I, II, III
|
||||
.flex.flex-col.h-fit.rounded
|
||||
medical-formula-table(:data="formulaData[0]")
|
||||
medical-formula-table(:data="formulaData[1]")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { dentalСonditionMap } from "@/pages/oldMedicalCard/utils/medicalConfig";
|
||||
import MedicalFormulaTable from "@/pages/oldMedicalCard/components/MedicalFormulaTable.vue";
|
||||
export default {
|
||||
name: "MedicalDentalFormula",
|
||||
components: { MedicalFormulaTable },
|
||||
props: {
|
||||
formulaData: Array,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dentalCondition: dentalСonditionMap,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.wrapper
|
||||
border: 1.5px solid var(--border-light-grey-color)
|
||||
border-radius: 4px
|
||||
overflow: auto
|
||||
&::-webkit-scrollbar
|
||||
height: 4px
|
||||
width: 4px
|
||||
&::-webkit-scrollbar-track
|
||||
background-color: rgba(211, 212, 220, 0.5)
|
||||
border-radius: 8px
|
||||
&::-webkit-scrollbar-thumb
|
||||
border-radius: 8px
|
||||
background-color: var(--btn-blue-color)
|
||||
</style>
|
||||
48
src/pages/oldMedicalCard/components/MedicalFormulaTable.vue
Normal file
48
src/pages/oldMedicalCard/components/MedicalFormulaTable.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template lang="pug">
|
||||
//TODO: Поправить бордеры у таблицы
|
||||
.table-formula.flex.border-collapse
|
||||
.flex.flex-col.border-collapse
|
||||
.cell-grey.flex.w-52.h-50px.font-bold.text-lg.justify-center.items-center.border-collapse(v-for="row in data.rowMap") {{row.label}}
|
||||
.flex.flex-col.border-collapse(v-for="tooth in data.columns")
|
||||
.cell.flex.w-50px.h-50px.font-bold.text-2xl.justify-center.items-center(v-for="(row, index) in data.rowMap" :class="{'cell-grey': row.name === 'tooth_number'}")
|
||||
span(v-if="row.name === 'tooth_number'") {{tooth[row.name]}}
|
||||
base-input.pl-4.pr-2(v-if="row.name === 'dental_condition'" v-model="tooth[row.name]" :rules="[ruleCondition]" :max-length="2" borderless no-error-icon)
|
||||
label.flex.w-full.h-full.justify-center.items-center.cursor-pointer(v-if="row.name === 'tooth_mobility'")
|
||||
base-select.pl-4.pr-4(v-model="tooth[row.name]" :id="`${row.name}_${index}`" :items="mobilityMap" :outlined="false" menu-anchor="bottom start" borderless hide-dropdown-icon)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ruleDentalCondition } from "@/assets/rules/rulesInput";
|
||||
import BaseInput from "@/components/base/BaseInput.vue";
|
||||
import BaseSelect from "@/components/base/BaseSelect.vue";
|
||||
import { mobilityMap } from "@/pages/oldMedicalCard/utils/medicalConfig";
|
||||
export default {
|
||||
name: "MedicalFormulaTable",
|
||||
components: { BaseInput, BaseSelect },
|
||||
props: {
|
||||
data: Object,
|
||||
rowMap: Array,
|
||||
condition: Array,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
ruleCondition: ruleDentalCondition,
|
||||
mobilityMap: mobilityMap,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.table-formula
|
||||
border-left: 1.5px solid var(--font-black-color)
|
||||
border-top: 1.5px solid var(--font-black-color)
|
||||
.cell
|
||||
border-bottom: 1.5px solid black
|
||||
border-right: 1.5px solid black
|
||||
.cell-grey
|
||||
@extend .cell
|
||||
background-color: var(--border-light-grey-color)
|
||||
.not-border
|
||||
border: none
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template lang="pug">
|
||||
.base.flex.flex-col.gap-y-6
|
||||
.flex.flex-col.gap-y-6
|
||||
span.font-bold Паспортные данные
|
||||
.flex.flex-col.gap-y-6
|
||||
base-input(
|
||||
label="Серия и номер",
|
||||
placeholder="0000 000000",
|
||||
mask="#### ######",
|
||||
v-model="clientDetail.identity_documents.series_number",
|
||||
outlined
|
||||
)
|
||||
base-input(
|
||||
label="Кем выдан",
|
||||
placeholder="Точно как в паспорте",
|
||||
v-model="clientDetail.identity_documents.issued_by_org",
|
||||
outlined
|
||||
)
|
||||
.flex.gap-x-4
|
||||
base-input(
|
||||
label="Код подразделения",
|
||||
placeholder="000-000",
|
||||
mask="###-###",
|
||||
v-model="clientDetail.identity_documents.issued_by_org_code",
|
||||
outlined
|
||||
)
|
||||
base-input(
|
||||
type="date",
|
||||
label="Дата выдачи",
|
||||
v-model="clientDetail.identity_documents.issued_by_date",
|
||||
outlined
|
||||
)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseInput from "@/components/base/BaseInput";
|
||||
import BaseSelect from "@/components/base/BaseSelect";
|
||||
|
||||
export default {
|
||||
name: "MedicalIdentityDocuments",
|
||||
components: { BaseInput, BaseSelect },
|
||||
props: {
|
||||
changeIdentityDoc: Function,
|
||||
clientDetail: Object,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,93 @@
|
||||
<template lang="pug">
|
||||
.base.flex.flex-col.gap-y-6
|
||||
span.font-bold Полис
|
||||
base-radio-buttons-group(
|
||||
:items="policiesList",
|
||||
v-model="clientDetail.policy",
|
||||
:columnGap="152",
|
||||
inline
|
||||
)
|
||||
.flex.gap-x-4
|
||||
.flex.flex-col.gap-y-4
|
||||
base-input.input(
|
||||
label="Серия и номер полиса ОМС",
|
||||
placeholder="000000 0000000000",
|
||||
v-model="clientDetail.OMSPolicy.number",
|
||||
mask="###### ##########",
|
||||
:disabled="!selectedOMSPolicy",
|
||||
outlined
|
||||
)
|
||||
base-input.input(
|
||||
label="Страховая организация полиса ОМС",
|
||||
v-model="clientDetail.OMSPolicy.organization",
|
||||
:disabled="!selectedOMSPolicy",
|
||||
outlined
|
||||
)
|
||||
.flex.flex-col.gap-y-4
|
||||
base-input.input(
|
||||
label="Серия и номер полиса ДМС",
|
||||
placeholder="000000 0000000000",
|
||||
v-model="clientDetail.DMSPolicy.number",
|
||||
mask="###### ##########",
|
||||
:disabled="selectedOMSPolicy",
|
||||
outlined
|
||||
)
|
||||
base-input.input(
|
||||
label="Страховая организация полиса ДМС",
|
||||
v-model="clientDetail.DMSPolicy.organization",
|
||||
:disabled="selectedOMSPolicy",
|
||||
outlined
|
||||
)
|
||||
base-input(
|
||||
label="Код категории льготы",
|
||||
placeholder="000",
|
||||
mask="###"
|
||||
v-model="clientDetail.benefit_code",
|
||||
outlined
|
||||
)
|
||||
base-input(
|
||||
label="К кому обращаться в случае необходимости",
|
||||
placeholder="ФИО*",
|
||||
v-model="clientDetail.confidant_name",
|
||||
outlined
|
||||
)
|
||||
base-input(
|
||||
label="Номер телефона",
|
||||
placeholder="+7 (915) 644–92–23",
|
||||
mask="+7 (###) ###-##-##",
|
||||
v-model="clientDetail.confidant_phone",
|
||||
outlined
|
||||
)
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseInput from "@/components/base/BaseInput";
|
||||
import BaseSelect from "@/components/base/BaseSelect";
|
||||
import BaseRadioButtonsGroup from "@/components/base/BaseRadioButtonsGroup.vue";
|
||||
import { medicalDetailConfig } from "@/pages/oldMedicalCard/utils/medicalConfig.js";
|
||||
|
||||
export default {
|
||||
name: "MedicalPolicyDocuments",
|
||||
components: {
|
||||
BaseInput,
|
||||
BaseSelect,
|
||||
BaseRadioButtonsGroup,
|
||||
},
|
||||
props: {
|
||||
clientDetail: Object,
|
||||
},
|
||||
computed: {
|
||||
policiesList() {
|
||||
return medicalDetailConfig.policiesList;
|
||||
},
|
||||
selectedOMSPolicy() {
|
||||
return this.clientDetail.policy === "OMS";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.input
|
||||
width: 277px
|
||||
</style>
|
||||
449
src/pages/oldMedicalCard/utils/medicalConfig.js
Normal file
449
src/pages/oldMedicalCard/utils/medicalConfig.js
Normal file
@@ -0,0 +1,449 @@
|
||||
export const medicalDetailConfig = {
|
||||
gendersList: [
|
||||
{
|
||||
id: "1",
|
||||
label: "Мужской",
|
||||
value: "MALE",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
label: "Женский",
|
||||
value: "WOMEN",
|
||||
},
|
||||
],
|
||||
policiesList: [
|
||||
{
|
||||
id: "1",
|
||||
label: "Полис ОМС",
|
||||
value: "OMS",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
label: "Полис ДМС",
|
||||
value: "DMS",
|
||||
},
|
||||
],
|
||||
identity_document: {
|
||||
height: 316,
|
||||
title: "Паспортные данные",
|
||||
fields: [
|
||||
{
|
||||
label: "number_series",
|
||||
title: "Серия и номер",
|
||||
type: "text",
|
||||
mask: "#### ######",
|
||||
copy: true,
|
||||
},
|
||||
{
|
||||
label: "issued_by_org",
|
||||
title: "Выдан",
|
||||
type: "textarea",
|
||||
},
|
||||
{
|
||||
label: "issued_by_org_code",
|
||||
title: "Код подразделения",
|
||||
type: "text",
|
||||
mask: "###-###",
|
||||
},
|
||||
{
|
||||
label: "issued_by_date",
|
||||
title: "Дата выдачи",
|
||||
type: "date",
|
||||
},
|
||||
],
|
||||
},
|
||||
registration_address: {
|
||||
height: 85,
|
||||
title: "Адрес регистрации",
|
||||
fields: [
|
||||
{
|
||||
label: "registration_address",
|
||||
title: "Полный адрес",
|
||||
type: "textarea",
|
||||
},
|
||||
],
|
||||
},
|
||||
temporary_address: {
|
||||
height: 85,
|
||||
title: "Адрес проживания",
|
||||
fields: [
|
||||
{
|
||||
label: "temporary_address",
|
||||
title: "Полный адрес",
|
||||
type: "textarea",
|
||||
},
|
||||
],
|
||||
},
|
||||
snils: {
|
||||
height: 85,
|
||||
title: "СНИЛС",
|
||||
fields: [
|
||||
{
|
||||
label: "insurance_number",
|
||||
title: "Номер",
|
||||
type: "text",
|
||||
mask: "###-###-### ##",
|
||||
copy: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
policy: {
|
||||
height: 162,
|
||||
title: "ПОЛИС",
|
||||
fields: [
|
||||
{
|
||||
label: "policy_series",
|
||||
title: "Серия",
|
||||
type: "text",
|
||||
mask: "####",
|
||||
},
|
||||
{
|
||||
label: "policy_number",
|
||||
title: "Номер",
|
||||
type: "text",
|
||||
mask: "#######",
|
||||
},
|
||||
],
|
||||
},
|
||||
policy_organization: {
|
||||
height: 85,
|
||||
title: "Страховая организация",
|
||||
fields: [
|
||||
{
|
||||
label: "policy_organization",
|
||||
title: "Название",
|
||||
type: "text",
|
||||
},
|
||||
],
|
||||
},
|
||||
additional: {
|
||||
height: 218,
|
||||
title: "Дополнительная информация",
|
||||
fields: [
|
||||
{
|
||||
icon: "icon-person",
|
||||
label: "name_confidant",
|
||||
title: "Доверенное лицо",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
icon: "icon-phone",
|
||||
label: "phone_confidant",
|
||||
title: "",
|
||||
type: "text",
|
||||
mask: "+7 (###) ###-##-##",
|
||||
},
|
||||
{
|
||||
label: "benefit_code",
|
||||
title: "Код категории льготы",
|
||||
type: "text",
|
||||
mask: "###",
|
||||
},
|
||||
],
|
||||
},
|
||||
agreement_form: {
|
||||
height: 121,
|
||||
title:
|
||||
"Информированное добровольное согласие на виды медицинских вмешательств, включенные в Перечень определенных видов медицинских вмешательств:",
|
||||
fields: [
|
||||
{
|
||||
label: "agreement",
|
||||
title: "Получено",
|
||||
type: "radio",
|
||||
items: [
|
||||
{
|
||||
id: "1",
|
||||
label: "Да",
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
label: "Нет",
|
||||
value: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "agreement_date",
|
||||
title: "Дата",
|
||||
type: "date",
|
||||
},
|
||||
],
|
||||
},
|
||||
dental_indications: {
|
||||
complaints: "Жалобы",
|
||||
allergic: "Аллергологический анамнез",
|
||||
past_diseases: "Перенесённые и сопутствующие заболевания",
|
||||
medications_taken: "Принимаемые лекарственные препараты",
|
||||
thermometry: "Термометрия (по показаниям)",
|
||||
tonometry: "Тонометрия, ЧСС (по показаниям)",
|
||||
disease_progress: "Развитие настоящего заболевания",
|
||||
visual_examination: "Внешний осмотр",
|
||||
oral_examination: "Осмотр преддверия и полости рта",
|
||||
dental_formula: "Зубная формула",
|
||||
dental_bite: "Прикус",
|
||||
hygiene_index: "Индекс гигиены",
|
||||
dmf_index: "Индекс КПУ",
|
||||
diagnostic_findings: "Предварительный диагноз",
|
||||
icd_code: "Код МКБ-10",
|
||||
survey_plan: "План обследования",
|
||||
survey_data: "Данные обследования",
|
||||
clinical_diagnosis: "Клинический диагноз",
|
||||
treatment_plan: "План лечения",
|
||||
treatment_protocol: "Протокол лечения",
|
||||
},
|
||||
};
|
||||
|
||||
export const dentalСonditionMap = [
|
||||
{
|
||||
name: "К",
|
||||
discription: "кариес",
|
||||
},
|
||||
{
|
||||
name: "П",
|
||||
discription: "пульпит",
|
||||
},
|
||||
{
|
||||
name: "Пт",
|
||||
discription: "периодонтит",
|
||||
},
|
||||
{
|
||||
name: "Д",
|
||||
discription: "дефект",
|
||||
},
|
||||
{
|
||||
name: "Пл",
|
||||
discription: "пломба",
|
||||
},
|
||||
{
|
||||
name: "Ик",
|
||||
discription: "искусственная коронка",
|
||||
},
|
||||
{
|
||||
name: "Из",
|
||||
discription: "искусственный зуб",
|
||||
},
|
||||
{
|
||||
name: "В",
|
||||
discription: "вкладка",
|
||||
},
|
||||
{
|
||||
name: "И",
|
||||
discription: "имплантат",
|
||||
},
|
||||
{
|
||||
name: "Кз",
|
||||
discription: "корень зуба",
|
||||
},
|
||||
{
|
||||
name: "О",
|
||||
discription: "отсутствующий зуб",
|
||||
},
|
||||
];
|
||||
|
||||
export const mobilityMap = [
|
||||
{ id: 1, label: "I" },
|
||||
{ id: 2, label: "II" },
|
||||
{ id: 3, label: "III" },
|
||||
];
|
||||
|
||||
export const formulaDataMap = [
|
||||
{
|
||||
name: "upperJaw",
|
||||
rowMap: [
|
||||
{
|
||||
label: "Подвижность",
|
||||
name: "tooth_mobility",
|
||||
},
|
||||
{
|
||||
label: "Cостояние зубов",
|
||||
name: "dental_condition",
|
||||
},
|
||||
{
|
||||
label: "Верхняя челюсть",
|
||||
name: "tooth_number",
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
tooth_number: 18,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 17,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 16,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 15,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 14,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 13,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 12,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 11,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 21,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 22,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 23,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 24,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 25,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 26,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 27,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 28,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "lowerJaw",
|
||||
rowMap: [
|
||||
{
|
||||
label: "Нижняя челюсть",
|
||||
name: "tooth_number",
|
||||
},
|
||||
{
|
||||
label: "Cостояние зубов",
|
||||
name: "dental_condition",
|
||||
},
|
||||
{
|
||||
label: "Подвижность",
|
||||
name: "tooth_mobility",
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
tooth_number: 48,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 47,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 46,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 45,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 44,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 43,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 42,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 41,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 31,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 32,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 33,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 34,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 35,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 36,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 37,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
{
|
||||
tooth_number: 38,
|
||||
dental_condition: "",
|
||||
tooth_mobility: "",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
226
src/pages/oldMedicalCard/utils/wrapperMedicalCard.js
Normal file
226
src/pages/oldMedicalCard/utils/wrapperMedicalCard.js
Normal file
@@ -0,0 +1,226 @@
|
||||
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||
import moment from "moment";
|
||||
export function requestCreateMedicalCard(entry, key, id) {
|
||||
const url = `medical_card/${key}/create/`;
|
||||
let arrayValue;
|
||||
if (["tonometry", "dental_bite", "dmf_index"].includes(key)) {
|
||||
arrayValue = entry.split(",");
|
||||
}
|
||||
switch (key) {
|
||||
case "complaints":
|
||||
case "medications_taken":
|
||||
case "disease_progress":
|
||||
case "visual_examination":
|
||||
case "diagnostic_findings":
|
||||
case "survey_plan":
|
||||
case "treatment_plan":
|
||||
case "treatment_protocol":
|
||||
return fetchWrapper.post(url, {
|
||||
title: entry,
|
||||
description: entry,
|
||||
medical_history: id,
|
||||
});
|
||||
case "thermometry":
|
||||
return fetchWrapper.post(url, {
|
||||
title: entry,
|
||||
temperature: Number(entry),
|
||||
medical_history: id,
|
||||
});
|
||||
case "tonometry":
|
||||
return fetchWrapper.post(url, {
|
||||
title: entry,
|
||||
sys: Number(arrayValue[0]),
|
||||
dia: Number(arrayValue[1]),
|
||||
pul: Number(arrayValue[2]),
|
||||
medical_history: id,
|
||||
});
|
||||
case "dental_bite":
|
||||
return fetchWrapper.post(url, {
|
||||
custom: arrayValue[0],
|
||||
physiological: arrayValue[1],
|
||||
abnormal: arrayValue[2],
|
||||
medical_history: id,
|
||||
});
|
||||
case "dmf_index":
|
||||
return fetchWrapper.post(url, {
|
||||
caries: Number(arrayValue[0]),
|
||||
filling: Number(arrayValue[1]),
|
||||
remote: Number(arrayValue[2]),
|
||||
medical_history: id,
|
||||
});
|
||||
case "clinical_diagnosis":
|
||||
return fetchWrapper.post(url, {
|
||||
title: entry,
|
||||
description: "string",
|
||||
medical_history: id,
|
||||
icd10: id,
|
||||
});
|
||||
case "dental_formula":
|
||||
return fetchWrapper.post(url, {
|
||||
...entry,
|
||||
tooth_mobility: entry.tooth_mobility ? entry.tooth_mobility.label : "",
|
||||
tooth_number: entry.tooth_number,
|
||||
medical_history: id,
|
||||
});
|
||||
case "registration_address":
|
||||
return fetchWrapper.post(`general/address/create/`, {
|
||||
...entry,
|
||||
person: id,
|
||||
registration_flg: true,
|
||||
});
|
||||
case "temporary_address":
|
||||
return fetchWrapper.post(`general/address/create/`, {
|
||||
...entry,
|
||||
person: id,
|
||||
temporary_registration_flg: true,
|
||||
});
|
||||
case "identity_document":
|
||||
return fetchWrapper.post(`general/identity_document/create/`, {
|
||||
...entry,
|
||||
person: id,
|
||||
});
|
||||
case "insurance_policy":
|
||||
return fetchWrapper.post(`general/insurance_policy/create/`, {
|
||||
...entry,
|
||||
title: "string",
|
||||
person: id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function requestUpdateMedicalCard(entry, key, id) {
|
||||
const url = `medical_card/${key}/${id}/update/`;
|
||||
let arrayValue;
|
||||
if (["tonometry", "dental_bite", "dmf_index"].includes(key)) {
|
||||
arrayValue = entry.split(",");
|
||||
}
|
||||
switch (key) {
|
||||
case "complaints":
|
||||
case "medications_taken":
|
||||
case "disease_progress":
|
||||
case "visual_examination":
|
||||
case "diagnostic_findings":
|
||||
case "survey_plan":
|
||||
case "treatment_plan":
|
||||
case "treatment_protocol":
|
||||
return fetchWrapper.post(url, {
|
||||
title: entry,
|
||||
description: entry,
|
||||
});
|
||||
case "thermometry":
|
||||
return fetchWrapper.post(url, {
|
||||
title: entry,
|
||||
temperature: Number(entry),
|
||||
});
|
||||
case "tonometry":
|
||||
return fetchWrapper.post(url, {
|
||||
title: entry,
|
||||
sys: Number(arrayValue[0]),
|
||||
dia: Number(arrayValue[1]),
|
||||
pul: Number(arrayValue[2]),
|
||||
});
|
||||
case "dental_bite":
|
||||
return fetchWrapper.post(url, {
|
||||
custom: entry,
|
||||
physiological: entry,
|
||||
abnormal: entry,
|
||||
});
|
||||
case "dmf_index":
|
||||
return fetchWrapper.post(url, {
|
||||
caries: Number(entry),
|
||||
filling: Number(entry),
|
||||
remote: Number(entry),
|
||||
});
|
||||
case "clinical_diagnosis":
|
||||
return fetchWrapper.post(url, {
|
||||
title: entry,
|
||||
description: "string",
|
||||
icd10: id,
|
||||
});
|
||||
case "dental_formula":
|
||||
return fetchWrapper.post(url, {
|
||||
...entry,
|
||||
tooth_mobility: entry.tooth_mobility ? entry.tooth_mobility.label : "",
|
||||
tooth_number: entry.tooth_number,
|
||||
});
|
||||
case "registration_address":
|
||||
return fetchWrapper.post(`general/address/${id}/update/`, {
|
||||
...entry,
|
||||
registration_flg: true,
|
||||
});
|
||||
case "temporary_address":
|
||||
return fetchWrapper.post(`general/address/${id}/update/`, {
|
||||
...entry,
|
||||
temporary_registration_flg: true,
|
||||
});
|
||||
case "identity_document":
|
||||
return fetchWrapper.post(`general/identity_document/${id}/update/`, {
|
||||
...entry,
|
||||
});
|
||||
case "insurance_policy":
|
||||
return fetchWrapper.post(`general/insurance_policy/${id}/update/`, {
|
||||
...entry,
|
||||
title: "string",
|
||||
});
|
||||
case "person":
|
||||
return fetchWrapper.post(`general/person/${id}/update/`, {
|
||||
...entry,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function getRequestDataPerson(person, dental) {
|
||||
const dataPersonRequest = {
|
||||
identity_document: {
|
||||
issued_by_org: person.issued_by_org,
|
||||
issued_by_org_code: person.issued_by_org_code,
|
||||
issued_by_date: moment(person.issued_by_date).format("YYYY-MM-DD"),
|
||||
number: person.number_series.split(" ")[1],
|
||||
series: person.number_series.split(" ")[0],
|
||||
},
|
||||
registration_address: {
|
||||
full_address: person.registration_address,
|
||||
},
|
||||
temporary_address: {
|
||||
full_address: person.temporary_address,
|
||||
},
|
||||
insurance_policy: {
|
||||
series: person.policy_series,
|
||||
number: person.policy_number,
|
||||
organization: person.policy_organization,
|
||||
},
|
||||
person: {
|
||||
insurance_number: person.insurance_number,
|
||||
benefit_code: person.benefit_code,
|
||||
allergic: dental.allergic,
|
||||
},
|
||||
agreement: {
|
||||
agreement: person.agreement,
|
||||
},
|
||||
};
|
||||
return dataPersonRequest;
|
||||
}
|
||||
export function getDentalEntiesValue(data, key) {
|
||||
switch (key) {
|
||||
case "complaints":
|
||||
case "medications_taken":
|
||||
case "disease_progress":
|
||||
case "visual_examination":
|
||||
case "diagnostic_findings":
|
||||
case "survey_plan":
|
||||
case "treatment_plan":
|
||||
case "treatment_protocol":
|
||||
case "clinical_diagnosis":
|
||||
return data?.description;
|
||||
case "thermometry":
|
||||
return `${data?.temperature}`;
|
||||
case "tonometry":
|
||||
return `${data?.sys},${data?.dia},${data?.pul}`;
|
||||
case "dental_bite":
|
||||
return `${data?.custom},${data?.physiological},${data?.abnormal}`;
|
||||
case "dmf_index":
|
||||
return data["index_calculation"];
|
||||
case "hygiene_index":
|
||||
return data["index_calculation"];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user