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

import Amazonka.ComprehendMedical.Types.SNOMEDCTAttributeType
import Amazonka.ComprehendMedical.Types.SNOMEDCTConcept
import Amazonka.ComprehendMedical.Types.SNOMEDCTEntityCategory
import Amazonka.ComprehendMedical.Types.SNOMEDCTRelationshipType
import Amazonka.ComprehendMedical.Types.SNOMEDCTTrait
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 extracted attributes that relate to an entity. An extracted segment
-- of the text that is an attribute of an entity, or otherwise related to
-- an entity, such as the dosage of a medication taken.
--
-- /See:/ 'newSNOMEDCTAttribute' smart constructor.
data SNOMEDCTAttribute = SNOMEDCTAttribute'
  { -- | 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.
    SNOMEDCTAttribute -> Maybe Int
beginOffset :: Prelude.Maybe Prelude.Int,
    -- | The category of the detected attribute. Possible categories include
    -- MEDICAL_CONDITION, ANATOMY, and TEST_TREATMENT_PROCEDURE.
    SNOMEDCTAttribute -> Maybe SNOMEDCTEntityCategory
category :: Prelude.Maybe SNOMEDCTEntityCategory,
    -- | 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.
    SNOMEDCTAttribute -> 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.
    SNOMEDCTAttribute -> Maybe Int
id :: Prelude.Maybe Prelude.Int,
    -- | The level of confidence that Comprehend Medical has that this attribute
    -- is correctly related to this entity.
    SNOMEDCTAttribute -> Maybe Double
relationshipScore :: Prelude.Maybe Prelude.Double,
    -- | The type of relationship that exists between the entity and the related
    -- attribute.
    SNOMEDCTAttribute -> Maybe SNOMEDCTRelationshipType
relationshipType :: Prelude.Maybe SNOMEDCTRelationshipType,
    -- | The SNOMED-CT concepts specific to an attribute, along with a score
    -- indicating the likelihood of the match.
    SNOMEDCTAttribute -> Maybe [SNOMEDCTConcept]
sNOMEDCTConcepts :: Prelude.Maybe [SNOMEDCTConcept],
    -- | The level of confidence that Comprehend Medical has that the segment of
    -- text is correctly recognized as an attribute.
    SNOMEDCTAttribute -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
    -- | The segment of input text extracted as this attribute.
    SNOMEDCTAttribute -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
    -- | Contextual information for an attribute. Examples include signs,
    -- symptoms, diagnosis, and negation.
    SNOMEDCTAttribute -> Maybe [SNOMEDCTTrait]
traits :: Prelude.Maybe [SNOMEDCTTrait],
    -- | The type of attribute. Possible types include DX_NAME, ACUITY,
    -- DIRECTION, SYSTEM_ORGAN_SITE,TEST_NAME, TEST_VALUE, TEST_UNIT,
    -- PROCEDURE_NAME, and TREATMENT_NAME.
    SNOMEDCTAttribute -> Maybe SNOMEDCTAttributeType
type' :: Prelude.Maybe SNOMEDCTAttributeType
  }
  deriving (SNOMEDCTAttribute -> SNOMEDCTAttribute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SNOMEDCTAttribute -> SNOMEDCTAttribute -> Bool
$c/= :: SNOMEDCTAttribute -> SNOMEDCTAttribute -> Bool
== :: SNOMEDCTAttribute -> SNOMEDCTAttribute -> Bool
$c== :: SNOMEDCTAttribute -> SNOMEDCTAttribute -> Bool
Prelude.Eq, ReadPrec [SNOMEDCTAttribute]
ReadPrec SNOMEDCTAttribute
Int -> ReadS SNOMEDCTAttribute
ReadS [SNOMEDCTAttribute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SNOMEDCTAttribute]
$creadListPrec :: ReadPrec [SNOMEDCTAttribute]
readPrec :: ReadPrec SNOMEDCTAttribute
$creadPrec :: ReadPrec SNOMEDCTAttribute
readList :: ReadS [SNOMEDCTAttribute]
$creadList :: ReadS [SNOMEDCTAttribute]
readsPrec :: Int -> ReadS SNOMEDCTAttribute
$creadsPrec :: Int -> ReadS SNOMEDCTAttribute
Prelude.Read, Int -> SNOMEDCTAttribute -> ShowS
[SNOMEDCTAttribute] -> ShowS
SNOMEDCTAttribute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SNOMEDCTAttribute] -> ShowS
$cshowList :: [SNOMEDCTAttribute] -> ShowS
show :: SNOMEDCTAttribute -> String
$cshow :: SNOMEDCTAttribute -> String
showsPrec :: Int -> SNOMEDCTAttribute -> ShowS
$cshowsPrec :: Int -> SNOMEDCTAttribute -> ShowS
Prelude.Show, forall x. Rep SNOMEDCTAttribute x -> SNOMEDCTAttribute
forall x. SNOMEDCTAttribute -> Rep SNOMEDCTAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SNOMEDCTAttribute x -> SNOMEDCTAttribute
$cfrom :: forall x. SNOMEDCTAttribute -> Rep SNOMEDCTAttribute x
Prelude.Generic)

