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

import Amazonka.ComprehendMedical.Types.ICD10CMAttributeType
import Amazonka.ComprehendMedical.Types.ICD10CMEntityType
import Amazonka.ComprehendMedical.Types.ICD10CMRelationshipType
import Amazonka.ComprehendMedical.Types.ICD10CMTrait
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The detected attributes that relate to an entity. This includes an
-- extracted segment of the text that is an attribute of an entity, or
-- otherwise related to an entity. InferICD10CM detects the following
-- attributes: @Direction@, @System, Organ or Site@, and @Acuity@.
--
-- /See:/ 'newICD10CMAttribute' smart constructor.
data ICD10CMAttribute = ICD10CMAttribute'
  { -- | The level of confidence that Amazon Comprehend Medical has that this
    -- attribute is correctly related to this entity.
    ICD10CMAttribute -> Maybe Double
relationshipScore :: Prelude.Maybe Prelude.Double,
    -- | The 0-based character offset in the input text that shows where the
    -- attribute begins. The offset returns the UTF-8 code point in the string.
    ICD10CMAttribute -> Maybe Int
beginOffset :: Prelude.Maybe Prelude.Int,
    -- | The segment of input text which contains the detected attribute.
    ICD10CMAttribute -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
    -- | The category of attribute. Can be either of @DX_NAME@ or
    -- @TIME_EXPRESSION@.
    ICD10CMAttribute -> Maybe ICD10CMEntityType
category :: Prelude.Maybe ICD10CMEntityType,
    -- | The level of confidence that Amazon Comprehend Medical has that the
    -- segment of text is correctly recognized as an attribute.
    ICD10CMAttribute -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
    -- | The contextual information for the attribute. The traits recognized by
    -- InferICD10CM are @DIAGNOSIS@, @SIGN@, @SYMPTOM@, and @NEGATION@.
    ICD10CMAttribute -> Maybe [ICD10CMTrait]
traits :: Prelude.Maybe [ICD10CMTrait],
    -- | The type of relationship between the entity and attribute. Type for the
    -- relationship can be either of @OVERLAP@ or @SYSTEM_ORGAN_SITE@.
    ICD10CMAttribute -> Maybe ICD10CMRelationshipType
relationshipType :: Prelude.Maybe ICD10CMRelationshipType,
    -- | The 0-based character offset in the input text that shows where the
    -- attribute ends. The offset returns the UTF-8 code point in the string.
    ICD10CMAttribute -> Maybe Int
endOffset :: Prelude.Maybe Prelude.Int,
    -- | The numeric identifier for this attribute. This is a monotonically
    -- increasing id unique within this response rather than a global unique
    -- identifier.
    ICD10CMAttribute -> Maybe Int
id :: Prelude.Maybe Prelude.Int,
    -- | The type of attribute. InferICD10CM detects entities of the type
    -- @DX_NAME@.
    ICD10CMAttribute -> Maybe ICD10CMAttributeType
type' :: Prelude.Maybe ICD10CMAttributeType
  }
  deriving (ICD10CMAttribute -> ICD10CMAttribute -> Bool
(ICD10CMAttribute -> ICD10CMAttribute -> Bool)
-> (ICD10CMAttribute -> ICD10CMAttribute -> Bool)
-> Eq ICD10CMAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ICD10CMAttribute -> ICD10CMAttribute -> Bool
$c/= :: ICD10CMAttribute -> ICD10CMAttribute -> Bool
== :: ICD10CMAttribute -> ICD10CMAttribute -> Bool
$c== :: ICD10CMAttribute -> ICD10CMAttribute -> Bool
Prelude.Eq, ReadPrec [ICD10CMAttribute]
ReadPrec ICD10CMAttribute
Int -> ReadS ICD10CMAttribute
ReadS [ICD10CMAttribute]
(Int -> ReadS ICD10CMAttribute)
-> ReadS [ICD10CMAttribute]
-> ReadPrec ICD10CMAttribute
-> ReadPrec [ICD10CMAttribute]
-> Read ICD10CMAttribute
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ICD10CMAttribute]
$creadListPrec :: ReadPrec [ICD10CMAttribute]
readPrec :: ReadPrec ICD10CMAttribute
$creadPrec :: ReadPrec ICD10CMAttribute
readList :: ReadS [ICD10CMAttribute]
$creadList :: ReadS [ICD10CMAttribute]
readsPrec :: Int -> ReadS ICD10CMAttribute
$creadsPrec :: Int -> ReadS ICD10CMAttribute
Prelude.Read, Int -> ICD10CMAttribute -> ShowS
[ICD10CMAttribute] -> ShowS
ICD10CMAttribute -> String
(Int -> ICD10CMAttribute -> ShowS)
-> (ICD10CMAttribute -> String)
-> ([ICD10CMAttribute] -> ShowS)
-> Show ICD10CMAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ICD10CMAttribute] -> ShowS
$cshowList :: [ICD10CMAttribute] -> ShowS
show :: ICD10CMAttribute -> String
$cshow :: ICD10CMAttribute -> String
showsPrec :: Int -> ICD10CMAttribute -> ShowS
$cshowsPrec :: Int -> ICD10CMAttribute -> ShowS
Prelude.Show, (forall x. ICD10CMAttribute -> Rep ICD10CMAttribute x)
-> (forall x. Rep ICD10CMAttribute x -> ICD10CMAttribute)
-> Generic ICD10CMAttribute
forall x. Rep ICD10CMAttribute x -> ICD10CMAttribute
forall x. ICD10CMAttribute -> Rep ICD10CMAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ICD10CMAttribute x -> ICD10CMAttribute
$cfrom :: forall x. ICD10CMAttribute -> Rep ICD10CMAttribute x
Prelude.Generic)

