{-# 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.ICD10CMEntity
-- 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.ICD10CMEntity where

import Amazonka.ComprehendMedical.Types.ICD10CMAttribute
import Amazonka.ComprehendMedical.Types.ICD10CMConcept
import Amazonka.ComprehendMedical.Types.ICD10CMEntityCategory
import Amazonka.ComprehendMedical.Types.ICD10CMEntityType
import Amazonka.ComprehendMedical.Types.ICD10CMTrait
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The collection of medical entities extracted from the input text and
-- their associated information. For each entity, the response provides the
-- entity text, the entity category, where the entity text begins and ends,
-- and the level of confidence that Amazon Comprehend Medical has in the
-- detection and analysis. Attributes and traits of the entity are also
-- returned.
--
-- /See:/ 'newICD10CMEntity' smart constructor.
data ICD10CMEntity = ICD10CMEntity'
  { -- | The ICD-10-CM concepts that the entity could refer to, along with a
    -- score indicating the likelihood of the match.
    ICD10CMEntity -> Maybe [ICD10CMConcept]
iCD10CMConcepts :: Prelude.Maybe [ICD10CMConcept],
    -- | The 0-based character offset in the input text that shows where the
    -- entity begins. The offset returns the UTF-8 code point in the string.
    ICD10CMEntity -> Maybe Int
beginOffset :: Prelude.Maybe Prelude.Int,
    -- | The segment of input text that is matched to the detected entity.
    ICD10CMEntity -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
    -- | The category of the entity. InferICD10CM detects entities in the
    -- @MEDICAL_CONDITION@ category.
    ICD10CMEntity -> Maybe ICD10CMEntityCategory
category :: Prelude.Maybe ICD10CMEntityCategory,
    -- | The level of confidence that Amazon Comprehend Medical has in the
    -- accuracy of the detection.
    ICD10CMEntity -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
    -- | Provides Contextual information for the entity. The traits recognized by
    -- InferICD10CM are @DIAGNOSIS@, @SIGN@, @SYMPTOM@, and @NEGATION.@
    ICD10CMEntity -> Maybe [ICD10CMTrait]
traits :: Prelude.Maybe [ICD10CMTrait],
    -- | The detected attributes that relate to the entity. An extracted segment
    -- of the text that is an attribute of an entity, or otherwise related to
    -- an entity, such as the nature of a medical condition.
    ICD10CMEntity -> Maybe [ICD10CMAttribute]
attributes :: Prelude.Maybe [ICD10CMAttribute],
    -- | The 0-based character offset in the input text that shows where the
    -- entity ends. The offset returns the UTF-8 code point in the string.
    ICD10CMEntity -> Maybe Int
endOffset :: Prelude.Maybe Prelude.Int,
    -- | The numeric identifier for the entity. This is a monotonically
    -- increasing id unique within this response rather than a global unique
    -- identifier.
    ICD10CMEntity -> Maybe Int
id :: Prelude.Maybe Prelude.Int,
    -- | Describes the specific type of entity with category of entities.
    -- InferICD10CM detects entities of the type @DX_NAME@ and
    -- @TIME_EXPRESSION@.
    ICD10CMEntity -> Maybe ICD10CMEntityType
type' :: Prelude.Maybe ICD10CMEntityType
  }
  deriving (ICD10CMEntity -> ICD10CMEntity -> Bool
(ICD10CMEntity -> ICD10CMEntity -> Bool)
-> (ICD10CMEntity -> ICD10CMEntity -> Bool) -> Eq ICD10CMEntity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ICD10CMEntity -> ICD10CMEntity -> Bool
$c/= :: ICD10CMEntity -> ICD10CMEntity -> Bool
== :: ICD10CMEntity -> ICD10CMEntity -> Bool
$c== :: ICD10CMEntity -> ICD10CMEntity -> Bool
Prelude.Eq, ReadPrec [ICD10CMEntity]
ReadPrec ICD10CMEntity
Int -> ReadS ICD10CMEntity
ReadS [ICD10CMEntity]
(Int -> ReadS ICD10CMEntity)
-> ReadS [ICD10CMEntity]
-> ReadPrec ICD10CMEntity
-> ReadPrec [ICD10CMEntity]
-> Read ICD10CMEntity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ICD10CMEntity]
$creadListPrec :: ReadPrec [ICD10CMEntity]
readPrec :: ReadPrec ICD10CMEntity
$creadPrec :: ReadPrec ICD10CMEntity
readList :: ReadS [ICD10CMEntity]
$creadList :: ReadS [ICD10CMEntity]
readsPrec :: Int -> ReadS ICD10CMEntity
$creadsPrec :: Int -> ReadS ICD10CMEntity
Prelude.Read, Int -> ICD10CMEntity -> ShowS
[ICD10CMEntity] -> ShowS
ICD10CMEntity -> String
(Int -> ICD10CMEntity -> ShowS)
-> (ICD10CMEntity -> String)
-> ([ICD10CMEntity] -> ShowS)
-> Show ICD10CMEntity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ICD10CMEntity] -> ShowS
$cshowList :: [ICD10CMEntity] -> ShowS
show :: ICD10CMEntity -> String
$cshow :: ICD10CMEntity -> String
showsPrec :: Int -> ICD10CMEntity -> ShowS
$cshowsPrec :: Int -> ICD10CMEntity -> ShowS
Prelude.Show, (forall x. ICD10CMEntity -> Rep ICD10CMEntity x)
-> (forall x. Rep ICD10CMEntity x -> ICD10CMEntity)
-> Generic ICD10CMEntity
forall x. Rep ICD10CMEntity x -> ICD10CMEntity
forall x. ICD10CMEntity -> Rep ICD10CMEntity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ICD10CMEntity x -> ICD10CMEntity
$cfrom :: forall x. ICD10CMEntity -> Rep ICD10CMEntity x
Prelude.Generic)