-- |
-- Create a value of 'SNOMEDCTAttribute' 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:
--
-- 'beginOffset', 'sNOMEDCTAttribute_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.
--
-- 'category', 'sNOMEDCTAttribute_category' - The category of the detected attribute. Possible categories include
-- MEDICAL_CONDITION, ANATOMY, and TEST_TREATMENT_PROCEDURE.
--
-- 'endOffset', 'sNOMEDCTAttribute_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', 'sNOMEDCTAttribute_id' - The numeric identifier for this attribute. This is a monotonically
-- increasing id unique within this response rather than a global unique
-- identifier.
--
-- 'relationshipScore', 'sNOMEDCTAttribute_relationshipScore' - The level of confidence that Comprehend Medical has that this attribute
-- is correctly related to this entity.
--
-- 'relationshipType', 'sNOMEDCTAttribute_relationshipType' - The type of relationship that exists between the entity and the related
-- attribute.
--
-- 'sNOMEDCTConcepts', 'sNOMEDCTAttribute_sNOMEDCTConcepts' - The SNOMED-CT concepts specific to an attribute, along with a score
-- indicating the likelihood of the match.
--
-- 'score', 'sNOMEDCTAttribute_score' - The level of confidence that Comprehend Medical has that the segment of
-- text is correctly recognized as an attribute.
--
-- 'text', 'sNOMEDCTAttribute_text' - The segment of input text extracted as this attribute.
--
-- 'traits', 'sNOMEDCTAttribute_traits' - Contextual information for an attribute. Examples include signs,
-- symptoms, diagnosis, and negation.
--
-- 'type'', 'sNOMEDCTAttribute_type' - The type of attribute. Possible types include DX_NAME, ACUITY,
-- DIRECTION, SYSTEM_ORGAN_SITE,TEST_NAME, TEST_VALUE, TEST_UNIT,
-- PROCEDURE_NAME, and TREATMENT_NAME.
newSNOMEDCTAttribute ::
  SNOMEDCTAttribute
newSNOMEDCTAttribute :: SNOMEDCTAttribute
newSNOMEDCTAttribute =
  SNOMEDCTAttribute'
    { $sel:beginOffset:SNOMEDCTAttribute' :: Maybe Int
beginOffset = forall a. Maybe a
Prelude.Nothing,
      $sel:category:SNOMEDCTAttribute' :: Maybe SNOMEDCTEntityCategory
category = forall a. Maybe a
Prelude.Nothing,
      $sel:endOffset:SNOMEDCTAttribute' :: Maybe Int
endOffset = forall a. Maybe a
Prelude.Nothing,
      $sel:id:SNOMEDCTAttribute' :: Maybe Int
id = forall a. Maybe a
Prelude.Nothing,
      $sel:relationshipScore:SNOMEDCTAttribute' :: Maybe Double
relationshipScore = forall a. Maybe a
Prelude.Nothing,
      $sel:relationshipType:SNOMEDCTAttribute' :: Maybe SNOMEDCTRelationshipType
relationshipType = forall a. Maybe a
Prelude.Nothing,
      $sel:sNOMEDCTConcepts:SNOMEDCTAttribute' :: Maybe [SNOMEDCTConcept]
sNOMEDCTConcepts = forall a. Maybe a
Prelude.Nothing,
      $sel:score:SNOMEDCTAttribute' :: Maybe Double
score = forall a. Maybe a
Prelude.Nothing,
      $sel:text:SNOMEDCTAttribute' :: Maybe Text
text = forall a. Maybe a
Prelude.Nothing,
      $sel:traits:SNOMEDCTAttribute' :: Maybe [SNOMEDCTTrait]
traits = forall a. Maybe a
Prelude.Nothing,
      $sel:type':SNOMEDCTAttribute' :: Maybe SNOMEDCTAttributeType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | 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.
sNOMEDCTAttribute_beginOffset :: Lens.Lens' SNOMEDCTAttribute (Prelude.Maybe Prelude.Int)
sNOMEDCTAttribute_beginOffset :: Lens' SNOMEDCTAttribute (Maybe Int)
sNOMEDCTAttribute_beginOffset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTAttribute' {Maybe Int
beginOffset :: Maybe Int
$sel:beginOffset:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Int
beginOffset} -> Maybe Int
beginOffset) (\s :: SNOMEDCTAttribute
s@SNOMEDCTAttribute' {} Maybe Int
a -> SNOMEDCTAttribute
s {$sel:beginOffset:SNOMEDCTAttribute' :: Maybe Int
beginOffset = Maybe Int
a} :: SNOMEDCTAttribute)

