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 HL7 struct storing HL7 data as nested maps #27

Merged
merged 78 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
c167505
init
DarkMarmot Sep 22, 2023
4acd95f
map specific test
DarkMarmot Sep 22, 2023
b401bd6
map specific test2
DarkMarmot Sep 22, 2023
6783f85
wip
DarkMarmot Mar 21, 2024
eb14257
parsing happy
DarkMarmot Mar 21, 2024
9f5a753
fixes
DarkMarmot Mar 21, 2024
f366170
add label
DarkMarmot Mar 22, 2024
f6f55ad
fmt
DarkMarmot Mar 22, 2024
2fe7e40
rm warning
DarkMarmot Mar 22, 2024
60a6cf1
denser maps
DarkMarmot Mar 22, 2024
2f05871
tests
DarkMarmot Mar 22, 2024
e449f59
fmt
DarkMarmot Mar 22, 2024
dab74fa
more tests
DarkMarmot Mar 22, 2024
3096bda
hpath tests
DarkMarmot Mar 22, 2024
292a171
more test
DarkMarmot Mar 22, 2024
a541949
benchmark updates
DarkMarmot Mar 22, 2024
a2cc45f
cleanup
DarkMarmot Mar 22, 2024
3ca81c0
docs
DarkMarmot Mar 23, 2024
a721501
more test
DarkMarmot Mar 24, 2024
76af130
another test
DarkMarmot Mar 24, 2024
ebbee98
stream
DarkMarmot Mar 25, 2024
6263f2d
parser fixes
DarkMarmot Mar 25, 2024
48d1212
HP sigil and fixes
DarkMarmot Mar 25, 2024
1253c41
fmt
DarkMarmot Mar 25, 2024
4f573dd
rm extra app
DarkMarmot Mar 25, 2024
59da774
fix dialyzer change
DarkMarmot Mar 25, 2024
a6fb3a3
workflow
DarkMarmot Mar 25, 2024
a067cd3
refactor to find_in_segment only
DarkMarmot Mar 25, 2024
8737e01
fmt
DarkMarmot Mar 26, 2024
6e2d075
rm comment
DarkMarmot Mar 26, 2024
adfc497
rm precision
DarkMarmot Mar 26, 2024
7c5a97b
add manual hpath constructor, still need test
DarkMarmot Mar 26, 2024
996b42b
added hpath new test
DarkMarmot Mar 26, 2024
e55dd6a
rm export metadata from parser
DarkMarmot Mar 26, 2024
effe713
sigil p backwards compat
DarkMarmot Mar 27, 2024
7744c85
cleanup
DarkMarmot Mar 27, 2024
6d5a1f6
moving to hl7 main
DarkMarmot Mar 30, 2024
af47386
working put
DarkMarmot Apr 2, 2024
2a77052
dialyzer fixes
DarkMarmot Apr 3, 2024
2d64686
put and update work
DarkMarmot Apr 3, 2024
abb5111
fmt
DarkMarmot Apr 3, 2024
69033f4
unified update with put
DarkMarmot Apr 3, 2024
a17ec86
update tests
DarkMarmot Apr 3, 2024
720256b
fmt
DarkMarmot Apr 3, 2024
bb7c1a6
fmt
DarkMarmot Apr 3, 2024
b79deb7
normalizes map input data to add max index info
DarkMarmot Apr 3, 2024
23f61d7
__max_index__ internal only
DarkMarmot Apr 4, 2024
54d762f
moved sigils to HL7 module and changed parse to new
DarkMarmot Apr 6, 2024
53592d4
added sigil inspect impl
DarkMarmot Apr 7, 2024
2613864
extra raises
DarkMarmot Apr 7, 2024
a1f0fa6
more tests
DarkMarmot Apr 9, 2024
098aa5e
nil fix
DarkMarmot Apr 9, 2024
7f2404f
more docs
DarkMarmot Apr 9, 2024
d327536
more test fixing
DarkMarmot Apr 9, 2024
ab08f4b
type stuff
DarkMarmot Apr 9, 2024
7ff97da
readme
DarkMarmot Apr 9, 2024
3cbc99f
rm dead code
DarkMarmot Apr 9, 2024
47eff93
version
DarkMarmot Apr 9, 2024
5a956c4
more tests
DarkMarmot Apr 14, 2024
829a62e
fmt
DarkMarmot Apr 15, 2024
632d877
versions
DarkMarmot Apr 15, 2024
92ec2b8
raise on put to missing segment
DarkMarmot Apr 15, 2024
c78a045
clean path
DarkMarmot Apr 15, 2024
4074b29
fmt
DarkMarmot Apr 15, 2024
0261b78
readme
DarkMarmot Apr 15, 2024
cbc8411
leave old code alone
DarkMarmot Apr 15, 2024
8009ef9
less old code changes
DarkMarmot Apr 15, 2024
43a5e36
less
DarkMarmot Apr 15, 2024
fd4e528
fmt
DarkMarmot Apr 15, 2024
9f33ae9
fmt
DarkMarmot Apr 15, 2024
fd07fa1
warning issue
DarkMarmot Apr 15, 2024
e672890
wiki
DarkMarmot Apr 15, 2024
0148a8a
undoc
DarkMarmot Apr 15, 2024
9520593
one test
DarkMarmot Apr 15, 2024
8b77ae7
fmt
DarkMarmot Apr 15, 2024
57ff8c0
fmt
DarkMarmot Apr 15, 2024
d3feec1
fmt
DarkMarmot Apr 15, 2024
c2a8bc3
yaml back
DarkMarmot Apr 15, 2024
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
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
[![hex.pm downloads](https://img.shields.io/hexpm/dt/elixir_hl7.svg)](https://hex.pm/packages/elixir_hl7)
[![hex.pm license](https://img.shields.io/hexpm/l/elixir_hl7.svg)](https://hex.pm/packages/elixir_hl7)

Note: We are now building a simpler and more Elixir-friendly API for this library, centered on
the `HL7` and `HL7.Path` modules. These will hopefully lead to the deprecation of
`HL7.Query` and much of the related code. These will likely not be removed for some time, and their
removal will coincide with a major version release. For now, the two systems can exchange data when needed.

An Elixir library for working with HL7 v2.x healthcare data

Elixir HL7 provides functions to parse, query and modify healthcare data that conforms to the HL7 v2.x standards.
Expand All @@ -26,13 +31,12 @@ Add this library to your mix.exs file:

```elixir
defp deps do
[{:elixir_hl7, "~> 0.6.4"}]
[{:elixir_hl7, "~> 0.9.0"}]
end
```

Check out the `HL7.Examples` module for sample data that you can use to explore the API.


## Route

HL7 messages can be minimally validated to gather header (MSH segment) information for quick routing and acknowledgements.
Expand Down Expand Up @@ -182,9 +186,7 @@ Also, please be aware of the details of the license (Apache 2.0).

# Roadmap

1) Planning to add a loose selector like `OBX*` to basically split on a segment type, to create groups beginning a specific segment name.
2) Working to release a complementary MLLP library
3) Building a sister library to handle FHIR messages
Extending the `HL7` base namespace to provide a simpler and more powerful API.

# License

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.1
0.9.0
19 changes: 10 additions & 9 deletions benchmark.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ alias HL7.Examples

msg = Examples.wikipedia_sample_hl7()
alt = Examples.wikipedia_sample_hl7_alt_delimiters()
list = msg |> Message.to_list()

list = Examples.wikipedia_sample_hl7() |> HL7.Message.to_list() |> List.flatten() |> Enum.take(10)
Benchee.run(%{
"raw" => fn -> msg |> Message.raw() end,
"new" => fn -> msg |> Message.new(%{accept_latin1: true}) end,
"maps" => fn -> msg |> HL7.Maps.new() end,
"new" => fn -> msg |> Message.new() end,
"new-copy" => fn -> msg |> Message.new(%{copy: true}) end,
"new-alt" => fn -> alt |> Message.new() end,
"round-trip" => fn -> msg |> Message.new() |> to_string() end
Expand Down Expand Up @@ -56,11 +57,11 @@ Benchee.run(%{
# round-trip 20.40 K 49.02 μs ±20.06% 46.53 μs 86.84 μs
# new-alt 15.64 K 63.95 μs ±14.60% 61.53 μs 104.48 μs

# with latin1 conversion

# raw 75.87 K 13.18 μs ±113.53% 12.36 μs 24.25 μs
# new 51.93 K 19.26 μs ±28.73% 17.37 μs 38.47 μs
# new-copy 47.77 K 20.93 μs ±29.84% 19.21 μs 39.15 μs
# round-trip 20.32 K 49.21 μs ±18.52% 47.62 μs 80.37 μs
# new-alt 15.50 K 64.53 μs ±12.32% 62.72 μs 97.16 μs
# add Maps output for use with the new HPath sigil

# raw 137.72 K
# new 43.00 K - 3.20x slower +15.99 μs
# new-copy 38.38 K - 3.59x slower +18.80 μs
# maps 32.75 K - 4.21x slower +23.27 μs
DarkMarmot marked this conversation as resolved.
Show resolved Hide resolved
# round-trip 22.61 K - 6.09x slower +36.96 μs
# new-alt 16.78 K - 8.21x slower +52.32 μs
Loading
Loading