-- |
-- Create a value of 'ICD10CMEntity' 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:
--
-- 'iCD10CMConcepts', 'iCD10CMEntity_iCD10CMConcepts' - The ICD-10-CM concepts that the entity could refer to, along with a
-- score indicating the likelihood of the match.
--
-- 'beginOffset', 'iCD10CMEntity_beginOffset' - The 0-based character offset in the input text that shows where the
-- entity begins. The offset returns the UTF-8 code point in the string.
--
-- 'text', 'iCD10CMEntity_text' - The segment of input text that is matched to the detected entity.
--
-- 'category', 'iCD10CMEntity_category' - The category of the entity. InferICD10CM detects entities in the
-- @MEDICAL_CONDITION@ category.
--
-- 'score', 'iCD10CMEntity_score' - The level of confidence that Amazon Comprehend Medical has in the
-- accuracy of the detection.
--
-- 'traits', 'iCD10CMEntity_traits' - Provides Contextual information for the entity. The traits recognized by
-- InferICD10CM are @DIAGNOSIS@, @SIGN@, @SYMPTOM@, and @NEGATION.@
--
-- 'attributes', 'iCD10CMEntity_attributes' - The detected attributes that relate to the entity. An extracted segment
-- of the text that is an attribute of an entity, or otherwise related to
-- an entity, such as the nature of a medical condition.
--
-- 'endOffset', 'iCD10CMEntity_endOffset' - The 0-based character offset in the input text that shows where the
-- entity ends. The offset returns the UTF-8 code point in the string.
--
-- 'id', 'iCD10CMEntity_id' - The numeric identifier for the entity. This is a monotonically
-- increasing id unique within this response rather than a global unique
-- identifier.
--
-- 'type'', 'iCD10CMEntity_type' - Describes the specific type of entity with category of entities.
-- InferICD10CM detects entities of the type @DX_NAME@ and
-- @TIME_EXPRESSION@.
newICD10CMEntity ::
  ICD10CMEntity
newICD10CMEntity :: ICD10CMEntity
newICD10CMEntity =
  ICD10CMEntity' :: Maybe [ICD10CMConcept]
