medicode / lib /medical_transcription /transcription_supervisor.ex
timgremore's picture
wip: feat: Define show screen for transcriptions
deecaf3
raw
history blame
539 Bytes
defmodule MedicalTranscription.TranscriptionSupervisor do
# Automatically defines child_spec/1
use DynamicSupervisor, restart: :transient
def start_link(init_arg) do
DynamicSupervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
end
@impl true
def init(_init_arg) do
DynamicSupervisor.init(strategy: :one_for_one)
end
def start_transcription(transcription) do
spec = {MedicalTranscription.TranscriptionServer, transcription: transcription}
DynamicSupervisor.start_child(__MODULE__, spec)
end
end