{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ComprehendMedical.Types.SNOMEDCTConcept
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ComprehendMedical.Types.SNOMEDCTConcept where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The SNOMED-CT concepts that the entity could refer to, along with a
-- score indicating the likelihood of the match.
--
-- /See:/ 'newSNOMEDCTConcept' smart constructor.
data SNOMEDCTConcept = SNOMEDCTConcept'
  { -- | The numeric ID for the SNOMED-CT concept.
    SNOMEDCTConcept -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
    -- | The description of the SNOMED-CT concept.
    SNOMEDCTConcept -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The level of confidence Comprehend Medical has that the entity should be
    -- linked to the identified SNOMED-CT concept.
    SNOMEDCTConcept -> Maybe Double
score :: Prelude.Maybe Prelude.Double
  }
  deriving (SNOMEDCTConcept -> SNOMEDCTConcept -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SNOMEDCTConcept -> SNOMEDCTConcept -> Bool
$c/= :: SNOMEDCTConcept -> SNOMEDCTConcept -> Bool
== :: SNOMEDCTConcept -> SNOMEDCTConcept -> Bool
$c== :: SNOMEDCTConcept -> SNOMEDCTConcept -> Bool
Prelude.Eq, ReadPrec [SNOMEDCTConcept]
ReadPrec SNOMEDCTConcept
Int -> ReadS SNOMEDCTConcept
ReadS [SNOMEDCTConcept]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SNOMEDCTConcept]
$creadListPrec :: ReadPrec [SNOMEDCTConcept]
readPrec :: ReadPrec SNOMEDCTConcept
$creadPrec :: ReadPrec SNOMEDCTConcept
readList :: ReadS [SNOMEDCTConcept]
$creadList :: ReadS [SNOMEDCTConcept]
readsPrec :: Int -> ReadS SNOMEDCTConcept
$creadsPrec :: Int -> ReadS SNOMEDCTConcept
Prelude.Read, Int -> SNOMEDCTConcept -> ShowS
[SNOMEDCTConcept] -> ShowS
SNOMEDCTConcept -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SNOMEDCTConcept] -> ShowS
$cshowList :: [SNOMEDCTConcept] -> ShowS
show :: SNOMEDCTConcept -> String
$cshow :: SNOMEDCTConcept -> String
showsPrec :: Int -> SNOMEDCTConcept -> ShowS
$cshowsPrec :: Int -> SNOMEDCTConcept -> ShowS
Prelude.Show, forall x. Rep SNOMEDCTConcept x -> SNOMEDCTConcept
forall x. SNOMEDCTConcept -> Rep SNOMEDCTConcept x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SNOMEDCTConcept x -> SNOMEDCTConcept
$cfrom :: forall x. SNOMEDCTConcept -> Rep SNOMEDCTConcept x
Prelude.Generic)

-- |
-- Create a value of 'SNOMEDCTConcept' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'code', 'sNOMEDCTConcept_code' - The numeric ID for the SNOMED-CT concept.
--
-- 'description', 'sNOMEDCTConcept_description' - The description of the SNOMED-CT concept.
--
-- 'score', 'sNOMEDCTConcept_score' - The level of confidence Comprehend Medical has that the entity should be
-- linked to the identified SNOMED-CT concept.
newSNOMEDCTConcept ::
  SNOMEDCTConcept
newSNOMEDCTConcept :: SNOMEDCTConcept
newSNOMEDCTConcept =
  SNOMEDCTConcept'
    { $sel:code:SNOMEDCTConcept' :: Maybe Text
code = forall a. Maybe a
Prelude.Nothing,
      $sel:description:SNOMEDCTConcept' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:score:SNOMEDCTConcept' :: Maybe Double
score = forall a. Maybe a
Prelude.Nothing
    }

-- | The numeric ID for the SNOMED-CT concept.
sNOMEDCTConcept_code :: Lens.Lens' SNOMEDCTConcept (Prelude.Maybe Prelude.Text)
sNOMEDCTConcept_code :: Lens' SNOMEDCTConcept (Maybe Text)
sNOMEDCTConcept_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTConcept' {Maybe Text
code :: Maybe Text
$sel:code:SNOMEDCTConcept' :: SNOMEDCTConcept -> Maybe Text
code} -> Maybe Text
code) (\s :: SNOMEDCTConcept
s@SNOMEDCTConcept' {} Maybe Text
a -> SNOMEDCTConcept
s {$sel:code:SNOMEDCTConcept' :: Maybe Text
code = Maybe Text
a} :: SNOMEDCTConcept)

-- | The description of the SNOMED-CT concept.
sNOMEDCTConcept_description :: Lens.Lens' SNOMEDCTConcept (Prelude.Maybe Prelude.Text)
sNOMEDCTConcept_description :: Lens' SNOMEDCTConcept (Maybe Text)
sNOMEDCTConcept_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTConcept' {Maybe Text
description :: Maybe Text
$sel:description:SNOMEDCTConcept' :: SNOMEDCTConcept -> Maybe Text
description} -> Maybe Text
description) (\s :: SNOMEDCTConcept
s@SNOMEDCTConcept' {} Maybe Text
a -> SNOMEDCTConcept
s {$sel:description:SNOMEDCTConcept' :: Maybe Text
description = Maybe Text
a} :: SNOMEDCTConcept)

-- | The level of confidence Comprehend Medical has that the entity should be
-- linked to the identified SNOMED-CT concept.
sNOMEDCTConcept_score :: Lens.Lens' SNOMEDCTConcept (Prelude.Maybe Prelude.Double)
sNOMEDCTConcept_score :: Lens' SNOMEDCTConcept (Maybe Double)
sNOMEDCTConcept_score = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTConcept' {Maybe Double
score :: Maybe Double
$sel:score:SNOMEDCTConcept' :: SNOMEDCTConcept -> Maybe Double
score} -> Maybe Double
score) (\s :: SNOMEDCTConcept
s@SNOMEDCTConcept' {} Maybe Double
a -> SNOMEDCTConcept
s {$sel:score:SNOMEDCTConcept' :: Maybe Double
score = Maybe Double
a} :: SNOMEDCTConcept)

instance Data.FromJSON SNOMEDCTConcept where
  parseJSON :: Value -> Parser SNOMEDCTConcept
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SNOMEDCTConcept"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Double -> SNOMEDCTConcept
SNOMEDCTConcept'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Code")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Score")
      )

instance Prelude.Hashable SNOMEDCTConcept where
  hashWithSalt :: Int -> SNOMEDCTConcept -> Int
hashWithSalt Int
_salt SNOMEDCTConcept' {Maybe Double
Maybe Text
score :: Maybe Double
description :: Maybe Text
code :: Maybe Text
$sel:score:SNOMEDCTConcept' :: SNOMEDCTConcept -> Maybe Double
$sel:description:SNOMEDCTConcept' :: SNOMEDCTConcept -> Maybe Text
$sel:code:SNOMEDCTConcept' :: SNOMEDCTConcept -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
code
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
score

instance Prelude.NFData SNOMEDCTConcept where
  rnf :: SNOMEDCTConcept -> ()
rnf SNOMEDCTConcept' {Maybe Double
Maybe Text
score :: Maybe Double
description :: Maybe Text
code :: Maybe Text
$sel:score:SNOMEDCTConcept' :: SNOMEDCTConcept -> Maybe Double
$sel:description:SNOMEDCTConcept' :: SNOMEDCTConcept -> Maybe Text
$sel:code:SNOMEDCTConcept' :: SNOMEDCTConcept -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
code
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
score