{-# 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.RxNormConcept where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RxNormConcept = RxNormConcept'
{
RxNormConcept -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
RxNormConcept -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
RxNormConcept -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (RxNormConcept -> RxNormConcept -> Bool
(RxNormConcept -> RxNormConcept -> Bool)
-> (RxNormConcept -> RxNormConcept -> Bool) -> Eq RxNormConcept
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RxNormConcept -> RxNormConcept -> Bool
$c/= :: RxNormConcept -> RxNormConcept -> Bool
== :: RxNormConcept -> RxNormConcept -> Bool
$c== :: RxNormConcept -> RxNormConcept -> Bool
Prelude.Eq, ReadPrec [RxNormConcept]
ReadPrec RxNormConcept
Int -> ReadS RxNormConcept
ReadS [RxNormConcept]
(Int -> ReadS RxNormConcept)
-> ReadS [RxNormConcept]
-> ReadPrec RxNormConcept
-> ReadPrec [RxNormConcept]
-> Read RxNormConcept
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RxNormConcept]
$creadListPrec :: ReadPrec [RxNormConcept]
readPrec :: ReadPrec RxNormConcept
$creadPrec :: ReadPrec RxNormConcept
readList :: ReadS [RxNormConcept]
$creadList :: ReadS [RxNormConcept]
readsPrec :: Int -> ReadS RxNormConcept
$creadsPrec :: Int -> ReadS RxNormConcept
Prelude.Read, Int -> RxNormConcept -> ShowS
[RxNormConcept] -> ShowS
RxNormConcept -> String
(Int -> RxNormConcept -> ShowS)
-> (RxNormConcept -> String)
-> ([RxNormConcept] -> ShowS)
-> Show RxNormConcept
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RxNormConcept] -> ShowS
$cshowList :: [RxNormConcept] -> ShowS
show :: RxNormConcept -> String
$cshow :: RxNormConcept -> String
showsPrec :: Int -> RxNormConcept -> ShowS
$cshowsPrec :: Int -> RxNormConcept -> ShowS
Prelude.Show, (forall x. RxNormConcept -> Rep RxNormConcept x)
-> (forall x. Rep RxNormConcept x -> RxNormConcept)
-> Generic RxNormConcept
forall x. Rep RxNormConcept x -> RxNormConcept
forall x. RxNormConcept -> Rep RxNormConcept x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RxNormConcept x -> RxNormConcept
$cfrom :: forall x. RxNormConcept -> Rep RxNormConcept x
Prelude.Generic)
newRxNormConcept ::
RxNormConcept
newRxNormConcept :: RxNormConcept
newRxNormConcept =
RxNormConcept' :: Maybe Double -> Maybe Text -> Maybe Text -> RxNormConcept
RxNormConcept'
{ $sel:score:RxNormConcept' :: Maybe Double
score = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:code:RxNormConcept' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:RxNormConcept' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
rxNormConcept_score :: Lens.Lens' RxNormConcept (Prelude.Maybe Prelude.Double)
rxNormConcept_score :: (Maybe Double -> f (Maybe Double))
-> RxNormConcept -> f RxNormConcept
rxNormConcept_score = (RxNormConcept -> Maybe Double)
-> (RxNormConcept -> Maybe Double -> RxNormConcept)
-> Lens RxNormConcept RxNormConcept (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormConcept' {Maybe Double
score :: Maybe Double
$sel:score:RxNormConcept' :: RxNormConcept -> Maybe Double
score} -> Maybe Double
score) (\s :: RxNormConcept
s@RxNormConcept' {} Maybe Double
a -> RxNormConcept
s {$sel:score:RxNormConcept' :: Maybe Double
score = Maybe Double
a} :: RxNormConcept)
rxNormConcept_code :: Lens.Lens' RxNormConcept (Prelude.Maybe Prelude.Text)
rxNormConcept_code :: (Maybe Text -> f (Maybe Text)) -> RxNormConcept -> f RxNormConcept
rxNormConcept_code = (RxNormConcept -> Maybe Text)
-> (RxNormConcept -> Maybe Text -> RxNormConcept)
-> Lens RxNormConcept RxNormConcept (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormConcept' {Maybe Text
code :: Maybe Text
$sel:code:RxNormConcept' :: RxNormConcept -> Maybe Text
code} -> Maybe Text
code) (\s :: RxNormConcept
s@RxNormConcept' {} Maybe Text
a -> RxNormConcept
s {$sel:code:RxNormConcept' :: Maybe Text
code = Maybe Text
a} :: RxNormConcept)
rxNormConcept_description :: Lens.Lens' RxNormConcept (Prelude.Maybe Prelude.Text)
rxNormConcept_description :: (Maybe Text -> f (Maybe Text)) -> RxNormConcept -> f RxNormConcept
rxNormConcept_description = (RxNormConcept -> Maybe Text)
-> (RxNormConcept -> Maybe Text -> RxNormConcept)
-> Lens RxNormConcept RxNormConcept (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormConcept' {Maybe Text
description :: Maybe Text
$sel:description:RxNormConcept' :: RxNormConcept -> Maybe Text
description} -> Maybe Text
description) (\s :: RxNormConcept
s@RxNormConcept' {} Maybe Text
a -> RxNormConcept
s {$sel:description:RxNormConcept' :: Maybe Text
description = Maybe Text
a} :: RxNormConcept)
instance Core.FromJSON RxNormConcept where
parseJSON :: Value -> Parser RxNormConcept
parseJSON =
String
-> (Object -> Parser RxNormConcept)
-> Value
-> Parser RxNormConcept
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RxNormConcept"
( \Object
x ->
Maybe Double -> Maybe Text -> Maybe Text -> RxNormConcept
RxNormConcept'
(Maybe Double -> Maybe Text -> Maybe Text -> RxNormConcept)
-> Parser (Maybe Double)
-> Parser (Maybe Text -> Maybe Text -> RxNormConcept)
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 Text -> Maybe Text -> RxNormConcept)
-> Parser (Maybe Text) -> Parser (Maybe Text -> RxNormConcept)
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
"Code")
Parser (Maybe Text -> RxNormConcept)
-> Parser (Maybe Text) -> Parser RxNormConcept
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
"Description")
)
instance Prelude.Hashable RxNormConcept
instance Prelude.NFData RxNormConcept