noahsettersten commited on
Commit
62f95d4
1 Parent(s): 410cb59

docs: `transcription_text_component` doc and story

Browse files
lib/medical_transcription_web/components/transcription_text_component.ex CHANGED
@@ -2,7 +2,7 @@ defmodule MedicalTranscriptionWeb.Components.TranscriptionTextComponent do
2
  @moduledoc """
3
  Represents a portion of transcribed text.
4
 
5
- Once rendered, starts tasks to find relevant codes and keywords for the text.
6
  """
7
  alias MedicalTranscriptionWeb.Components.CodeSelect
8
  use MedicalTranscriptionWeb, :live_component
 
2
  @moduledoc """
3
  Represents a portion of transcribed text.
4
 
5
+ Once the initial text is rendered, thie component starts async tasks to find relevant codes and keywords for the text.
6
  """
7
  alias MedicalTranscriptionWeb.Components.CodeSelect
8
  use MedicalTranscriptionWeb, :live_component
storybook/components/transcription_text_component.story.exs ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ defmodule MedicalTranscriptionWeb.Storybook.TranscriptionTextComponent do
2
+ use PhoenixStorybook.Story, :live_component
3
+ alias MedicalTranscription.Coding.CodeVectorMatch
4
+
5
+ def component, do: MedicalTranscriptionWeb.Components.TranscriptionTextComponent
6
+
7
+ def variations do
8
+ # Instead of allowing the TranscriptionTextComponent to run the model and generate results, we may want to pass a
9
+ # list of tags into the component:
10
+ # tags = [
11
+ # %CodeVectorMatch{
12
+ # id: 1,
13
+ # code: "74685",
14
+ # description: "Coronary artery anomaly",
15
+ # cosine_similarity: 1.07,
16
+ # weighting: [:positive, :positive]
17
+ # },
18
+ # %CodeVectorMatch{
19
+ # id: 1,
20
+ # code: "41412",
21
+ # description: "Dissection of coronary artery",
22
+ # cosine_similarity: 0.87,
23
+ # weighting: [:positive, :negative]
24
+ # },
25
+ # %CodeVectorMatch{
26
+ # id: 1,
27
+ # code: "V717",
28
+ # description: "Observation for suspected cardiovascular disease",
29
+ # cosine_similarity: 0.84,
30
+ # weighting: [:none]
31
+ # },
32
+ # %CodeVectorMatch{
33
+ # id: 1,
34
+ # code: "V812",
35
+ # description: "Screening for other and unspecified cardiovascular conditions",
36
+ # cosine_similarity: 0.84,
37
+ # weighting: [:none]
38
+ # }
39
+ # ]
40
+
41
+ [
42
+ %Variation{
43
+ id: :default,
44
+ attributes: %{
45
+ id: 1,
46
+ start_mark: "00:00:00",
47
+ end_mark: "00:00:07",
48
+ text:
49
+ "This 55-year-old man with known coronary artery disease comes for a follow-up visit today. "
50
+ }
51
+ }
52
+ ]
53
+ end
54
+ end