-> Maybe Int
-> Maybe Text
-> Maybe ICD10CMEntityCategory
-> Maybe Double
-> Maybe [ICD10CMTrait]
-> Maybe [ICD10CMAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe ICD10CMEntityType
-> ICD10CMEntity
ICD10CMEntity'
    { $sel:iCD10CMConcepts:ICD10CMEntity' :: Maybe [ICD10CMConcept]
iCD10CMConcepts = Maybe [ICD10CMConcept]
forall a. Maybe a
Prelude.Nothing,
      $sel:beginOffset:ICD10CMEntity' :: Maybe Int
beginOffset = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:text:ICD10CMEntity' :: Maybe Text
text = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:category:ICD10CMEntity' :: Maybe ICD10CMEntityCategory
category = Maybe ICD10CMEntityCategory
forall a. Maybe a
Prelude.Nothing,
      $sel:score:ICD10CMEntity' :: Maybe Double
score = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:traits:ICD10CMEntity' :: Maybe [ICD10CMTrait]
traits = Maybe [ICD10CMTrait]
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:ICD10CMEntity' :: Maybe [ICD10CMAttribute]
attributes = Maybe [ICD10CMAttribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:endOffset:ICD10CMEntity' :: Maybe Int
endOffset = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ICD10CMEntity' :: Maybe Int
id = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ICD10CMEntity' :: Maybe ICD10CMEntityType
type' = Maybe ICD10CMEntityType
forall a. Maybe a
Prelude.Nothing
    }

-- | The ICD-10-CM concepts that the entity could refer to, along with a
-- score indicating the likelihood of the match.
iCD10CMEntity_iCD10CMConcepts :: Lens.Lens' ICD10CMEntity (Prelude.Maybe [ICD10CMConcept])
iCD10CMEntity_iCD10CMConcepts :: (Maybe [ICD10CMConcept] -> f (Maybe [ICD10CMConcept]))
-> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_iCD10CMConcepts = (ICD10CMEntity -> Maybe [ICD10CMConcept])
-> (ICD10CMEntity -> Maybe [ICD10CMConcept] -> ICD10CMEntity)
-> Lens
     ICD10CMEntity
     ICD10CMEntity
     (Maybe [ICD10CMConcept])
     (Maybe [ICD10CMConcept])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe [ICD10CMConcept]
iCD10CMConcepts :: Maybe [ICD10CMConcept]
$sel:iCD10CMConcepts:ICD10CMEntity' :: ICD10CMEntity -> Maybe [ICD10CMConcept]
iCD10CMConcepts} -> Maybe [ICD10CMConcept]
iCD10CMConcepts) (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe [ICD10CMConcept]
a -> ICD10CMEntity
s {$sel:iCD10CMConcepts:ICD10CMEntity' :: Maybe [ICD10CMConcept]
iCD10CMConcepts = Maybe [ICD10CMConcept]
a} :: ICD10CMEntity) ((Maybe [ICD10CMConcept] -> f (Maybe [ICD10CMConcept]))
 -> ICD10CMEntity -> f ICD10CMEntity)
-> ((Maybe [ICD10CMConcept] -> f (Maybe [ICD10CMConcept]))
    -> Maybe [ICD10CMConcept] -> f (Maybe [ICD10CMConcept]))
-> (Maybe [ICD10CMConcept] -> f (Maybe [ICD10CMConcept]))
-> ICD10CMEntity
-> f ICD10CMEntity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ICD10CMConcept] [ICD10CMConcept] [ICD10CMConcept] [ICD10CMConcept]
-> Iso
     (Maybe [ICD10CMConcept])
     (Maybe [ICD10CMConcept])
     (Maybe [ICD10CMConcept])
     (Maybe [ICD10CMConcept])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ICD10CMConcept] [ICD10CMConcept] [ICD10CMConcept] [ICD10CMConcept]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 0-based character offset in the input text that shows where the
