{-# 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.ICD10CMConcept
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ComprehendMedical.Types.ICD10CMConcept where

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

-- | The ICD-10-CM concepts that the entity could refer to, along with a
-- score indicating the likelihood of the match.
--
-- /See:/ 'newICD10CMConcept' smart constructor.
data ICD10CMConcept = ICD10CMConcept'
  { -- | The level of confidence that Amazon Comprehend Medical has that the
    -- entity is accurately linked to an ICD-10-CM concept.
    ICD10CMConcept -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
    -- | The ICD-10-CM code that identifies the concept found in the knowledge
    -- base from the Centers for Disease Control.
    ICD10CMConcept -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
    -- | The long description of the ICD-10-CM code in the ontology.
    ICD10CMConcept -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ICD10CMConcept -> ICD10CMConcept -> Bool
(ICD10CMConcept -> ICD10CMConcept -> Bool)
-> (ICD10CMConcept -> ICD10CMConcept -> Bool) -> Eq ICD10CMConcept
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ICD10CMConcept -> ICD10CMConcept -> Bool
$c/= :: ICD10CMConcept -> ICD10CMConcept -> Bool
== :: ICD10CMConcept -> ICD10CMConcept -> Bool
$c== :: ICD10CMConcept -> ICD10CMConcept -> Bool
Prelude.Eq, ReadPrec [ICD10CMConcept]
ReadPrec ICD10CMConcept
Int -> ReadS ICD10CMConcept
ReadS [ICD10CMConcept]
(Int -> ReadS ICD10CMConcept)
-> ReadS [ICD10CMConcept]
-> ReadPrec ICD10CMConcept
-> ReadPrec [ICD10CMConcept]
-> Read ICD10CMConcept
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ICD10CMConcept]
$creadListPrec :: ReadPrec [ICD10CMConcept]
readPrec :: ReadPrec ICD10CMConcept
$creadPrec :: ReadPrec ICD10CMConcept
readList :: ReadS [ICD10CMConcept]
$creadList :: ReadS [ICD10CMConcept]
readsPrec :: Int -> ReadS ICD10CMConcept
$creadsPrec :: Int -> ReadS ICD10CMConcept
Prelude.Read, Int -> ICD10CMConcept -> ShowS
[ICD10CMConcept] -> ShowS
ICD10CMConcept -> String
(Int -> ICD10CMConcept -> ShowS)
-> (ICD10CMConcept -> String)
-> ([ICD10CMConcept] -> ShowS)
-> Show ICD10CMConcept
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ICD10CMConcept] -> ShowS
$cshowList :: [ICD10CMConcept] -> ShowS
show :: ICD10CMConcept -> String
$cshow :: ICD10CMConcept -> String
showsPrec :: Int -> ICD10CMConcept -> ShowS
$cshowsPrec :: Int -> ICD10CMConcept -> ShowS
Prelude.Show, (forall x. ICD10CMConcept -> Rep ICD10CMConcept x)
-> (forall x. Rep ICD10CMConcept x -> ICD10CMConcept)
-> Generic ICD10CMConcept
forall x. Rep ICD10CMConcept x -> ICD10CMConcept
forall x. ICD10CMConcept -> Rep ICD10CMConcept x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ICD10CMConcept x -> ICD10CMConcept
$cfrom :: forall x. ICD10CMConcept -> Rep ICD10CMConcept x
Prelude.Generic)

-- |
-- Create a value of 'ICD10CMConcept' 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:
--
-- 'score', 'iCD10CMConcept_score' - The level of confidence that Amazon Comprehend Medical has that the
-- entity is accurately linked to an ICD-10-CM concept.
--
-- 'code', 'iCD10CMConcept_code' - The ICD-10-CM code that identifies the concept found in the knowledge
-- base from the Centers for Disease Control.
--
-- 'description', 'iCD10CMConcept_description' - The long description of the ICD-10-CM code in the ontology.
newICD10CMConcept ::
  ICD10CMConcept
newICD10CMConcept :: ICD10CMConcept
newICD10CMConcept =
  ICD10CMConcept' :: Maybe Double -> Maybe Text -> Maybe Text -> ICD10CMConcept
ICD10CMConcept'
    { $sel:score:ICD10CMConcept' :: Maybe Double
score = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:code:ICD10CMConcept' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ICD10CMConcept' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The level of confidence that Amazon Comprehend Medical has that the
-- entity is accurately linked to an ICD-10-CM concept.
iCD10CMConcept_score :: Lens.Lens' ICD10CMConcept (Prelude.Maybe Prelude.Double)
iCD10CMConcept_score :: (Maybe Double -> f (Maybe Double))
-> ICD10CMConcept -> f ICD10CMConcept
iCD10CMConcept_score = (ICD10CMConcept -> Maybe Double)
-> (ICD10CMConcept -> Maybe Double -> ICD10CMConcept)
-> Lens ICD10CMConcept ICD10CMConcept (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMConcept' {Maybe Double
score :: Maybe Double
$sel:score:ICD10CMConcept' :: ICD10CMConcept -> Maybe Double
score} -> Maybe Double
score) (\s :: ICD10CMConcept
s@ICD10CMConcept' {} Maybe Double
a -> ICD10CMConcept
s {$sel:score:ICD10CMConcept' :: Maybe Double
score = Maybe Double
a} :: ICD10CMConcept)

-- | The ICD-10-CM code that identifies the concept found in the knowledge
-- base from the Centers for Disease Control.
iCD10CMConcept_code :: Lens.Lens' ICD10CMConcept (Prelude.Maybe Prelude.Text)
iCD10CMConcept_code :: (Maybe Text -> f (Maybe Text))
-> ICD10CMConcept -> f ICD10CMConcept
iCD10CMConcept_code = (ICD10CMConcept -> Maybe Text)
-> (ICD10CMConcept -> Maybe Text -> ICD10CMConcept)
-> Lens ICD10CMConcept ICD10CMConcept (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMConcept' {Maybe Text
code :: Maybe Text
$sel:code:ICD10CMConcept' :: ICD10CMConcept -> Maybe Text
code} -> Maybe Text
code) (\s :: ICD10CMConcept
s@ICD10CMConcept' {} Maybe Text
a -> ICD10CMConcept
s {$sel:code:ICD10CMConcept' :: Maybe Text
code = Maybe Text
a} :: ICD10CMConcept)

-- | The long description of the ICD-10-CM code in the ontology.
iCD10CMConcept_description :: Lens.Lens' ICD10CMConcept (Prelude.Maybe Prelude.Text)
iCD10CMConcept_description :: (Maybe Text -> f (Maybe Text))
-> ICD10CMConcept -> f ICD10CMConcept
iCD10CMConcept_description = (ICD10CMConcept -> Maybe Text)
-> (ICD10CMConcept -> Maybe Text -> ICD10CMConcept)
-> Lens ICD10CMConcept ICD10CMConcept (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMConcept' {Maybe Text
description :: Maybe Text
$sel:description:ICD10CMConcept' :: ICD10CMConcept -> Maybe Text
description} -> Maybe Text
description) (\s :: ICD10CMConcept
s@ICD10CMConcept' {} Maybe Text
a -> ICD10CMConcept
s {$sel:description:ICD10CMConcept' :: Maybe Text
description = Maybe Text
a} :: ICD10CMConcept)

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

instance Prelude.Hashable ICD10CMConcept

instance Prelude.NFData ICD10CMConcept