{-# 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.RxNormTrait where
import Amazonka.ComprehendMedical.Types.RxNormTraitName
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 RxNormTrait = RxNormTrait'
{
RxNormTrait -> Maybe RxNormTraitName
name :: Prelude.Maybe RxNormTraitName,
RxNormTrait -> Maybe Double
score :: Prelude.Maybe Prelude.Double
}
deriving (RxNormTrait -> RxNormTrait -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RxNormTrait -> RxNormTrait -> Bool
$c/= :: RxNormTrait -> RxNormTrait -> Bool
== :: RxNormTrait -> RxNormTrait -> Bool
$c== :: RxNormTrait -> RxNormTrait -> Bool
Prelude.Eq, ReadPrec [RxNormTrait]
ReadPrec RxNormTrait
Int -> ReadS RxNormTrait
ReadS [RxNormTrait]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RxNormTrait]
$creadListPrec :: ReadPrec [RxNormTrait]
readPrec :: ReadPrec RxNormTrait
$creadPrec :: ReadPrec RxNormTrait
readList :: ReadS [RxNormTrait]
$creadList :: ReadS [RxNormTrait]
readsPrec :: Int -> ReadS RxNormTrait
$creadsPrec :: Int -> ReadS RxNormTrait
Prelude.Read, Int -> RxNormTrait -> ShowS
[RxNormTrait] -> ShowS
RxNormTrait -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RxNormTrait] -> ShowS
$cshowList :: [RxNormTrait] -> ShowS
show :: RxNormTrait -> String
$cshow :: RxNormTrait -> String
showsPrec :: Int -> RxNormTrait -> ShowS
$cshowsPrec :: Int -> RxNormTrait -> ShowS
Prelude.Show, forall x. Rep RxNormTrait x -> RxNormTrait
forall x. RxNormTrait -> Rep RxNormTrait x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RxNormTrait x -> RxNormTrait
$cfrom :: forall x. RxNormTrait -> Rep RxNormTrait x
Prelude.Generic)
newRxNormTrait ::
RxNormTrait
newRxNormTrait :: RxNormTrait
newRxNormTrait =
RxNormTrait'
{ $sel:name:RxNormTrait' :: Maybe RxNormTraitName
name = forall a. Maybe a
Prelude.Nothing,
$sel:score:RxNormTrait' :: Maybe Double
score = forall a. Maybe a
Prelude.Nothing
}
rxNormTrait_name :: Lens.Lens' RxNormTrait (Prelude.Maybe RxNormTraitName)
rxNormTrait_name :: Lens' RxNormTrait (Maybe RxNormTraitName)
rxNormTrait_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormTrait' {Maybe RxNormTraitName
name :: Maybe RxNormTraitName
$sel:name:RxNormTrait' :: RxNormTrait -> Maybe RxNormTraitName
name} -> Maybe RxNormTraitName
name) (\s :: RxNormTrait
s@RxNormTrait' {} Maybe RxNormTraitName
a -> RxNormTrait
s {$sel:name:RxNormTrait' :: Maybe RxNormTraitName
name = Maybe RxNormTraitName
a} :: RxNormTrait)
rxNormTrait_score :: Lens.Lens' RxNormTrait (Prelude.Maybe Prelude.Double)
rxNormTrait_score :: Lens' RxNormTrait (Maybe Double)
rxNormTrait_score = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormTrait' {Maybe Double
score :: Maybe Double
$sel:score:RxNormTrait' :: RxNormTrait -> Maybe Double
score} -> Maybe Double
score) (\s :: RxNormTrait
s@RxNormTrait' {} Maybe Double
a -> RxNormTrait
s {$sel:score:RxNormTrait' :: Maybe Double
score = Maybe Double
a} :: RxNormTrait)
instance Data.FromJSON RxNormTrait where
parseJSON :: Value -> Parser RxNormTrait
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RxNormTrait"
( \Object
x ->
Maybe RxNormTraitName -> Maybe Double -> RxNormTrait
RxNormTrait'
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
"Name")
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")
)
instance Prelude.Hashable RxNormTrait where
hashWithSalt :: Int -> RxNormTrait -> Int
hashWithSalt Int
_salt RxNormTrait' {Maybe Double
Maybe RxNormTraitName
score :: Maybe Double
name :: Maybe RxNormTraitName
$sel:score:RxNormTrait' :: RxNormTrait -> Maybe Double
$sel:name:RxNormTrait' :: RxNormTrait -> Maybe RxNormTraitName
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RxNormTraitName
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
score
instance Prelude.NFData RxNormTrait where
rnf :: RxNormTrait -> ()
rnf RxNormTrait' {Maybe Double
Maybe RxNormTraitName
score :: Maybe Double
name :: Maybe RxNormTraitName
$sel:score:RxNormTrait' :: RxNormTrait -> Maybe Double
$sel:name:RxNormTrait' :: RxNormTrait -> Maybe RxNormTraitName
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe RxNormTraitName
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
score