defmodule Medicode.Transcriptions.TranscriptionChunkKeyword do | |
use Ecto.Schema | |
import Ecto.Changeset | |
@primary_key {:id, :binary_id, autogenerate: true} | |
@foreign_key_type :binary_id | |
schema "transcription_chunk_keywords" do | |
field :keyword, :string | |
field :score, :float | |
belongs_to :transcription_chunk, Medicode.Transcriptions.TranscriptionChunk | |
timestamps(type: :utc_datetime) | |
end | |
@doc false | |
def changeset(transcription_chunk_keyword, attrs) do | |
transcription_chunk_keyword | |
|> cast(attrs, [:transcription_chunk_id, :keyword, :score]) | |
|> validate_required([:transcription_chunk_id, :keyword, :score]) | |
end | |
end | |