Skip to content

Commit b4bb70c

Browse files
authored
Merge pull request #255 from ImagingDataCommons/bug/check_basic_attributes
Add checks on length of some basic parameter of the SOPClass constructor
2 parents 51f2c55 + 19adf52 commit b4bb70c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/highdicom/base.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
ContentQualificationValues,
1515
PatientSexValues,
1616
)
17-
from highdicom.valuerep import check_person_name
17+
from highdicom.valuerep import check_person_name, _check_long_string
1818
from highdicom.version import __version__
1919
from highdicom._module_utils import is_attribute_in_iod
2020

@@ -199,16 +199,23 @@ def __init__(
199199
self.SeriesDescription = series_description
200200

201201
# Equipment
202+
if manufacturer is not None:
203+
_check_long_string(manufacturer)
202204
self.Manufacturer = manufacturer
203205
if manufacturer_model_name is not None:
206+
_check_long_string(manufacturer_model_name)
204207
self.ManufacturerModelName = manufacturer_model_name
205208
if device_serial_number is not None:
209+
_check_long_string(device_serial_number)
206210
self.DeviceSerialNumber = device_serial_number
207211
if software_versions is not None:
212+
_check_long_string(software_versions)
208213
self.SoftwareVersions = software_versions
209214
if institution_name is not None:
215+
_check_long_string(institution_name)
210216
self.InstitutionName = institution_name
211217
if institutional_department_name is not None:
218+
_check_long_string(institutional_department_name)
212219
self.InstitutionalDepartmentName = institutional_department_name
213220

214221
# Instance

0 commit comments

Comments
 (0)