diff --git a/api/laboratory/views.py b/api/laboratory/views.py index 89cc12a6d3..a8e0d65933 100644 --- a/api/laboratory/views.py +++ b/api/laboratory/views.py @@ -476,6 +476,7 @@ def form(request): "selectedReference": selected_reference, "norm": r.get_is_norm(recalc=True)[0] if r else None, "value": str(r.value if r else '').replace('<', '<').replace('>', '>'), + "comment": str(r.comment if r else '').replace('<', '<').replace('>', '>'), } ) @@ -512,9 +513,11 @@ def save(request): created = True value = bleach.clean(r["value"], tags=['sup', 'sub', 'br', 'b', 'i', 'strong', 'a', 'img', 'font', 'p', 'span', 'div']).replace("
", "
") + comment = bleach.clean(r.get('comment', ''), tags=['sup', 'sub', 'br', 'b', 'i', 'strong', 'a', 'img', 'font', 'p', 'span', 'div']).replace("
", "
").strip() - if not created or value: + if not created or value or comment: fraction_result.value = value + fraction_result.comment = comment fraction_result.get_units(needsave=False) fraction_result.iteration = 1 diff --git a/appconf/manager.py b/appconf/manager.py index e75d69a538..7cb051b7c4 100644 --- a/appconf/manager.py +++ b/appconf/manager.py @@ -10,7 +10,7 @@ class SettingManager: - VERSION = f"{laboratory.VERSION}-10" + VERSION = f"{laboratory.VERSION}-12" WARMUP_TEST_KEY = f'SettingManager:test-warmup:v{VERSION}' FULL_CACHE_L2_KEY = f'SettingManager:l2:v{VERSION}' FULL_CACHE_EN_KEY = f'SettingManager:en:v{VERSION}' @@ -170,6 +170,7 @@ def l2_modules() -> dict: "ftp", "case", "hide_show_count_param", + "fraction_comment", ] }, "consults_module": SettingManager.get("consults_module", default='false', default_type='b'), diff --git a/directions/models.py b/directions/models.py index d5e49845bf..eff4f3154d 100644 --- a/directions/models.py +++ b/directions/models.py @@ -2994,6 +2994,7 @@ class Result(models.Model): issledovaniye = models.ForeignKey(Issledovaniya, db_index=True, help_text='Направление на исследование, для которого сохранен результат', on_delete=models.CASCADE) fraction = models.ForeignKey(directory.Fractions, help_text='Фракция из исследования', db_index=True, on_delete=models.CASCADE) value = models.TextField(null=True, blank=True, help_text='Значение') + comment = models.TextField(null=True, blank=True, help_text='Комментарий к значению') iteration = models.IntegerField(default=1, null=True, help_text='Итерация') is_normal = models.CharField(max_length=255, default="", null=True, blank=True, help_text="Это норма?") selected_reference = models.IntegerField(default=-2, blank=True, help_text="Выбранный референс") diff --git a/l2-frontend/src/pages/LaboratoryResults/ResultsForm.vue b/l2-frontend/src/pages/LaboratoryResults/ResultsForm.vue index d10654c6f7..49949f3b86 100644 --- a/l2-frontend/src/pages/LaboratoryResults/ResultsForm.vue +++ b/l2-frontend/src/pages/LaboratoryResults/ResultsForm.vue @@ -57,11 +57,15 @@ + @@ -87,12 +91,15 @@ Значение - + Нормы М - + Нормы Ж + + Комментарий + @@ -133,13 +140,20 @@ /> + + + @@ -340,6 +354,26 @@ export default { noRefs() { return this.research.no_units_and_ref || this.research.template === 2; }, + patientSex() { + return this.dirData?.client_sex; + }, + isPatientSexF() { + return this.patientSex === 'ж'; + }, + visibleRefsM() { + if (this.noRefs) { + return false; + } + + return !this.labFractionComment || !this.isPatientSexF; + }, + visibleRefsF() { + if (this.noRefs) { + return false; + } + + return !this.labFractionComment || this.isPatientSexF; + }, execParams() { const r = []; if (this.execData.timeSave) { @@ -362,6 +396,9 @@ export default { legalAuthenticator() { return !!this.$store.getters.modules.legal_authenticator; }, + labFractionComment() { + return !!this.$store.getters.modules.l2_fraction_comment; + }, }, mounted() { this.$root.$on('laboratory:results:open-form', (pk, allDirPks, dirData) => {