yahl7 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef377a8697c788223e781fce4c91d1885ed32b1e3445f918d2e9cbe2871080ba
4
- data.tar.gz: 3dbb403452617207d14c78f446d4eea3db98dad27c2768bd8918a2ef2125be13
3
+ metadata.gz: d141ebcf963ad65a7423b151dbace65c9c3c10686e3c2a4b1d6e4f0f83437e7c
4
+ data.tar.gz: afcb1e44e825b5eaeb1bf1c5ba873d88787378e8632eb02eeb9b238566205064
5
5
  SHA512:
6
- metadata.gz: 72961481942d814ce6c3719106b4daa74534f68115a1fd2ab5b953f08b1860d2f9d82529183e1924919f7980078c8407f066d3395e7d947782ad2d2c60a30d34
7
- data.tar.gz: 61a0ad074ae8814f61b87e3a890d67ae11fda0b531b4e51d49b58bb24235563e15f6b67d907f25a371dba1bf2d300e15748d7fd98a52cd916d032c61ecceb86d
6
+ metadata.gz: 26dd504e49b914c590f23ab060510b0bbfaac22c08c80f17b95e323af46f61d79c0e1caa810e416b46cc1ff03d0c438006ce33d84712f0c53a2a9829d2f0bd41
7
+ data.tar.gz: 408a1274a45ed3d06f4b14d86e5d4a1deb5d00535b9ccb09c63bed747a790c66aa1cca6e883257af27826040b829946c8b532265649cc6dee5af4dd1ca4a3bdb
data/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.3] - 2021-09-01
9
+
10
+ This version comes with a few bugfixes
11
+
12
+ ### Fixed
13
+
14
+ - The mapping order of MSH fields was incorrect.
15
+ - When `YAHL7::V2::FieldParser` was given a `nil` value, the program could
16
+ crash. This condition should now be resolved.
17
+
8
18
  ## [0.3.2] - 2021-09-01
9
19
 
10
20
  0.3.1 introduced a bug that is fixed in this release.
@@ -19,13 +19,8 @@ module YAHL7
19
19
  private
20
20
 
21
21
  def split_fields(body)
22
- fields = split_body(body, parse_options.field_sep)
23
-
24
- if fields.is_a?(String)
25
- split_components(fields)
26
- else
27
- fields.map { |f| split_components(f) }
28
- end
22
+ parts = split_body(body, parse_options.field_sep)
23
+ parts.is_a?(Array) ? parts.map { |f| split_components(f) } : split_components(parts)
29
24
  end
30
25
 
31
26
  def split_components(body)
@@ -43,6 +38,8 @@ module YAHL7
43
38
  end
44
39
 
45
40
  def split_body(body, separator)
41
+ return '' if body.nil?
42
+
46
43
  got = body.split(separator)
47
44
  got.count < 2 ? body : got
48
45
  end
@@ -10,26 +10,25 @@ module YAHL7
10
10
 
11
11
  define_field_names({
12
12
  field_separator: 1,
13
- encoding_characters: 2,
14
- sending_application: 3,
15
- sending_facility: 4,
16
- receiving_application: 5,
17
- receiving_facility: 6,
18
- message_datetime: { index: 7, class: YAHL7::V2::DataType::TS },
19
- security: 8,
20
- message_type: 9,
21
- message_control_id: 10,
22
- processing_id: 11,
23
- version_id: 12,
24
- sequence_number: 13,
25
- continuation_pointer: 14,
26
- accept_acknowledgement_type: 15,
27
- application_acknowledgement_type: 16,
28
- country_code: 17,
29
- character_set: 18,
30
- principal_language: 19,
31
- alternate_character_set_handling_scheme: 20,
32
- message_profile_identifier: 21
13
+ sending_application: 2,
14
+ sending_facility: 3,
15
+ receiving_application: 4,
16
+ receiving_facility: 5,
17
+ message_datetime: { index: 6, class: YAHL7::V2::DataType::TS },
18
+ security: 7,
19
+ message_type: 8,
20
+ message_control_id: 9,
21
+ processing_id: 10,
22
+ version_id: 11,
23
+ sequence_number: 12,
24
+ continuation_pointer: 13,
25
+ accept_acknowledgement_type: 14,
26
+ application_acknowledgement_type: 15,
27
+ country_code: 16,
28
+ character_set: 17,
29
+ principal_language: 18,
30
+ alternate_character_set_handling_scheme: 19,
31
+ message_profile_identifier: 20
33
32
  })
34
33
  end
35
34
  end
data/lib/yahl7/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YAHL7
4
- VERSION = '0.3.2'
4
+ VERSION = '0.3.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahl7
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mylan Connolly