-- | The category of the detected attribute. Possible categories include
-- MEDICAL_CONDITION, ANATOMY, and TEST_TREATMENT_PROCEDURE.
sNOMEDCTAttribute_category :: Lens.Lens' SNOMEDCTAttribute (Prelude.Maybe SNOMEDCTEntityCategory)
sNOMEDCTAttribute_category :: Lens' SNOMEDCTAttribute (Maybe SNOMEDCTEntityCategory)
sNOMEDCTAttribute_category = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTAttribute' {Maybe SNOMEDCTEntityCategory
category :: Maybe SNOMEDCTEntityCategory
$sel:category:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe SNOMEDCTEntityCategory
category} -> Maybe SNOMEDCTEntityCategory
category) (\s :: SNOMEDCTAttribute
s@SNOMEDCTAttribute' {} Maybe SNOMEDCTEntityCategory
a -> SNOMEDCTAttribute
s {$sel:category:SNOMEDCTAttribute' :: Maybe SNOMEDCTEntityCategory
category = Maybe SNOMEDCTEntityCategory
a} :: SNOMEDCTAttribute)

-- | 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.
sNOMEDCTAttribute_endOffset :: Lens.Lens' SNOMEDCTAttribute (Prelude.Maybe Prelude.Int)
sNOMEDCTAttribute_endOffset :: Lens' SNOMEDCTAttribute (Maybe Int)
sNOMEDCTAttribute_endOffset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTAttribute' {Maybe Int
endOffset :: Maybe Int
$sel:endOffset:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Int
endOffset} -> Maybe Int
endOffset) (\s :: SNOMEDCTAttribute
s@SNOMEDCTAttribute' {} Maybe Int
a -> SNOMEDCTAttribute
s {$sel:endOffset:SNOMEDCTAttribute' :: Maybe Int
endOffset = Maybe Int
a} :: SNOMEDCTAttribute)

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

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

-- | The type of relationship that exists between the entity and the related
-- attribute.
sNOMEDCTAttribute_relationshipType :: Lens.Lens' SNOMEDCTAttribute (Prelude.Maybe SNOMEDCTRelationshipType)
sNOMEDCTAttribute_relationshipType :: Lens' SNOMEDCTAttribute (Maybe SNOMEDCTRelationshipType)
sNOMEDCTAttribute_relationshipType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTAttribute' {Maybe SNOMEDCTRelationshipType
relationshipType :: Maybe SNOMEDCTRelationshipType
$sel:relationshipType:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe SNOMEDCTRelationshipType
relationshipType} -> Maybe SNOMEDCTRelationshipType
relationshipType) (\s :: SNOMEDCTAttribute
s@SNOMEDCTAttribute' {} Maybe SNOMEDCTRelationshipType
a -> SNOMEDCTAttribute
s {$sel:relationshipType:SNOMEDCTAttribute' :: Maybe SNOMEDCTRelationshipType
relationshipType = Maybe SNOMEDCTRelationshipType
a} :: SNOMEDCTAttribute)