-- |
-- Create a value of 'ICD10CMAttribute' 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:
--
-- 'relationshipScore', 'iCD10CMAttribute_relationshipScore' - The level of confidence that Amazon Comprehend Medical has that this
-- attribute is correctly related to this entity.
--
-- 'beginOffset', 'iCD10CMAttribute_beginOffset' - The 0-based character offset in the input text that shows where the
-- attribute begins. The offset returns the UTF-8 code point in the string.
--
-- 'text', 'iCD10CMAttribute_text' - The segment of input text which contains the detected attribute.
--
-- 'category', 'iCD10CMAttribute_category' - The category of attribute. Can be either of @DX_NAME@ or
-- @TIME_EXPRESSION@.
--
-- 'score', 'iCD10CMAttribute_score' - The level of confidence that Amazon Comprehend Medical has that the
-- segment of text is correctly recognized as an attribute.
--
-- 'traits', 'iCD10CMAttribute_traits' - The contextual information for the attribute. The traits recognized by
-- InferICD10CM are @DIAGNOSIS@, @SIGN@, @SYMPTOM@, and @NEGATION@.
--
-- 'relationshipType', 'iCD10CMAttribute_relationshipType' - The type of relationship between the entity and attribute. Type for the
-- relationship can be either of @OVERLAP@ or @SYSTEM_ORGAN_SITE@.
--
-- 'endOffset', 'iCD10CMAttribute_endOffset' - The 0-based character offset in the input text that shows where the
-- attribute ends. The offset returns the UTF-8 code point in the string.
--
-- 'id', 'iCD10CMAttribute_id' - The numeric identifier for this attribute. This is a monotonically
-- increasing id unique within this response rather than a global unique
-- identifier.
--
-- 'type'', 'iCD10CMAttribute_type' - The type of attribute. InferICD10CM detects entities of the type
-- @DX_NAME@.
newICD10CMAttribute ::
  ICD10CMAttribute
newICD10CMAttribute :: ICD10CMAttribute
newICD10CMAttribute =
  ICD10CMAttribute' :: Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe ICD10CMEntityType
