NYSETL.Engines.E2.Processor (nys_etl v0.1.0) View Source

For a TestResult record, decide the following

  • Find or create a Person record, based on :patient_key or unique (dob/last_name/first_name)
  • Create or update one more IndexCase records for this county
  • Create or update a LabResult record for the IndexCase

Edge cases

  • Pre-existing data in CommCare may not be well deduplicated for people. If we have deduped a person, but there are multiple IndexCase records for that person in this county, creation of new LabResult records is duplicated across all IndexCase records.

Link to this section Summary

Link to this section Functions

Link to this function

compact_join(list, joiner)

View Source

Specs

diff(map(), map(), keyword()) :: {map(), map()}

Returns a tuple where the first element is a map of additions and the second element is a map of updated values.

Examples

iex> a = %{a: 1, b: 2, z: 26}
iex> b = %{a: 1, b: 3, y: 25}
iex> diff(a, b)
{%{y: 25}, %{b: 3}}
Link to this function

process( test_result, ignore_before \\ Application.get_env(:nys_etl, :eclrs_ignore_before_timestamp) )

View Source
Link to this function

repeat_type(index_case, test_result)

View Source
Link to this function

to_index_case_data(test_result, person, commcare_county, reinfection_cases \\ [])

View Source
Link to this function

to_index_case_data_address_block(test_result)

View Source
Link to this function

to_index_case_data_county_block(commcare_county)

View Source
Link to this function

to_index_case_data_person_block(test_result, external_id)

View Source
Link to this function

to_index_case_data_rest(test_result)

View Source
Link to this function

to_lab_result_data(index_case, tr, commcare_county)

View Source
Link to this function

with_index_case_data_complete_fields(data)

View Source