-- entity begins. The offset returns the UTF-8 code point in the string.
iCD10CMEntity_beginOffset :: Lens.Lens' ICD10CMEntity (Prelude.Maybe Prelude.Int)
iCD10CMEntity_beginOffset :: (Maybe Int -> f (Maybe Int)) -> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_beginOffset = (ICD10CMEntity -> Maybe Int)
-> (ICD10CMEntity -> Maybe Int -> ICD10CMEntity)
-> Lens ICD10CMEntity ICD10CMEntity (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe Int
beginOffset :: Maybe Int
$sel:beginOffset:ICD10CMEntity' :: ICD10CMEntity -> Maybe Int
beginOffset} -> Maybe Int
beginOffset) (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe Int
a -> ICD10CMEntity
s {$sel:beginOffset:ICD10CMEntity' :: Maybe Int
beginOffset = Maybe Int
a} :: ICD10CMEntity)

-- | The segment of input text that is matched to the detected entity.
iCD10CMEntity_text :: Lens.Lens' ICD10CMEntity (Prelude.Maybe Prelude.Text)
iCD10CMEntity_text :: (Maybe Text -> f (Maybe Text)) -> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_text = (ICD10CMEntity -> Maybe Text)
-> (ICD10CMEntity -> Maybe Text -> ICD10CMEntity)
-> Lens ICD10CMEntity ICD10CMEntity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe Text
text :: Maybe Text
$sel:text:ICD10CMEntity' :: ICD10CMEntity -> Maybe Text
text} -> Maybe Text
text) (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe Text
a -> ICD10CMEntity
s {$sel:text:ICD10CMEntity' :: Maybe Text
text = Maybe Text
a} :: ICD10CMEntity)

-- | The category of the entity. InferICD10CM detects entities in the
-- @MEDICAL_CONDITION@ category.
iCD10CMEntity_category :: Lens.Lens' ICD10CMEntity (Prelude.Maybe ICD10CMEntityCategory)
iCD10CMEntity_category :: (Maybe ICD10CMEntityCategory -> f (Maybe ICD10CMEntityCategory))
-> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_category = (ICD10CMEntity -> Maybe ICD10CMEntityCategory)
-> (ICD10CMEntity -> Maybe ICD10CMEntityCategory -> ICD10CMEntity)
-> Lens
     ICD10CMEntity
     ICD10CMEntity
     (Maybe ICD10CMEntityCategory)
     (Maybe ICD10CMEntityCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe ICD10CMEntityCategory
category :: Maybe ICD10CMEntityCategory
$sel:category:ICD10CMEntity' :: ICD10CMEntity -> Maybe ICD10CMEntityCategory
category} -> Maybe ICD10CMEntityCategory
category) (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe ICD10CMEntityCategory
a -> ICD10CMEntity
s {$sel:category:ICD10CMEntity' :: Maybe ICD10CMEntityCategory
category = Maybe ICD10CMEntityCategory
a} :: ICD10CMEntity)

-- | The level of confidence that Amazon Comprehend Medical has in the
-- accuracy of the detection.
iCD10CMEntity_score :: Lens.Lens' ICD10CMEntity (Prelude.Maybe Prelude.Double)
iCD10CMEntity_score :: (Maybe Double -> f (Maybe Double))
-> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_score = (ICD10CMEntity -> Maybe Double)
-> (ICD10CMEntity -> Maybe Double -> ICD10CMEntity)
-> Lens ICD10CMEntity ICD10CMEntity (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe Double
score :: Maybe Double
$sel:score:ICD10CMEntity' :: ICD10CMEntity -> Maybe Double
score} -> Maybe Double
score) (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe Double
a -> ICD10CMEntity
s {$sel:score:ICD10CMEntity' :: Maybe Double
score = Maybe Double
a} :: ICD10CMEntity)