-> Maybe Double
-> Maybe [ICD10CMTrait]
-> Maybe ICD10CMRelationshipType
-> Maybe Int
-> Maybe Int
-> Maybe ICD10CMAttributeType
-> ICD10CMAttribute
ICD10CMAttribute'
    { $sel:relationshipScore:ICD10CMAttribute' :: Maybe Double
relationshipScore =
        Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:beginOffset:ICD10CMAttribute' :: Maybe Int
beginOffset = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:text:ICD10CMAttribute' :: Maybe Text
text = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:category:ICD10CMAttribute' :: Maybe ICD10CMEntityType
category = Maybe ICD10CMEntityType
forall a. Maybe a
Prelude.Nothing,
      $sel:score:ICD10CMAttribute' :: Maybe Double
score = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:traits:ICD10CMAttribute' :: Maybe [ICD10CMTrait]
traits = Maybe [ICD10CMTrait]
forall a. Maybe a
Prelude.Nothing,
      $sel:relationshipType:ICD10CMAttribute' :: Maybe ICD10CMRelationshipType
relationshipType = Maybe ICD10CMRelationshipType
forall a. Maybe a
Prelude.Nothing,
      $sel:endOffset:ICD10CMAttribute' :: Maybe Int
endOffset = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ICD10CMAttribute' :: Maybe Int
id = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ICD10CMAttribute' :: Maybe ICD10CMAttributeType
type' = Maybe ICD10CMAttributeType
forall a. Maybe a
Prelude.Nothing
    }

-- | The level of confidence that Amazon Comprehend Medical has that this
-- attribute is correctly related to this entity.
iCD10CMAttribute_relationshipScore :: Lens.Lens' ICD10CMAttribute (Prelude.Maybe Prelude.Double)
iCD10CMAttribute_relationshipScore :: (Maybe Double -> f (Maybe Double))
-> ICD10CMAttribute -> f ICD10CMAttribute
iCD10CMAttribute_relationshipScore = (ICD10CMAttribute -> Maybe Double)
-> (ICD10CMAttribute -> Maybe Double -> ICD10CMAttribute)
-> Lens
     ICD10CMAttribute ICD10CMAttribute (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMAttribute' {Maybe Double
relationshipScore :: Maybe Double
$sel:relationshipScore:ICD10CMAttribute' :: ICD10CMAttribute -> Maybe Double
relationshipScore} -> Maybe Double
relationshipScore) (\s :: ICD10CMAttribute
s@ICD10CMAttribute' {} Maybe Double
a -> ICD10CMAttribute
s {$sel:relationshipScore:ICD10CMAttribute' :: Maybe Double
relationshipScore = Maybe Double
a} :: ICD10CMAttribute)

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

-- | The segment of input text which contains the detected attribute.
iCD10CMAttribute_text :: Lens.Lens' ICD10CMAttribute (Prelude.Maybe Prelude.Text)
iCD10CMAttribute_text :: (Maybe Text -> f (Maybe Text))
-> ICD10CMAttribute -> f ICD10CMAttribute
iCD10CMAttribute_text = (ICD10CMAttribute -> Maybe Text)
-> (ICD10CMAttribute -> Maybe Text -> ICD10CMAttribute)
-> Lens ICD10CMAttribute ICD10CMAttribute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMAttribute' {Maybe Text
text :: Maybe Text
$sel:text:ICD10CMAttribute' :: ICD10CMAttribute -> Maybe Text
text} -> Maybe Text
text) (\s :: ICD10CMAttribute
s@ICD10CMAttribute' {} Maybe Text
a -> ICD10CMAttribute
s {$sel:text:ICD10CMAttribute' :: Maybe Text
text = Maybe Text
a} :: ICD10CMAttribute)

