{-# 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 #-}
module Amazonka.ComprehendMedical.Types.RxNormAttribute where
import Amazonka.ComprehendMedical.Types.RxNormAttributeType
import Amazonka.ComprehendMedical.Types.RxNormTrait
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
data RxNormAttribute = RxNormAttribute'
{
RxNormAttribute -> Maybe Int
beginOffset :: Prelude.Maybe Prelude.Int,
RxNormAttribute -> Maybe Int
endOffset :: Prelude.Maybe Prelude.Int,
RxNormAttribute -> Maybe Int
id :: Prelude.Maybe Prelude.Int,
RxNormAttribute -> Maybe Double
relationshipScore :: Prelude.Maybe Prelude.Double,
RxNormAttribute -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
RxNormAttribute -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
RxNormAttribute -> Maybe [RxNormTrait]
traits :: Prelude.Maybe [RxNormTrait],
RxNormAttribute -> Maybe RxNormAttributeType
type' :: Prelude.Maybe RxNormAttributeType
}
deriving (RxNormAttribute -> RxNormAttribute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RxNormAttribute -> RxNormAttribute -> Bool
$c/= :: RxNormAttribute -> RxNormAttribute -> Bool
== :: RxNormAttribute -> RxNormAttribute -> Bool
$c== :: RxNormAttribute -> RxNormAttribute -> Bool
Prelude.Eq, ReadPrec [RxNormAttribute]
ReadPrec RxNormAttribute
Int -> ReadS RxNormAttribute
ReadS [RxNormAttribute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RxNormAttribute]
$creadListPrec :: ReadPrec [RxNormAttribute]
readPrec :: ReadPrec RxNormAttribute
$creadPrec :: ReadPrec RxNormAttribute
readList :: ReadS [RxNormAttribute]
$creadList :: ReadS [RxNormAttribute]
readsPrec :: Int -> ReadS RxNormAttribute
$creadsPrec :: Int -> ReadS RxNormAttribute
Prelude.Read, Int -> RxNormAttribute -> ShowS
[RxNormAttribute] -> ShowS
RxNormAttribute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RxNormAttribute] -> ShowS
$cshowList :: [RxNormAttribute] -> ShowS
show :: RxNormAttribute -> String
$cshow :: RxNormAttribute -> String
showsPrec :: Int -> RxNormAttribute -> ShowS
$cshowsPrec :: Int -> RxNormAttribute -> ShowS
Prelude.Show, forall x. Rep RxNormAttribute x -> RxNormAttribute
forall x. RxNormAttribute -> Rep RxNormAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RxNormAttribute x -> RxNormAttribute
$cfrom :: forall x. RxNormAttribute -> Rep RxNormAttribute x
Prelude.Generic)
newRxNormAttribute ::
RxNormAttribute
newRxNormAttribute :: RxNormAttribute
newRxNormAttribute =
RxNormAttribute'
{ $sel:beginOffset:RxNormAttribute' :: Maybe Int
beginOffset = forall a. Maybe a
Prelude.Nothing,
$sel:endOffset:RxNormAttribute' :: Maybe Int
endOffset = forall a. Maybe a
Prelude.Nothing,
$sel:id:RxNormAttribute' :: Maybe Int
id = forall a. Maybe a
Prelude.Nothing,
$sel:relationshipScore:RxNormAttribute' :: Maybe Double
relationshipScore = forall a. Maybe a
Prelude.Nothing,
$sel:score:RxNormAttribute' :: Maybe Double
score = forall a. Maybe a
Prelude.Nothing,
$sel:text:RxNormAttribute' :: Maybe Text
text = forall a. Maybe a
Prelude.Nothing,
$sel:traits:RxNormAttribute' :: Maybe [RxNormTrait]
traits = forall a. Maybe a
Prelude.Nothing,
$sel:type':RxNormAttribute' :: Maybe RxNormAttributeType
type' = forall a. Maybe a
Prelude.Nothing
}
rxNormAttribute_beginOffset :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Int)
rxNormAttribute_beginOffset :: Lens' RxNormAttribute (Maybe Int)
rxNormAttribute_beginOffset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormAttribute' {Maybe Int
beginOffset :: Maybe Int
$sel:beginOffset:RxNormAttribute' :: RxNormAttribute -> Maybe Int
beginOffset} -> Maybe Int
beginOffset) (\s :: RxNormAttribute
s@RxNormAttribute' {} Maybe Int
a -> RxNormAttribute
s {$sel:beginOffset:RxNormAttribute' :: Maybe Int
beginOffset = Maybe Int
a} :: RxNormAttribute)
rxNormAttribute_endOffset :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Int)
rxNormAttribute_endOffset :: Lens' RxNormAttribute (Maybe Int)
rxNormAttribute_endOffset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormAttribute' {Maybe Int
endOffset :: Maybe Int
$sel:endOffset:RxNormAttribute' :: RxNormAttribute -> Maybe Int
endOffset} -> Maybe Int
endOffset) (\s :: RxNormAttribute
s@RxNormAttribute' {} Maybe Int
a -> RxNormAttribute
s {$sel:endOffset:RxNormAttribute' :: Maybe Int
endOffset = Maybe Int
a} :: RxNormAttribute)
rxNormAttribute_id :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Int)
rxNormAttribute_id :: Lens' RxNormAttribute (Maybe Int)
rxNormAttribute_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormAttribute' {Maybe Int
id :: Maybe Int
$sel:id:RxNormAttribute' :: RxNormAttribute -> Maybe Int
id} -> Maybe Int
id) (\s :: RxNormAttribute
s@RxNormAttribute' {} Maybe Int
a -> RxNormAttribute
s {$sel:id:RxNormAttribute' :: Maybe Int
id = Maybe Int
a} :: RxNormAttribute)
rxNormAttribute_relationshipScore :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Double)
rxNormAttribute_relationshipScore :: Lens' RxNormAttribute (Maybe Double)
rxNormAttribute_relationshipScore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormAttribute' {Maybe Double
relationshipScore :: Maybe Double
$sel:relationshipScore:RxNormAttribute' :: RxNormAttribute -> Maybe Double
relationshipScore} -> Maybe Double
relationshipScore) (\s :: RxNormAttribute
s@RxNormAttribute' {} Maybe Double
a -> RxNormAttribute
s {$sel:relationshipScore:RxNormAttribute' :: Maybe Double
relationshipScore = Maybe Double
a} :: RxNormAttribute)
rxNormAttribute_score :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Double)
rxNormAttribute_score :: Lens' RxNormAttribute (Maybe Double)
rxNormAttribute_score = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormAttribute' {Maybe Double
score :: Maybe Double
$sel:score:RxNormAttribute' :: RxNormAttribute -> Maybe Double
score} -> Maybe Double
score) (\s :: RxNormAttribute
s@RxNormAttribute' {} Maybe Double
a -> RxNormAttribute
s {$sel:score:RxNormAttribute' :: Maybe Double
score = Maybe Double
a} :: RxNormAttribute)
rxNormAttribute_text :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Text)
rxNormAttribute_text :: Lens' RxNormAttribute (Maybe Text)
rxNormAttribute_text = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormAttribute' {Maybe Text
text :: Maybe Text
$sel:text:RxNormAttribute' :: RxNormAttribute -> Maybe Text
text} -> Maybe Text
text) (\s :: RxNormAttribute
s@RxNormAttribute' {} Maybe Text
a -> RxNormAttribute
s {$sel:text:RxNormAttribute' :: Maybe Text
text = Maybe Text
a} :: RxNormAttribute)
rxNormAttribute_traits :: Lens.Lens' RxNormAttribute (Prelude.Maybe [RxNormTrait])
rxNormAttribute_traits :: Lens' RxNormAttribute (Maybe [RxNormTrait])
rxNormAttribute_traits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormAttribute' {Maybe [RxNormTrait]
traits :: Maybe [RxNormTrait]
$sel:traits:RxNormAttribute' :: RxNormAttribute -> Maybe [RxNormTrait]
traits} -> Maybe [RxNormTrait]
traits) (\s :: RxNormAttribute
s@RxNormAttribute' {} Maybe [RxNormTrait]
a -> RxNormAttribute
s {$sel:traits:RxNormAttribute' :: Maybe [RxNormTrait]
traits = Maybe [RxNormTrait]
a} :: RxNormAttribute) 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
rxNormAttribute_type :: Lens.Lens' RxNormAttribute (Prelude.Maybe RxNormAttributeType)
rxNormAttribute_type :: Lens' RxNormAttribute (Maybe RxNormAttributeType)
rxNormAttribute_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormAttribute' {Maybe RxNormAttributeType
type' :: Maybe RxNormAttributeType
$sel:type':RxNormAttribute' :: RxNormAttribute -> Maybe RxNormAttributeType
type'} -> Maybe RxNormAttributeType
type') (\s :: RxNormAttribute
s@RxNormAttribute' {} Maybe RxNormAttributeType
a -> RxNormAttribute
s {$sel:type':RxNormAttribute' :: Maybe RxNormAttributeType
type' = Maybe RxNormAttributeType
a} :: RxNormAttribute)
instance Data.FromJSON RxNormAttribute where
parseJSON :: Value -> Parser RxNormAttribute
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RxNormAttribute"
( \Object
x ->
Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Text
-> Maybe [RxNormTrait]
-> Maybe RxNormAttributeType
-> RxNormAttribute
RxNormAttribute'
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
"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
"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 RxNormAttribute where
hashWithSalt :: Int -> RxNormAttribute -> Int
hashWithSalt Int
_salt RxNormAttribute' {Maybe Double
Maybe Int
Maybe [RxNormTrait]
Maybe Text
Maybe RxNormAttributeType
type' :: Maybe RxNormAttributeType
traits :: Maybe [RxNormTrait]
text :: Maybe Text
score :: Maybe Double
relationshipScore :: Maybe Double
id :: Maybe Int
endOffset :: Maybe Int
beginOffset :: Maybe Int
$sel:type':RxNormAttribute' :: RxNormAttribute -> Maybe RxNormAttributeType
$sel:traits:RxNormAttribute' :: RxNormAttribute -> Maybe [RxNormTrait]
$sel:text:RxNormAttribute' :: RxNormAttribute -> Maybe Text
$sel:score:RxNormAttribute' :: RxNormAttribute -> Maybe Double
$sel:relationshipScore:RxNormAttribute' :: RxNormAttribute -> Maybe Double
$sel:id:RxNormAttribute' :: RxNormAttribute -> Maybe Int
$sel:endOffset:RxNormAttribute' :: RxNormAttribute -> Maybe Int
$sel:beginOffset:RxNormAttribute' :: RxNormAttribute -> 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 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 Double
score
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
text
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RxNormTrait]
traits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RxNormAttributeType
type'
instance Prelude.NFData RxNormAttribute where
rnf :: RxNormAttribute -> ()
rnf RxNormAttribute' {Maybe Double
Maybe Int
Maybe [RxNormTrait]
Maybe Text
Maybe RxNormAttributeType
type' :: Maybe RxNormAttributeType
traits :: Maybe [RxNormTrait]
text :: Maybe Text
score :: Maybe Double
relationshipScore :: Maybe Double
id :: Maybe Int
endOffset :: Maybe Int
beginOffset :: Maybe Int
$sel:type':RxNormAttribute' :: RxNormAttribute -> Maybe RxNormAttributeType
$sel:traits:RxNormAttribute' :: RxNormAttribute -> Maybe [RxNormTrait]
$sel:text:RxNormAttribute' :: RxNormAttribute -> Maybe Text
$sel:score:RxNormAttribute' :: RxNormAttribute -> Maybe Double
$sel:relationshipScore:RxNormAttribute' :: RxNormAttribute -> Maybe Double
$sel:id:RxNormAttribute' :: RxNormAttribute -> Maybe Int
$sel:endOffset:RxNormAttribute' :: RxNormAttribute -> Maybe Int
$sel:beginOffset:RxNormAttribute' :: RxNormAttribute -> 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 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 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 [RxNormTrait]
traits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RxNormAttributeType
type'