-- | Provides Contextual information for the entity. The traits recognized by
-- InferICD10CM are @DIAGNOSIS@, @SIGN@, @SYMPTOM@, and @NEGATION.@
iCD10CMEntity_traits :: Lens.Lens' ICD10CMEntity (Prelude.Maybe [ICD10CMTrait])
iCD10CMEntity_traits :: (Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
-> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_traits = (ICD10CMEntity -> Maybe [ICD10CMTrait])
-> (ICD10CMEntity -> Maybe [ICD10CMTrait] -> ICD10CMEntity)
-> Lens
     ICD10CMEntity
     ICD10CMEntity
     (Maybe [ICD10CMTrait])
     (Maybe [ICD10CMTrait])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe [ICD10CMTrait]
traits :: Maybe [ICD10CMTrait]
$sel:traits:ICD10CMEntity' :: ICD10CMEntity -> Maybe [ICD10CMTrait]
traits} -> Maybe [ICD10CMTrait]
traits) (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe [ICD10CMTrait]
a -> ICD10CMEntity
s {$sel:traits:ICD10CMEntity' :: Maybe [ICD10CMTrait]
traits = Maybe [ICD10CMTrait]
a} :: ICD10CMEntity) ((Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
 -> ICD10CMEntity -> f ICD10CMEntity)
-> ((Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
    -> Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
-> (Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
-> ICD10CMEntity
-> f ICD10CMEntity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ICD10CMTrait] [ICD10CMTrait] [ICD10CMTrait] [ICD10CMTrait]
-> Iso
     (Maybe [ICD10CMTrait])
     (Maybe [ICD10CMTrait])
     (Maybe [ICD10CMTrait])
     (Maybe [ICD10CMTrait])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [ICD10CMTrait] [ICD10CMTrait] [ICD10CMTrait] [ICD10CMTrait]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The detected attributes that relate to the entity. An extracted segment
-- of the text that is an attribute of an entity, or otherwise related to
-- an entity, such as the nature of a medical condition.
iCD10CMEntity_attributes :: Lens.Lens' ICD10CMEntity (Prelude.Maybe [ICD10CMAttribute])
iCD10CMEntity_attributes :: (Maybe [ICD10CMAttribute] -> f (Maybe [ICD10CMAttribute]))
-> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_attributes = (ICD10CMEntity -> Maybe [ICD10CMAttribute])
-> (ICD10CMEntity -> Maybe [ICD10CMAttribute] -> ICD10CMEntity)
-> Lens
     ICD10CMEntity
     ICD10CMEntity
     (Maybe [ICD10CMAttribute])
     (Maybe [ICD10CMAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe [ICD10CMAttribute]
attributes :: Maybe [ICD10CMAttribute]
$sel:attributes:ICD10CMEntity' :: ICD10CMEntity -> Maybe [ICD10CMAttribute]
attributes} -> Maybe [ICD10CMAttribute]
attributes) (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe [ICD10CMAttribute]
a -> ICD10CMEntity
s {$sel:attributes:ICD10CMEntity' :: Maybe [ICD10CMAttribute]
attributes = Maybe [ICD10CMAttribute]
a} :: ICD10CMEntity) ((Maybe [ICD10CMAttribute] -> f (Maybe [ICD10CMAttribute]))
 -> ICD10CMEntity -> f ICD10CMEntity)
-> ((Maybe [ICD10CMAttribute] -> f (Maybe [ICD10CMAttribute]))
    -> Maybe [ICD10CMAttribute] -> f (Maybe [ICD10CMAttribute]))
-> (Maybe [ICD10CMAttribute] -> f (Maybe [ICD10CMAttribute]))
-> ICD10CMEntity
-> f ICD10CMEntity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ICD10CMAttribute]
  [ICD10CMAttribute]
  [ICD10CMAttribute]
  [ICD10CMAttribute]
-> Iso
     (Maybe [ICD10CMAttribute])
     (Maybe [ICD10CMAttribute])
     (Maybe [ICD10CMAttribute])
     (Maybe [ICD10CMAttribute])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ICD10CMAttribute]
  [ICD10CMAttribute]
  [ICD10CMAttribute]
  [ICD10CMAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 0-based character offset in the input text that shows where the
-- entity ends. The offset returns the UTF-8 code point in the string.
iCD10CMEntity_endOffset :: Lens.Lens' ICD10CMEntity (Prelude.Maybe Prelude.Int)
iCD10CMEntity_endOffset :: (Maybe Int -> f (Maybe Int)) -> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_endOffset = (ICD10CMEntity -> Maybe Int)
-> (ICD10CMEntity -> Maybe Int -> ICD10CMEntity)
-> Lens ICD10CMEntity ICD10CMEntity (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe Int
endOffset :: Maybe Int
$sel:endOffset:ICD10CMEntity' :: ICD10CMEntity -> Maybe Int
endOffset} -> Maybe Int
endOffset) (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe Int
a -> ICD10CMEntity
s {$sel:endOffset:ICD10CMEntity' :: Maybe Int
endOffset = Maybe Int
a} :: ICD10CMEntity)

-- | The numeric identifier for the entity. This is a monotonically
-- increasing id unique within this response rather than a global unique
-- identifier.
iCD10CMEntity_id :: Lens.Lens' ICD10CMEntity (Prelude.Maybe Prelude.Int)
iCD10CMEntity_id :: (Maybe Int -> f (Maybe Int)) -> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_id = (ICD10CMEntity -> Maybe Int)
-> (ICD10CMEntity -> Maybe Int -> ICD10CMEntity)
-> Lens ICD10CMEntity ICD10CMEntity (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe Int
id :: Maybe Int
$sel:id:ICD10CMEntity' :: ICD10CMEntity -> Maybe Int
id} -> Maybe Int
id) (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe Int
a -> ICD10CMEntity
s {$sel:id:ICD10CMEntity' :: Maybe Int
id = Maybe Int
a} :: ICD10CMEntity)