-- | The category of attribute. Can be either of @DX_NAME@ or
-- @TIME_EXPRESSION@.
iCD10CMAttribute_category :: Lens.Lens' ICD10CMAttribute (Prelude.Maybe ICD10CMEntityType)
iCD10CMAttribute_category :: (Maybe ICD10CMEntityType -> f (Maybe ICD10CMEntityType))
-> ICD10CMAttribute -> f ICD10CMAttribute
iCD10CMAttribute_category = (ICD10CMAttribute -> Maybe ICD10CMEntityType)
-> (ICD10CMAttribute
    -> Maybe ICD10CMEntityType -> ICD10CMAttribute)
-> Lens
     ICD10CMAttribute
     ICD10CMAttribute
     (Maybe ICD10CMEntityType)
     (Maybe ICD10CMEntityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMAttribute' {Maybe ICD10CMEntityType
category :: Maybe ICD10CMEntityType
$sel:category:ICD10CMAttribute' :: ICD10CMAttribute -> Maybe ICD10CMEntityType
category} -> Maybe ICD10CMEntityType
category) (\s :: ICD10CMAttribute
s@ICD10CMAttribute' {} Maybe ICD10CMEntityType
a -> ICD10CMAttribute
s {$sel:category:ICD10CMAttribute' :: Maybe ICD10CMEntityType
category = Maybe ICD10CMEntityType
a} :: ICD10CMAttribute)

-- | The level of confidence that Amazon Comprehend Medical has that the
-- segment of text is correctly recognized as an attribute.
iCD10CMAttribute_score :: Lens.Lens' ICD10CMAttribute (Prelude.Maybe Prelude.Double)
iCD10CMAttribute_score :: (Maybe Double -> f (Maybe Double))
-> ICD10CMAttribute -> f ICD10CMAttribute
iCD10CMAttribute_score = (ICD10CMAttribute -> Maybe Double)
-> (ICD10CMAttribute -> Maybe Double -> ICD10CMAttribute)
-> Lens
     ICD10CMAttribute ICD10CMAttribute (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMAttribute' {Maybe Double
score :: Maybe Double
$sel:score:ICD10CMAttribute' :: ICD10CMAttribute -> Maybe Double
score} -> Maybe Double
score) (\s :: ICD10CMAttribute
s@ICD10CMAttribute' {} Maybe Double
a -> ICD10CMAttribute
s {$sel:score:ICD10CMAttribute' :: Maybe Double
score = Maybe Double
a} :: ICD10CMAttribute)

