Skip to content

Commit

Permalink
Merge pull request #3343 from mikhailprivalov/lab2ecp
Browse files Browse the repository at this point in the history
send labresult2ecp
  • Loading branch information
Wellheor1 authored Jan 8, 2024
2 parents c408cfd + 41aa3d4 commit 5baf2e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions directions/forms/forms580.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def form_01(request_data):

buffer = BytesIO()
pagesize = (80 * mm, 120 * mm)
doc = SimpleDocTemplate(buffer, pagesize=pagesize, leftMargin=2 * mm, rightMargin=0 * mm, topMargin=1 * mm, bottomMargin=1 * mm, allowSplitting=1, title="Форма {}".format("80 мм"))
doc = SimpleDocTemplate(buffer, pagesize=pagesize, leftMargin=2 * mm, rightMargin=2 * mm, topMargin=1 * mm, bottomMargin=1 * mm, allowSplitting=1, title="Форма {}".format("80 мм"))
styleSheet = getSampleStyleSheet()
style = styleSheet["Normal"]
style.fontName = "PTAstraSerifReg"
Expand All @@ -55,7 +55,7 @@ def form_01(request_data):

styleFL = deepcopy(style)
styleFL.firstLineIndent = 0
styleFL.fontSize = 20
styleFL.fontSize = 16

styleCenter = deepcopy(style)
styleCenter.alignment = TA_CENTER
Expand Down Expand Up @@ -91,13 +91,13 @@ def form_01(request_data):
],
]

tbl = Table(opinion, colWidths=(33 * mm, 42 * mm))
tbl = Table(opinion, colWidths=(30 * mm, 45 * mm))
tbl.setStyle(
TableStyle(
[
('GRID', (0, 0), (-1, -1), 0.1, colors.white),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('LEFTPADDING', (1, 0), (-1, -1), -1 * mm),
('LEFTPADDING', (1, 0), (-1, -1), -5 * mm),
('LEFTPADDING', (0, 0), (-1, -1), -0.3 * mm),
]
)
Expand Down
5 changes: 5 additions & 0 deletions directory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ class Researches(models.Model):
cpp_template_files = models.TextField(max_length=500, default=None, null=True, blank=True, help_text="{1: 'название шаблона',2: 'название шаблона', 3: 'название шаблона'}")
cda_template_file = models.CharField(max_length=50, db_index=True, blank=True, default="", null=True, help_text="название шаблона cda-шаблона")
n3_id_med_document_type = models.SmallIntegerField(default=0, blank=True, help_text="N3 id_med_document_type")
ecp_id = models.CharField(max_length=16, default='', blank=True, verbose_name='Код услуги в ЕЦП')

@staticmethod
def save_plan_performer(tb_data):
Expand Down Expand Up @@ -877,6 +878,7 @@ class Fractions(models.Model):
fsli = models.CharField(max_length=32, default=None, null=True, blank=True)
patient_control_param = models.ForeignKey(PatientControlParam, default=None, null=True, blank=True, help_text='Контролируемый параметр', on_delete=models.SET_NULL)
not_send_odli = models.BooleanField(help_text="Не отправлять данные в ОДЛИ", default=False)
ecp_id = models.CharField(max_length=16, default='', blank=True, verbose_name='Код теста в ЕЦП')

def get_unit(self):
if self.unit:
Expand All @@ -898,6 +900,9 @@ def get_unit_str(self):
def get_fsli_code(self):
return (self.fsli or '').strip()

def get_ecp_code(self):
return (self.ecp_id or '').strip()

def __str__(self):
return self.research.title + " | " + self.title

Expand Down
2 changes: 2 additions & 0 deletions integration_framework/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ def issledovaniye_data(request):
"unitCode": u.code if u else None,
"ref": refs,
"interpretation": "N" if norm and norm[0] == ResultRight.RESULT_MODE_NORMAL else "A",
"ecpId": r.fraction.get_ecp_code(),
}
)

Expand All @@ -445,6 +446,7 @@ def issledovaniye_data(request):
"comments": i.lab_comment,
"isGistology": i.research.is_gistology,
"isParaclinic": i.research.is_paraclinic,
"ecpResearchId": i.research.ecp_id,
}
)

Expand Down

0 comments on commit 5baf2e0

Please sign in to comment.