-- | The SNOMED-CT concepts specific to an attribute, along with a score
-- indicating the likelihood of the match.
sNOMEDCTAttribute_sNOMEDCTConcepts :: Lens.Lens' SNOMEDCTAttribute (Prelude.Maybe [SNOMEDCTConcept])
sNOMEDCTAttribute_sNOMEDCTConcepts :: Lens' SNOMEDCTAttribute (Maybe [SNOMEDCTConcept])
sNOMEDCTAttribute_sNOMEDCTConcepts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTAttribute' {Maybe [SNOMEDCTConcept]
sNOMEDCTConcepts :: Maybe [SNOMEDCTConcept]
$sel:sNOMEDCTConcepts:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe [SNOMEDCTConcept]
sNOMEDCTConcepts} -> Maybe [SNOMEDCTConcept]
sNOMEDCTConcepts) (\s :: SNOMEDCTAttribute
s@SNOMEDCTAttribute' {} Maybe [SNOMEDCTConcept]
a -> SNOMEDCTAttribute
s {$sel:sNOMEDCTConcepts:SNOMEDCTAttribute' :: Maybe [SNOMEDCTConcept]
sNOMEDCTConcepts = Maybe [SNOMEDCTConcept]
a} :: SNOMEDCTAttribute) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The segment of input text extracted as this attribute.
sNOMEDCTAttribute_text :: Lens.Lens' SNOMEDCTAttribute (Prelude.Maybe Prelude.Text)
sNOMEDCTAttribute_text :: Lens' SNOMEDCTAttribute (Maybe Text)
sNOMEDCTAttribute_text = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTAttribute' {Maybe Text
text :: Maybe Text
$sel:text:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Text
text} -> Maybe Text
text) (\s :: SNOMEDCTAttribute
s@SNOMEDCTAttribute' {} Maybe Text
a -> SNOMEDCTAttribute
s {$sel:text:SNOMEDCTAttribute' :: Maybe Text
text = Maybe Text
a} :: SNOMEDCTAttribute)

-- | Contextual information for an attribute. Examples include signs,
-- symptoms, diagnosis, and negation.
sNOMEDCTAttribute_traits :: Lens.Lens' SNOMEDCTAttribute (Prelude.Maybe [SNOMEDCTTrait])
sNOMEDCTAttribute_traits :: Lens' SNOMEDCTAttribute (Maybe [SNOMEDCTTrait])
sNOMEDCTAttribute_traits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTAttribute' {Maybe [SNOMEDCTTrait]
traits :: Maybe [SNOMEDCTTrait]
$sel:traits:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe [SNOMEDCTTrait]
traits} -> Maybe [SNOMEDCTTrait]
traits) (\s :: SNOMEDCTAttribute
s@SNOMEDCTAttribute' {} Maybe [SNOMEDCTTrait]
a -> SNOMEDCTAttribute
s {$sel:traits:SNOMEDCTAttribute' :: Maybe [SNOMEDCTTrait]
traits = Maybe [SNOMEDCTTrait]
a} :: SNOMEDCTAttribute) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of attribute. Possible types include DX_NAME, ACUITY,
-- DIRECTION, SYSTEM_ORGAN_SITE,TEST_NAME, TEST_VALUE, TEST_UNIT,
-- PROCEDURE_NAME, and TREATMENT_NAME.
sNOMEDCTAttribute_type :: Lens.Lens' SNOMEDCTAttribute (Prelude.Maybe SNOMEDCTAttributeType)
sNOMEDCTAttribute_type :: Lens' SNOMEDCTAttribute (Maybe SNOMEDCTAttributeType)
sNOMEDCTAttribute_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SNOMEDCTAttribute' {Maybe SNOMEDCTAttributeType
type' :: Maybe SNOMEDCTAttributeType
$sel:type':SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe SNOMEDCTAttributeType
type'} -> Maybe SNOMEDCTAttributeType
type') (\s :: SNOMEDCTAttribute
s@SNOMEDCTAttribute' {} Maybe SNOMEDCTAttributeType
a -> SNOMEDCTAttribute
s {$sel:type':SNOMEDCTAttribute' :: Maybe SNOMEDCTAttributeType
type' = Maybe SNOMEDCTAttributeType
a} :: SNOMEDCTAttribute)