-- | The contextual information for the attribute. The traits recognized by
-- InferICD10CM are @DIAGNOSIS@, @SIGN@, @SYMPTOM@, and @NEGATION@.
iCD10CMAttribute_traits :: Lens.Lens' ICD10CMAttribute (Prelude.Maybe [ICD10CMTrait])
iCD10CMAttribute_traits :: (Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
-> ICD10CMAttribute -> f ICD10CMAttribute
iCD10CMAttribute_traits = (ICD10CMAttribute -> Maybe [ICD10CMTrait])
-> (ICD10CMAttribute -> Maybe [ICD10CMTrait] -> ICD10CMAttribute)
-> Lens
     ICD10CMAttribute
     ICD10CMAttribute
     (Maybe [ICD10CMTrait])
     (Maybe [ICD10CMTrait])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMAttribute' {Maybe [ICD10CMTrait]
traits :: Maybe [ICD10CMTrait]
$sel:traits:ICD10CMAttribute' :: ICD10CMAttribute -> Maybe [ICD10CMTrait]
traits} -> Maybe [ICD10CMTrait]
traits) (\s :: ICD10CMAttribute
s@ICD10CMAttribute' {} Maybe [ICD10CMTrait]
a -> ICD10CMAttribute
s {$sel:traits:ICD10CMAttribute' :: Maybe [ICD10CMTrait]
traits = Maybe [ICD10CMTrait]
a} :: ICD10CMAttribute) ((Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
 -> ICD10CMAttribute -> f ICD10CMAttribute)
-> ((Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
    -> Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
-> (Maybe [ICD10CMTrait] -> f (Maybe [ICD10CMTrait]))
-> ICD10CMAttribute
-> f ICD10CMAttribute
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 type of relationship between the entity and attribute. Type for the
-- relationship can be either of @OVERLAP@ or @SYSTEM_ORGAN_SITE@.
iCD10CMAttribute_relationshipType :: Lens.Lens' ICD10CMAttribute (Prelude.Maybe ICD10CMRelationshipType)
iCD10CMAttribute_relationshipType :: (Maybe ICD10CMRelationshipType
 -> f (Maybe ICD10CMRelationshipType))
-> ICD10CMAttribute -> f ICD10CMAttribute
iCD10CMAttribute_relationshipType = (ICD10CMAttribute -> Maybe ICD10CMRelationshipType)
-> (ICD10CMAttribute
    -> Maybe ICD10CMRelationshipType -> ICD10CMAttribute)
-> Lens
     ICD10CMAttribute
     ICD10CMAttribute
     (Maybe ICD10CMRelationshipType)
     (Maybe ICD10CMRelationshipType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMAttribute' {Maybe ICD10CMRelationshipType
relationshipType :: Maybe ICD10CMRelationshipType
$sel:relationshipType:ICD10CMAttribute' :: ICD10CMAttribute -> Maybe ICD10CMRelationshipType
relationshipType} -> Maybe ICD10CMRelationshipType
relationshipType) (\s :: ICD10CMAttribute
s@ICD10CMAttribute' {} Maybe ICD10CMRelationshipType
a -> ICD10CMAttribute
s {$sel:relationshipType:ICD10CMAttribute' :: Maybe ICD10CMRelationshipType
relationshipType = Maybe ICD10CMRelationshipType
a} :: ICD10CMAttribute)

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

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

-- | The type of attribute. InferICD10CM detects entities of the type
-- @DX_NAME@.
iCD10CMAttribute_type :: Lens.Lens' ICD10CMAttribute (Prelude.Maybe ICD10CMAttributeType)
iCD10CMAttribute_type :: (Maybe ICD10CMAttributeType -> f (Maybe ICD10CMAttributeType))
-> ICD10CMAttribute -> f ICD10CMAttribute
iCD10CMAttribute_type = (ICD10CMAttribute -> Maybe ICD10CMAttributeType)
-> (ICD10CMAttribute
    -> Maybe ICD10CMAttributeType -> ICD10CMAttribute)
-> Lens
     ICD10CMAttribute
     ICD10CMAttribute
     (Maybe ICD10CMAttributeType)
     (Maybe ICD10CMAttributeType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ICD10CMAttribute' {Maybe ICD10CMAttributeType
type' :: Maybe ICD10CMAttributeType
$sel:type':ICD10CMAttribute' :: ICD10CMAttribute -> Maybe ICD10CMAttributeType
type'} -> Maybe ICD10CMAttributeType
type') (\s :: ICD10CMAttribute
s@ICD10CMAttribute' {} Maybe ICD10CMAttributeType
a -> ICD10CMAttribute
s {$sel:type':ICD10CMAttribute' :: Maybe ICD10CMAttributeType
type' = Maybe ICD10CMAttributeType
a} :: ICD10CMAttribute)

instance Core.FromJSON ICD10CMAttribute where
  parseJSON :: Value -> Parser ICD10CMAttribute
parseJSON =
    String
-> (Object -> Parser ICD10CMAttribute)
-> Value
-> Parser ICD10CMAttribute
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ICD10CMAttribute"
      ( \Object
x ->
          Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe ICD10CMEntityType
-> Maybe Double
-> Maybe [ICD10CMTrait]
-> Maybe ICD10CMRelationshipType
-> Maybe Int
-> Maybe Int
-> Maybe ICD10CMAttributeType
-> ICD10CMAttribute
ICD10CMAttribute'
            (Maybe Double
 -> Maybe Int
 -> Maybe Text
 -> Maybe ICD10CMEntityType
 -> Maybe Double
 -> Maybe [ICD10CMTrait]
 -> Maybe ICD10CMRelationshipType
 -> Maybe Int
 -> Maybe Int
 -> Maybe ICD10CMAttributeType
 -> ICD10CMAttribute)
-> Parser (Maybe Double)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe ICD10CMEntityType
      -> Maybe Double
      -> Maybe [ICD10CMTrait]
      -> Maybe ICD10CMRelationshipType
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMAttributeType
      -> ICD10CMAttribute)
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
"RelationshipScore")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe ICD10CMEntityType
   -> Maybe Double
   -> Maybe [ICD10CMTrait]
   -> Maybe ICD10CMRelationshipType
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMAttributeType
   -> ICD10CMAttribute)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe ICD10CMEntityType
      -> Maybe Double
      -> Maybe [ICD10CMTrait]
      -> Maybe ICD10CMRelationshipType
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMAttributeType
      -> ICD10CMAttribute)
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 ICD10CMEntityType
   -> Maybe Double
   -> Maybe [ICD10CMTrait]
   -> Maybe ICD10CMRelationshipType
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMAttributeType
   -> ICD10CMAttribute)
