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

Enforce positive series and instance numbers #127

Merged
merged 1 commit into from
Oct 24, 2021
Merged

Conversation

CPBridge
Copy link
Collaborator

As discussed in #125, we are a little uncertain about the requirements on instance numbers. This PR adds checks to enforce that all instance and series numbers are positive integers. This may be somewhat opinionated.

Do you think we should add these checks @hackermd ?

@hackermd
Copy link
Collaborator

The standard does seem to explicitly require these numbers to be positive integers. For example, the Instance Number attribute is described as follows:

A number that identifies this Composite Instance.

The Series Number and Instance Number attributes both have Value Representation Integer String (IS), which is defined as follows:

A string of characters representing an Integer in base-10 (decimal), shall contain only the characters 0 - 9, with an optional leading "+" or "-". It may be padded with leading and/or trailing spaces. Embedded spaces are not allowed.
The integer, n, represented shall be in the range: -231<= n <= (231-1).

However, I think it's a good idea to restrict the number to be a positive integer (at least for creation).

@hackermd hackermd merged commit 934733e into master Oct 24, 2021
@hackermd hackermd deleted the bug/instance_numbers branch October 24, 2021 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants