Commit ·
3a2c92b
1
Parent(s): 41e8fed
fix: Satisfy Credo warnings
Browse files
lib/medical_transcription_web/components/transcription_text_component.ex
CHANGED
|
@@ -4,16 +4,10 @@ defmodule MedicalTranscriptionWeb.Components.TranscriptionTextComponent do
|
|
| 4 |
"""
|
| 5 |
use MedicalTranscriptionWeb, :live_component
|
| 6 |
|
| 7 |
-
import Ecto.Query
|
| 8 |
import MedicalTranscriptionWeb.Components
|
| 9 |
import MedicalTranscriptionWeb.Components.KeywordHighlighter
|
| 10 |
|
| 11 |
-
alias AudioTagger.KeywordFinder
|
| 12 |
-
alias MedicalTranscription.Coding
|
| 13 |
-
alias MedicalTranscription.Coding.CodeVectorMatch
|
| 14 |
-
alias MedicalTranscription.Repo
|
| 15 |
alias MedicalTranscription.Transcriptions
|
| 16 |
-
alias MedicalTranscription.Transcriptions.TranscriptionChunk
|
| 17 |
alias MedicalTranscriptionWeb.Components.CodeSelect
|
| 18 |
|
| 19 |
@impl Phoenix.LiveComponent
|
|
@@ -80,8 +74,6 @@ defmodule MedicalTranscriptionWeb.Components.TranscriptionTextComponent do
|
|
| 80 |
|
| 81 |
@impl Phoenix.LiveComponent
|
| 82 |
def handle_event("reclassify_transcription", %{"value" => new_chunk_text} = _params, socket) do
|
| 83 |
-
self_pid = self()
|
| 84 |
-
|
| 85 |
{:ok, chunk} =
|
| 86 |
Transcriptions.update_transcription_chunk(socket.assigns.chunk, %{text: new_chunk_text})
|
| 87 |
|
|
@@ -90,20 +82,20 @@ defmodule MedicalTranscriptionWeb.Components.TranscriptionTextComponent do
|
|
| 90 |
{:noreply, assign(socket, :chunk, chunk)}
|
| 91 |
end
|
| 92 |
|
| 93 |
-
@impl Phoenix.LiveComponent
|
| 94 |
-
def handle_info({:chunk_updated, chunk_id}, socket) do
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
end
|
| 99 |
-
|
| 100 |
-
def handle_info({:classification_started, _chunk_id}, socket) do
|
| 101 |
-
|
| 102 |
-
end
|
| 103 |
-
|
| 104 |
-
def handle_info({:classification_finished, _chunk_id}, socket) do
|
| 105 |
-
|
| 106 |
-
end
|
| 107 |
|
| 108 |
defp get_transcription_chunk(id) do
|
| 109 |
Transcriptions.get_transcription_chunk!(id, true)
|
|
|
|
| 4 |
"""
|
| 5 |
use MedicalTranscriptionWeb, :live_component
|
| 6 |
|
|
|
|
| 7 |
import MedicalTranscriptionWeb.Components
|
| 8 |
import MedicalTranscriptionWeb.Components.KeywordHighlighter
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
alias MedicalTranscription.Transcriptions
|
|
|
|
| 11 |
alias MedicalTranscriptionWeb.Components.CodeSelect
|
| 12 |
|
| 13 |
@impl Phoenix.LiveComponent
|
|
|
|
| 74 |
|
| 75 |
@impl Phoenix.LiveComponent
|
| 76 |
def handle_event("reclassify_transcription", %{"value" => new_chunk_text} = _params, socket) do
|
|
|
|
|
|
|
| 77 |
{:ok, chunk} =
|
| 78 |
Transcriptions.update_transcription_chunk(socket.assigns.chunk, %{text: new_chunk_text})
|
| 79 |
|
|
|
|
| 82 |
{:noreply, assign(socket, :chunk, chunk)}
|
| 83 |
end
|
| 84 |
|
| 85 |
+
# @impl Phoenix.LiveComponent
|
| 86 |
+
# def handle_info({:chunk_updated, chunk_id}, socket) do
|
| 87 |
+
# chunk = get_transcription_chunk(chunk_id)
|
| 88 |
+
#
|
| 89 |
+
# {:noreply, stream_insert(socket, :chunks, chunk)}
|
| 90 |
+
# end
|
| 91 |
+
#
|
| 92 |
+
# def handle_info({:classification_started, _chunk_id}, socket) do
|
| 93 |
+
# {:noreply, assign(socket, :classification_status, :started)}
|
| 94 |
+
# end
|
| 95 |
+
#
|
| 96 |
+
# def handle_info({:classification_finished, _chunk_id}, socket) do
|
| 97 |
+
# {:noreply, assign(socket, :classification_status, :finished)}
|
| 98 |
+
# end
|
| 99 |
|
| 100 |
defp get_transcription_chunk(id) do
|
| 101 |
Transcriptions.get_transcription_chunk!(id, true)
|
lib/medical_transcription_web/live/transcriptions_live/show.ex
CHANGED
|
@@ -2,7 +2,6 @@ defmodule MedicalTranscriptionWeb.TranscriptionsLive.Show do
|
|
| 2 |
use MedicalTranscriptionWeb, :live_view
|
| 3 |
|
| 4 |
alias MedicalTranscription.Audio.RecordingPipeline
|
| 5 |
-
alias MedicalTranscription.Repo
|
| 6 |
alias MedicalTranscription.Transcriptions
|
| 7 |
|
| 8 |
alias MedicalTranscriptionWeb.Components.TranscriptionTextComponent
|
|
|
|
| 2 |
use MedicalTranscriptionWeb, :live_view
|
| 3 |
|
| 4 |
alias MedicalTranscription.Audio.RecordingPipeline
|
|
|
|
| 5 |
alias MedicalTranscription.Transcriptions
|
| 6 |
|
| 7 |
alias MedicalTranscriptionWeb.Components.TranscriptionTextComponent
|
test/support/fixtures/code_vectors_fixtures.ex
CHANGED
|
@@ -4,8 +4,6 @@ defmodule MedicalTranscription.CodeVectorsFixtures do
|
|
| 4 |
entities via the `MedicalTranscription.Coding` context.
|
| 5 |
"""
|
| 6 |
|
| 7 |
-
import Ecto.Query
|
| 8 |
-
|
| 9 |
@doc """
|
| 10 |
Insert code vectors from cached csv file.
|
| 11 |
"""
|
|
|
|
| 4 |
entities via the `MedicalTranscription.Coding` context.
|
| 5 |
"""
|
| 6 |
|
|
|
|
|
|
|
| 7 |
@doc """
|
| 8 |
Insert code vectors from cached csv file.
|
| 9 |
"""
|