Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checks on length of some basic parameter of the SOPClass constructor #255

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/highdicom/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ContentQualificationValues,
PatientSexValues,
)
from highdicom.valuerep import check_person_name
from highdicom.valuerep import check_person_name, _check_long_string
from highdicom.version import __version__
from highdicom._module_utils import is_attribute_in_iod

Expand Down Expand Up @@ -199,16 +199,23 @@ def __init__(
self.SeriesDescription = series_description

# Equipment
if manufacturer is not None:
_check_long_string(manufacturer)
self.Manufacturer = manufacturer
if manufacturer_model_name is not None:
_check_long_string(manufacturer_model_name)
self.ManufacturerModelName = manufacturer_model_name
if device_serial_number is not None:
_check_long_string(device_serial_number)
self.DeviceSerialNumber = device_serial_number
if software_versions is not None:
_check_long_string(software_versions)
self.SoftwareVersions = software_versions
if institution_name is not None:
_check_long_string(institution_name)
self.InstitutionName = institution_name
if institutional_department_name is not None:
_check_long_string(institutional_department_name)
self.InstitutionalDepartmentName = institutional_department_name

# Instance
Expand Down
Loading