{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RxNormTrait = RxNormTrait'
{
RxNormTrait -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
RxNormTrait -> Maybe RxNormTraitName
name :: Prelude.Maybe RxNormTraitName
}
deriving (RxNormTrait -> RxNormTrait -> Bool
(RxNormTrait -> RxNormTrait -> Bool)
-> (RxNormTrait -> RxNormTrait -> Bool) -> Eq RxNormTrait
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]
(Int -> ReadS RxNormTrait)
-> ReadS [RxNormTrait]
-> ReadPrec RxNormTrait
-> ReadPrec [RxNormTrait]
-> Read 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
(Int -> RxNormTrait -> ShowS)
-> (RxNormTrait -> String)
-> ([RxNormTrait] -> ShowS)
-> Show RxNormTrait
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. RxNormTrait -> Rep RxNormTrait x)
-> (forall x. Rep RxNormTrait x -> RxNormTrait)
-> Generic RxNormTrait
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' :: Maybe Double -> Maybe RxNormTraitName -> RxNormTrait
RxNormTrait'
{ $sel:score:RxNormTrait' :: Maybe Double
score = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:name:RxNormTrait' :: Maybe RxNormTraitName
name = Maybe RxNormTraitName
forall a. Maybe a
Prelude.Nothing
}
rxNormTrait_score :: Lens.Lens' RxNormTrait (Prelude.Maybe Prelude.Double)
rxNormTrait_score :: (Maybe Double -> f (Maybe Double)) -> RxNormTrait -> f RxNormTrait
rxNormTrait_score = (RxNormTrait -> Maybe Double)
-> (RxNormTrait -> Maybe Double -> RxNormTrait)
-> Lens RxNormTrait RxNormTrait (Maybe Double) (Maybe Double)
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)
rxNormTrait_name :: Lens.Lens' RxNormTrait (Prelude.Maybe RxNormTraitName)
rxNormTrait_name :: (Maybe RxNormTraitName -> f (Maybe RxNormTraitName))
-> RxNormTrait -> f RxNormTrait
rxNormTrait_name = (RxNormTrait -> Maybe RxNormTraitName)
-> (RxNormTrait -> Maybe RxNormTraitName -> RxNormTrait)
-> Lens
RxNormTrait
RxNormTrait
(Maybe RxNormTraitName)
(Maybe RxNormTraitName)
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)
instance Core.FromJSON RxNormTrait where
parseJSON :: Value -> Parser RxNormTrait
parseJSON =
String
-> (Object -> Parser RxNormTrait) -> Value -> Parser RxNormTrait
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RxNormTrait"
( \Object
x ->
Maybe Double -> Maybe RxNormTraitName -> RxNormTrait
RxNormTrait'
(Maybe Double -> Maybe RxNormTraitName -> RxNormTrait)
-> Parser (Maybe Double)
-> Parser (Maybe RxNormTraitName -> RxNormTrait)
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
"Score") Parser (Maybe RxNormTraitName -> RxNormTrait)
-> Parser (Maybe RxNormTraitName) -> Parser RxNormTrait
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RxNormTraitName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
)
instance Prelude.Hashable RxNormTrait
instance Prelude.NFData RxNormTrait