-- | Describes the specific type of entity with category of entities.
-- InferICD10CM detects entities of the type @DX_NAME@ and
-- @TIME_EXPRESSION@.
iCD10CMEntity_type :: Lens.Lens' ICD10CMEntity (Prelude.Maybe ICD10CMEntityType)
iCD10CMEntity_type :: (Maybe ICD10CMEntityType -> f (Maybe ICD10CMEntityType))
-> ICD10CMEntity -> f ICD10CMEntity
iCD10CMEntity_type = (ICD10CMEntity -> Maybe ICD10CMEntityType)
-> (ICD10CMEntity -> Maybe ICD10CMEntityType -> ICD10CMEntity)
-> Lens
     ICD10CMEntity
     ICD10CMEntity
     (Maybe ICD10CMEntityType)
     (Maybe ICD10CMEntityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMEntity' {Maybe ICD10CMEntityType
type' :: Maybe ICD10CMEntityType
$sel:type':ICD10CMEntity' :: ICD10CMEntity -> Maybe ICD10CMEntityType
type'} -> Maybe ICD10CMEntityType
type') (\s :: ICD10CMEntity
s@ICD10CMEntity' {} Maybe ICD10CMEntityType
a -> ICD10CMEntity
s {$sel:type':ICD10CMEntity' :: Maybe ICD10CMEntityType
type' = Maybe ICD10CMEntityType
a} :: ICD10CMEntity)

instance Core.FromJSON ICD10CMEntity where
  parseJSON :: Value -> Parser ICD10CMEntity
parseJSON =
    String
-> (Object -> Parser ICD10CMEntity)
-> Value
-> Parser ICD10CMEntity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ICD10CMEntity"
      ( \Object
x ->
          Maybe [ICD10CMConcept]
-> Maybe Int
-> Maybe Text
-> Maybe ICD10CMEntityCategory
-> Maybe Double
-> Maybe [ICD10CMTrait]
-> Maybe [ICD10CMAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe ICD10CMEntityType
-> ICD10CMEntity
ICD10CMEntity'
            (Maybe [ICD10CMConcept]
 -> Maybe Int
 -> Maybe Text
 -> Maybe ICD10CMEntityCategory
 -> Maybe Double
 -> Maybe [ICD10CMTrait]
 -> Maybe [ICD10CMAttribute]
 -> Maybe Int
 -> Maybe Int
 -> Maybe ICD10CMEntityType
 -> ICD10CMEntity)
-> Parser (Maybe [ICD10CMConcept])
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe ICD10CMEntityCategory
      -> Maybe Double
      -> Maybe [ICD10CMTrait]
      -> Maybe [ICD10CMAttribute]
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMEntityType
      -> ICD10CMEntity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ICD10CMConcept]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ICD10CMConcepts"
                            Parser (Maybe (Maybe [ICD10CMConcept]))
-> Maybe [ICD10CMConcept] -> Parser (Maybe [ICD10CMConcept])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ICD10CMConcept]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe ICD10CMEntityCategory
   -> Maybe Double
   -> Maybe [ICD10CMTrait]
   -> Maybe [ICD10CMAttribute]
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMEntityType
   -> ICD10CMEntity)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe ICD10CMEntityCategory
      -> Maybe Double
      -> Maybe [ICD10CMTrait]
      -> Maybe [ICD10CMAttribute]
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMEntityType
      -> ICD10CMEntity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BeginOffset")
            Parser
  (Maybe Text
   -> Maybe ICD10CMEntityCategory
   -> Maybe Double
   -> Maybe [ICD10CMTrait]
   -> Maybe [ICD10CMAttribute]
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMEntityType
   -> ICD10CMEntity)