instance Data.FromJSON SNOMEDCTAttribute where
  parseJSON :: Value -> Parser SNOMEDCTAttribute
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SNOMEDCTAttribute"
      ( \Object
x ->
          Maybe Int
-> Maybe SNOMEDCTEntityCategory
-> Maybe Int
-> Maybe Int
-> Maybe Double
-> Maybe SNOMEDCTRelationshipType
-> Maybe [SNOMEDCTConcept]
-> Maybe Double
-> Maybe Text
-> Maybe [SNOMEDCTTrait]
-> Maybe SNOMEDCTAttributeType
-> SNOMEDCTAttribute
SNOMEDCTAttribute'
            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
"BeginOffset")
            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
"Category")
            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
"EndOffset")
            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
"Id")
            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
"RelationshipScore")
            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
"RelationshipType")
            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
"SNOMEDCTConcepts"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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")
            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
"Text")
            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
"Traits" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"Type")
      )

instance Prelude.Hashable SNOMEDCTAttribute where
  hashWithSalt :: Int -> SNOMEDCTAttribute -> Int
hashWithSalt Int
_salt SNOMEDCTAttribute' {Maybe Double
Maybe Int
Maybe [SNOMEDCTConcept]
Maybe [SNOMEDCTTrait]
Maybe Text
Maybe SNOMEDCTAttributeType
Maybe SNOMEDCTEntityCategory
Maybe SNOMEDCTRelationshipType
type' :: Maybe SNOMEDCTAttributeType
traits :: Maybe [SNOMEDCTTrait]
text :: Maybe Text
score :: Maybe Double
sNOMEDCTConcepts :: Maybe [SNOMEDCTConcept]
relationshipType :: Maybe SNOMEDCTRelationshipType
relationshipScore :: Maybe Double
id :: Maybe Int
endOffset :: Maybe Int
category :: Maybe SNOMEDCTEntityCategory
beginOffset :: Maybe Int
$sel:type':SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe SNOMEDCTAttributeType
$sel:traits:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe [SNOMEDCTTrait]
$sel:text:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Text
$sel:score:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Double
$sel:sNOMEDCTConcepts:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe [SNOMEDCTConcept]
$sel:relationshipType:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe SNOMEDCTRelationshipType
$sel:relationshipScore:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Double
$sel:id:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Int
$sel:endOffset:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Int
$sel:category:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe SNOMEDCTEntityCategory
$sel:beginOffset:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
beginOffset
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SNOMEDCTEntityCategory
category
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
endOffset
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
relationshipScore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SNOMEDCTRelationshipType
relationshipType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SNOMEDCTConcept]
sNOMEDCTConcepts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
score
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
text
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SNOMEDCTTrait]
traits
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SNOMEDCTAttributeType
type'

instance Prelude.NFData SNOMEDCTAttribute where
  rnf :: SNOMEDCTAttribute -> ()
rnf SNOMEDCTAttribute' {Maybe Double
Maybe Int
Maybe [SNOMEDCTConcept]
Maybe [SNOMEDCTTrait]
Maybe Text
Maybe SNOMEDCTAttributeType
Maybe SNOMEDCTEntityCategory
Maybe SNOMEDCTRelationshipType
type' :: Maybe SNOMEDCTAttributeType
traits :: Maybe [SNOMEDCTTrait]
text :: Maybe Text
score :: Maybe Double
sNOMEDCTConcepts :: Maybe [SNOMEDCTConcept]
relationshipType :: Maybe SNOMEDCTRelationshipType
relationshipScore :: Maybe Double
id :: Maybe Int
endOffset :: Maybe Int
category :: Maybe SNOMEDCTEntityCategory
beginOffset :: Maybe Int
$sel:type':SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe SNOMEDCTAttributeType
$sel:traits:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe [SNOMEDCTTrait]
$sel:text:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Text
$sel:score:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Double
$sel:sNOMEDCTConcepts:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe [SNOMEDCTConcept]
$sel:relationshipType:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe SNOMEDCTRelationshipType
$sel:relationshipScore:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Double
$sel:id:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Int
$sel:endOffset:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Int
$sel:category:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe SNOMEDCTEntityCategory
$sel:beginOffset:SNOMEDCTAttribute' :: SNOMEDCTAttribute -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
beginOffset
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SNOMEDCTEntityCategory
category
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
endOffset
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
relationshipScore
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SNOMEDCTRelationshipType
relationshipType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SNOMEDCTConcept]
sNOMEDCTConcepts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
score
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
text
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SNOMEDCTTrait]
traits
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SNOMEDCTAttributeType
type'