hca-healthcare / elixir-hl7 Goto Github PK
View Code? Open in Web Editor NEWAn Elixir library for working with HL7 v2.x healthcare data
License: Apache License 2.0
An Elixir library for working with HL7 v2.x healthcare data
License: Apache License 2.0
The typing has pos_integer
, but in reality we allow 0
for the field.
Since HL7 is 1
based I don't know if we should change the code to be 1 based or if the typing should be updated.
looks like Bryan had to go all anarchist on the naming conventions.... need some kind of enforcement agency or something to keep things like this from happening.
HL7.Query.number_set_ids puts a Number in the MSH-1 Field, I would only expect it to number the remaining Fields.
Currently it return %Hl7.Message{} or blows up. Type specs would be nice too. Specs in a consuming app caught the goof.
If the library is capable of doing encoding?, an example and/or test for encoding a message starting from a filled in struct (like MSH) would be very helpful.
I'm not sure if this is the right place to report this, but since I don't know much about macros and the HL7.Query changes seem to have triggered this, I'll report it here first.
For example, if we do a query on a non-existent TXA-16 field and check if the result is nil, dialyzer scolds us that a binary cannot be nil, while at runtime nil is returned.
defmodule Test do
require HL7.Query
import HL7.Query, only: [sigil_g: 2]
# Will return :was_nil
def test do
msg = HL7.Query.new(HL7.Examples.wikipedia_sample_hl7())
part = HL7.Query.get_part(msg, ~g"TXA-16")
if is_nil(part) do
:was_nil
else
:not_nil
end
end
end
Dialyzer Output:
lib/test.ex:11:exact_eq
The test binary() == nil can never evaluate to 'true'.
``
The latest tag that I see on https://github.com/HCA-Healthcare/elixir-hl7/tags is 0.6.3
The current version in https://hex.pm/packages/elixir_hl7/versions is 0.8.0
Could you please add the missing tags for each of the versions so that I can compare the diffs between each version that got released?
There's a lot of info in the readme about parsing HL7 messages, but I'm trying to create them and I don't see a straightforward way to add segments to a message. A new message can be created with raw input, or with a header, but how do you add segments?
iex(2)> hl7_text = HL7.Examples.wikipedia_sample_hl7() gives me this error , any reason why
also tried running HL7.Examples.wikipedia_sample_hl7()
(UndefinedFunctionError) function HL7.Examples.wikipedia_sample_hl7/0 is undefined (module HL7.Examples is not available)
HL7.Examples.wikipedia_sample_hl7()
Would it be possible to implement the Enumerable Protocol for the HL7.Query Struct, so that Enum.map and HL7.Query.map would be equivalent?
HL7.get/2
can return a list of hl7_map_data()
when selecting multiple segments, but this is currently missing from the function's typespec.
Example:
import HL7
HL7.Examples.wikipedia_sample_hl7()
|> HL7.new!()
|> HL7.get(~p"OBX[*]")
returns
[
%{
0 => "OBX",
1 => "1",
2 => %{1 => %{1 => "N", 2 => %{1 => "K", 2 => "M"}}},
3 => %{1 => %{2 => "Body Height"}},
5 => "1.80",
6 => %{1 => %{1 => "m", 2 => "Meter", 3 => "ISO+"}},
11 => "F"
},
%{
0 => "OBX",
1 => "2",
2 => "NM",
3 => %{1 => %{2 => "Body Weight"}},
5 => "79",
6 => %{1 => %{1 => "kg", 2 => "Kilogram", 3 => "ISO+"}},
11 => "F"
}
]
hl7
|> HL7.Query.replace_parts("MSH-9.3", nil)
|> HL7.Query.to_message()
Is valid and removed the part, but the types don't line up and there is no test. I think this is valid and we should document the support.
Since the types don't line up if people are using dialyzer they get warnings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.