-> Parser (Maybe Text)
-> Parser
     (Maybe ICD10CMEntityType
      -> Maybe Double
      -> Maybe [ICD10CMTrait]
      -> Maybe ICD10CMRelationshipType
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMAttributeType
      -> ICD10CMAttribute)
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 ICD10CMEntityType
   -> Maybe Double
   -> Maybe [ICD10CMTrait]
   -> Maybe ICD10CMRelationshipType
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMAttributeType
   -> ICD10CMAttribute)
-> Parser (Maybe ICD10CMEntityType)
-> Parser
     (Maybe Double
      -> Maybe [ICD10CMTrait]
      -> Maybe ICD10CMRelationshipType
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMAttributeType
      -> ICD10CMAttribute)
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
"Category")
            Parser
  (Maybe Double
   -> Maybe [ICD10CMTrait]
   -> Maybe ICD10CMRelationshipType
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMAttributeType
   -> ICD10CMAttribute)
-> Parser (Maybe Double)
-> Parser
     (Maybe [ICD10CMTrait]
      -> Maybe ICD10CMRelationshipType
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMAttributeType
      -> ICD10CMAttribute)
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 ICD10CMRelationshipType
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMAttributeType
   -> ICD10CMAttribute)
-> Parser (Maybe [ICD10CMTrait])
-> Parser
     (Maybe ICD10CMRelationshipType
      -> Maybe Int
      -> Maybe Int
      -> Maybe ICD10CMAttributeType
      -> ICD10CMAttribute)
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 ICD10CMRelationshipType
   -> Maybe Int
   -> Maybe Int
   -> Maybe ICD10CMAttributeType
   -> ICD10CMAttribute)
-> Parser (Maybe ICD10CMRelationshipType)
-> Parser
     (Maybe Int
      -> Maybe Int -> Maybe ICD10CMAttributeType -> ICD10CMAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ICD10CMRelationshipType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RelationshipType")
            Parser
  (Maybe Int
   -> Maybe Int -> Maybe ICD10CMAttributeType -> ICD10CMAttribute)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int -> Maybe ICD10CMAttributeType -> ICD10CMAttribute)
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 ICD10CMAttributeType -> ICD10CMAttribute)
-> Parser (Maybe Int)
-> Parser (Maybe ICD10CMAttributeType -> ICD10CMAttribute)
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 ICD10CMAttributeType -> ICD10CMAttribute)
-> Parser (Maybe ICD10CMAttributeType) -> Parser ICD10CMAttribute
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ICD10CMAttributeType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
      )

instance Prelude.Hashable ICD10CMAttribute

instance Prelude.NFData ICD10CMAttribute