-> Parser (Maybe Text)
-> Parser
     (Maybe ICD10CMEntityCategory
      -> Maybe Double
      -> Maybe [ICD10CMTrait]
      -> Maybe [ICD10CMAttribute]
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMEntityType
      -> ICD10CMEntity)
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
"Text")
            Parser
  (Maybe ICD10CMEntityCategory
   -> Maybe Double
   -> Maybe [ICD10CMTrait]
   -> Maybe [ICD10CMAttribute]
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMEntityType
   -> ICD10CMEntity)
-> Parser (Maybe ICD10CMEntityCategory)
-> Parser
     (Maybe Double
      -> Maybe [ICD10CMTrait]
      -> Maybe [ICD10CMAttribute]
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMEntityType
      -> ICD10CMEntity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ICD10CMEntityCategory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Category")
            Parser
  (Maybe Double
   -> Maybe [ICD10CMTrait]
   -> Maybe [ICD10CMAttribute]
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMEntityType
   -> ICD10CMEntity)
-> Parser (Maybe Double)
-> Parser
     (Maybe [ICD10CMTrait]
      -> Maybe [ICD10CMAttribute]
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMEntityType
      -> ICD10CMEntity)
forall (f :: * -> *) a b. Applicative f => 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 [ICD10CMTrait]
   -> Maybe [ICD10CMAttribute]
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMEntityType
   -> ICD10CMEntity)
-> Parser (Maybe [ICD10CMTrait])
-> Parser
     (Maybe [ICD10CMAttribute]
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMEntityType
      -> ICD10CMEntity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ICD10CMTrait]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Traits" Parser (Maybe (Maybe [ICD10CMTrait]))
-> Maybe [ICD10CMTrait] -> Parser (Maybe [ICD10CMTrait])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ICD10CMTrait]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [ICD10CMAttribute]
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMEntityType
   -> ICD10CMEntity)
-> Parser (Maybe [ICD10CMAttribute])
-> Parser
     (Maybe Int
      -> Maybe Int -> Maybe ICD10CMEntityType -> ICD10CMEntity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ICD10CMAttribute]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Attributes" Parser (Maybe (Maybe [ICD10CMAttribute]))
-> Maybe [ICD10CMAttribute] -> Parser (Maybe [ICD10CMAttribute])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ICD10CMAttribute]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Int
   -> Maybe Int -> Maybe ICD10CMEntityType -> ICD10CMEntity)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe ICD10CMEntityType -> ICD10CMEntity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndOffset")
            Parser (Maybe Int -> Maybe ICD10CMEntityType -> ICD10CMEntity)
-> Parser (Maybe Int)
-> Parser (Maybe ICD10CMEntityType -> ICD10CMEntity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser (Maybe ICD10CMEntityType -> ICD10CMEntity)
-> Parser (Maybe ICD10CMEntityType) -> Parser ICD10CMEntity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ICD10CMEntityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
      )

instance Prelude.Hashable ICD10CMEntity

instance Prelude.NFData ICD10CMEntity