Изменил роутинг на страницу новой мед-карты
This commit is contained in:
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