{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RxNormAttribute = RxNormAttribute'
{
RxNormAttribute -> Maybe Double
relationshipScore :: Prelude.Maybe Prelude.Double,
RxNormAttribute -> Maybe Int
beginOffset :: Prelude.Maybe Prelude.Int,
RxNormAttribute -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
RxNormAttribute -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
RxNormAttribute -> Maybe [RxNormTrait]
traits :: Prelude.Maybe [RxNormTrait],
RxNormAttribute -> Maybe Int
endOffset :: Prelude.Maybe Prelude.Int,
RxNormAttribute -> Maybe Int
id :: Prelude.Maybe Prelude.Int,
RxNormAttribute -> Maybe RxNormAttributeType
type' :: Prelude.Maybe RxNormAttributeType
}
deriving (RxNormAttribute -> RxNormAttribute -> Bool
(RxNormAttribute -> RxNormAttribute -> Bool)
-> (RxNormAttribute -> RxNormAttribute -> Bool)
-> Eq RxNormAttribute
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]
(Int -> ReadS RxNormAttribute)
-> ReadS [RxNormAttribute]
-> ReadPrec RxNormAttribute
-> ReadPrec [RxNormAttribute]
-> Read 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
(Int -> RxNormAttribute -> ShowS)
-> (RxNormAttribute -> String)
-> ([RxNormAttribute] -> ShowS)
-> Show RxNormAttribute
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. RxNormAttribute -> Rep RxNormAttribute x)
-> (forall x. Rep RxNormAttribute x -> RxNormAttribute)
-> Generic RxNormAttribute
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' :: Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute
RxNormAttribute'
{ $sel:relationshipScore:RxNormAttribute' :: Maybe Double
relationshipScore =
Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:beginOffset:RxNormAttribute' :: Maybe Int
beginOffset = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:text:RxNormAttribute' :: Maybe Text
text = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:score:RxNormAttribute' :: Maybe Double
score = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:traits:RxNormAttribute' :: Maybe [RxNormTrait]
traits = Maybe [RxNormTrait]
forall a. Maybe a
Prelude.Nothing,
$sel:endOffset:RxNormAttribute' :: Maybe Int
endOffset = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:id:RxNormAttribute' :: Maybe Int
id = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:type':RxNormAttribute' :: Maybe RxNormAttributeType
type' = Maybe RxNormAttributeType
forall a. Maybe a
Prelude.Nothing
}
rxNormAttribute_relationshipScore :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Double)
rxNormAttribute_relationshipScore :: (Maybe Double -> f (Maybe Double))
-> RxNormAttribute -> f RxNormAttribute
rxNormAttribute_relationshipScore = (RxNormAttribute -> Maybe Double)
-> (RxNormAttribute -> Maybe Double -> RxNormAttribute)
-> Lens
RxNormAttribute RxNormAttribute (Maybe Double) (Maybe Double)
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_beginOffset :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Int)
rxNormAttribute_beginOffset :: (Maybe Int -> f (Maybe Int))
-> RxNormAttribute -> f RxNormAttribute
rxNormAttribute_beginOffset = (RxNormAttribute -> Maybe Int)
-> (RxNormAttribute -> Maybe Int -> RxNormAttribute)
-> Lens RxNormAttribute RxNormAttribute (Maybe Int) (Maybe Int)
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_text :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Text)
rxNormAttribute_text :: (Maybe Text -> f (Maybe Text))
-> RxNormAttribute -> f RxNormAttribute
rxNormAttribute_text = (RxNormAttribute -> Maybe Text)
-> (RxNormAttribute -> Maybe Text -> RxNormAttribute)
-> Lens RxNormAttribute RxNormAttribute (Maybe Text) (Maybe 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_score :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Double)
rxNormAttribute_score :: (Maybe Double -> f (Maybe Double))
-> RxNormAttribute -> f RxNormAttribute
rxNormAttribute_score = (RxNormAttribute -> Maybe Double)
-> (RxNormAttribute -> Maybe Double -> RxNormAttribute)
-> Lens
RxNormAttribute RxNormAttribute (Maybe Double) (Maybe Double)
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_traits :: Lens.Lens' RxNormAttribute (Prelude.Maybe [RxNormTrait])
rxNormAttribute_traits :: (Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> RxNormAttribute -> f RxNormAttribute
rxNormAttribute_traits = (RxNormAttribute -> Maybe [RxNormTrait])
-> (RxNormAttribute -> Maybe [RxNormTrait] -> RxNormAttribute)
-> Lens
RxNormAttribute
RxNormAttribute
(Maybe [RxNormTrait])
(Maybe [RxNormTrait])
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) ((Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> RxNormAttribute -> f RxNormAttribute)
-> ((Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> (Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> RxNormAttribute
-> f RxNormAttribute
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [RxNormTrait] [RxNormTrait] [RxNormTrait] [RxNormTrait]
-> Iso
(Maybe [RxNormTrait])
(Maybe [RxNormTrait])
(Maybe [RxNormTrait])
(Maybe [RxNormTrait])
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 AnIso [RxNormTrait] [RxNormTrait] [RxNormTrait] [RxNormTrait]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
rxNormAttribute_endOffset :: Lens.Lens' RxNormAttribute (Prelude.Maybe Prelude.Int)
rxNormAttribute_endOffset :: (Maybe Int -> f (Maybe Int))
-> RxNormAttribute -> f RxNormAttribute
rxNormAttribute_endOffset = (RxNormAttribute -> Maybe Int)
-> (RxNormAttribute -> Maybe Int -> RxNormAttribute)
-> Lens RxNormAttribute RxNormAttribute (Maybe Int) (Maybe Int)
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 :: (Maybe Int -> f (Maybe Int))
-> RxNormAttribute -> f RxNormAttribute
rxNormAttribute_id = (RxNormAttribute -> Maybe Int)
-> (RxNormAttribute -> Maybe Int -> RxNormAttribute)
-> Lens RxNormAttribute RxNormAttribute (Maybe Int) (Maybe Int)
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_type :: Lens.Lens' RxNormAttribute (Prelude.Maybe RxNormAttributeType)
rxNormAttribute_type :: (Maybe RxNormAttributeType -> f (Maybe RxNormAttributeType))
-> RxNormAttribute -> f RxNormAttribute
rxNormAttribute_type = (RxNormAttribute -> Maybe RxNormAttributeType)
-> (RxNormAttribute
-> Maybe RxNormAttributeType -> RxNormAttribute)
-> Lens
RxNormAttribute
RxNormAttribute
(Maybe RxNormAttributeType)
(Maybe RxNormAttributeType)
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 Core.FromJSON RxNormAttribute where
parseJSON :: Value -> Parser RxNormAttribute
parseJSON =
String
-> (Object -> Parser RxNormAttribute)
-> Value
-> Parser RxNormAttribute
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RxNormAttribute"
( \Object
x ->
Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute
RxNormAttribute'
(Maybe Double
-> Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute)
-> Parser (Maybe Double)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute)
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
"RelationshipScore")
Parser
(Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BeginOffset")
Parser
(Maybe Text
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute)
-> Parser (Maybe Text)
-> Parser
(Maybe Double
-> Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute)
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
"Text")
Parser
(Maybe Double
-> Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute)
-> Parser (Maybe Double)
-> Parser
(Maybe [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute)
forall (f :: * -> *) a b. Applicative f => 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 [RxNormTrait]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormAttributeType
-> RxNormAttribute)
-> Parser (Maybe [RxNormTrait])
-> Parser
(Maybe Int
-> Maybe Int -> Maybe RxNormAttributeType -> RxNormAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [RxNormTrait]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Traits" Parser (Maybe (Maybe [RxNormTrait]))
-> Maybe [RxNormTrait] -> Parser (Maybe [RxNormTrait])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RxNormTrait]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Int
-> Maybe Int -> Maybe RxNormAttributeType -> RxNormAttribute)
-> Parser (Maybe Int)
-> Parser
(Maybe Int -> Maybe RxNormAttributeType -> RxNormAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndOffset")
Parser (Maybe Int -> Maybe RxNormAttributeType -> RxNormAttribute)
-> Parser (Maybe Int)
-> Parser (Maybe RxNormAttributeType -> RxNormAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
Parser (Maybe RxNormAttributeType -> RxNormAttribute)
-> Parser (Maybe RxNormAttributeType) -> Parser RxNormAttribute
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RxNormAttributeType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
)
instance Prelude.Hashable RxNormAttribute
instance Prelude.NFData RxNormAttribute