Skip to content

Conversation

@diazruy
Copy link

@diazruy diazruy commented Sep 26, 2022

Breaking change.

When a field (other than MSH.2, encoding characters) contains the repetition delimiter (~), the field accessor now returns an Array with each value in the repetition. E.g.

pid = HL7::Message::Segment::PID.new('PID|||123~456')
pid.patient_id_list # => ['123', '456']

When an Array is assigned to a field, the values are concatenated with the repetition delimiter when converting back to String/HL7

Values assigned to fields are no longer immediately cast into Strings, allowing you to append more values to a repetition. E.g.

pid = HL7::Message::Segment::PID.new
pid.patient_id_list = ['123', '456']
pid.patient_id_list << '789'
pid.to_s # => 'PID|||123~456~789'

Breaking change.

When a field (other than MSH.2, encoding characters) contains the repetition delimiter, the field accessor now returns an Array with each value in the repetition (e.g. `PID|||123~456`, PID.3 returns `['123', '456']`)

When an Array is assigned to a field, the values are concatenated with the repetition delimiter when converting back to String/HL7

Values assigned to fields are no longer immediately cast into Strings, allowing you to append more values to a repetition. E.g.

```
pid = HL7::Message::Segment::PID.new
pid.patient_id_list = ['123', '456']
pid.patient_id_list << '789'
pid.to_s # => 'PID|||123~456~789'
```
@diazruy
Copy link
Author

diazruy commented Sep 26, 2022

Pull request against official gem here

@diazruy diazruy merged commit 542ab4e into master Sep 27, 2022
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.

3 participants