Skip to content

Commit

Permalink
Merge pull request #4523 from mikhailprivalov/fix530_print
Browse files Browse the repository at this point in the history
fix front change group field
  • Loading branch information
urchinpro authored Dec 6, 2024
2 parents 363da20 + f26b696 commit af775b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/stationar/sql_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ def get_title_fields_by_cda_relation(id_research, cda_id_field):
with connection.cursor() as cursor:
cursor.execute(
"""
SELECT "id", title, cda_option_id FROM directory_paraclinicinputfield
WHERE group_id in (SELECT "id" FROM directory_paraclinicinputgroups WHERE research_id=%(id_research)s)
SELECT id, title, cda_option_id FROM directory_paraclinicinputfield
WHERE group_id in (SELECT id FROM directory_paraclinicinputgroups WHERE research_id=%(id_research)s)
AND directory_paraclinicinputfield.cda_option_id IN %(cda_option)s
""",
params={"id_research": id_research, 'cda_option': cda_id_field},
Expand Down
5 changes: 3 additions & 2 deletions forms/forms106.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,8 @@ def check_section_param(objs, styles_obj, section, tbl_specification, cda_titles
elif section.get("text"):
cda_titles_sec = section.get("cdaTitles")
data_cda = [cda_titles.get(i) for i in cda_titles_sec if cda_titles.get(i)]
if len(data_cda) < 1:
data_cda = ["" for count in range(len(cda_titles_sec))]
difference = len(cda_titles_sec) - len(data_cda)
if len(data_cda) < len(cda_titles_sec):
data_cda = [*data_cda, *["" for count in range(difference)]]
objs.append(Paragraph(section.get("text").format(*data_cda), styles_obj[section.get("style")]))
return objs
1 change: 1 addition & 0 deletions forms/forms_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ def primary_reception_get_data_by_cda(hosp_first_num, site_type=0):
if CDA_TITLES_FIELDS_PRIMARY_RESEARCH:
cda_ids_data = cda_data_by_title(tuple(CDA_TITLES_FIELDS_PRIMARY_RESEARCH))
cda_ids = [i.id for i in cda_ids_data]

cda_dict_title = {i.id: i.title for i in cda_ids_data}
fields_data = get_title_fields_by_cda_relation(primary_research_id, tuple(cda_ids))
titles_field = [i.title for i in fields_data]
Expand Down

0 comments on commit af775b8

Please sign in to comment.