HCA-Healthcare / elixir-hl7

An Elixir library for working with HL7 v2.x healthcare data
Apache License 2.0
110 stars 22 forks source link

Spec is wrong for Query.select #61

Open cdegroot opened 1 month ago

cdegroot commented 1 month ago
  @spec select(content_or_query_hl7(), binary()) :: HL7.Query.t()
  def select(msg, segment_selector)
      when is_list(msg) and (is_binary(segment_selector) or is_function(segment_selector)) do
    HL7.Query.new(msg) |> perform_select(segment_selector)
  end

Clearly, segment_selector can be more than a binary. The reason I'm filing an issue and not a PR straight away is that I have a bit of deja vu here but I can't find an earlier fix. So either we're the first to pass in functions here and use Dialyzer, or I'm missing something.

If not missing something, happy to provide a quick PR :)

starbelly commented 1 month ago

@cdegroot Hi 🤗 A PR would be greatly appreciated.