def call(
once: nil,
number: nil,
organisations: nil,
workgroups: nil,
cohort_imports: false,
class_imports: false,
immunisation_imports: false
)
MavisCLI.load_rails
types =
determine_import_types(
cohort_imports:,
class_imports:,
immunisation_imports:
)
once = true unless $stdin.tty?
if once
number ||= 10
print_imports(imports(number:, organisations:, workgroups:, types:))
return
end
loop do
lines = number
lines ||= MavisCLI.terminal_lines
next_imports =
imports(number: lines - 5, organisations:, workgroups:, types:)
$stdout.clear_screen
puts Time.current
print_imports(next_imports)
sleep 30 or break
end
end