{-# 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.RxNormEntity where
import Amazonka.ComprehendMedical.Types.RxNormAttribute
import Amazonka.ComprehendMedical.Types.RxNormConcept
import Amazonka.ComprehendMedical.Types.RxNormEntityCategory
import Amazonka.ComprehendMedical.Types.RxNormEntityType
import Amazonka.ComprehendMedical.Types.RxNormTrait
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RxNormEntity = RxNormEntity'
{
RxNormEntity -> Maybe [RxNormConcept]
rxNormConcepts :: Prelude.Maybe [RxNormConcept],
RxNormEntity -> Maybe Int
beginOffset :: Prelude.Maybe Prelude.Int,
RxNormEntity -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
RxNormEntity -> Maybe RxNormEntityCategory
category :: Prelude.Maybe RxNormEntityCategory,
RxNormEntity -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
RxNormEntity -> Maybe [RxNormTrait]
traits :: Prelude.Maybe [RxNormTrait],
RxNormEntity -> Maybe [RxNormAttribute]
attributes :: Prelude.Maybe [RxNormAttribute],
RxNormEntity -> Maybe Int
endOffset :: Prelude.Maybe Prelude.Int,
RxNormEntity -> Maybe Int
id :: Prelude.Maybe Prelude.Int,
RxNormEntity -> Maybe RxNormEntityType
type' :: Prelude.Maybe RxNormEntityType
}
deriving (RxNormEntity -> RxNormEntity -> Bool
(RxNormEntity -> RxNormEntity -> Bool)
-> (RxNormEntity -> RxNormEntity -> Bool) -> Eq RxNormEntity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RxNormEntity -> RxNormEntity -> Bool
$c/= :: RxNormEntity -> RxNormEntity -> Bool
== :: RxNormEntity -> RxNormEntity -> Bool
$c== :: RxNormEntity -> RxNormEntity -> Bool
Prelude.Eq, ReadPrec [RxNormEntity]
ReadPrec RxNormEntity
Int -> ReadS RxNormEntity
ReadS [RxNormEntity]
(Int -> ReadS RxNormEntity)
-> ReadS [RxNormEntity]
-> ReadPrec RxNormEntity
-> ReadPrec [RxNormEntity]
-> Read RxNormEntity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RxNormEntity]
$creadListPrec :: ReadPrec [RxNormEntity]
readPrec :: ReadPrec RxNormEntity
$creadPrec :: ReadPrec RxNormEntity
readList :: ReadS [RxNormEntity]
$creadList :: ReadS [RxNormEntity]
readsPrec :: Int -> ReadS RxNormEntity
$creadsPrec :: Int -> ReadS RxNormEntity
Prelude.Read, Int -> RxNormEntity -> ShowS
[RxNormEntity] -> ShowS
RxNormEntity -> String
(Int -> RxNormEntity -> ShowS)
-> (RxNormEntity -> String)
-> ([RxNormEntity] -> ShowS)
-> Show RxNormEntity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RxNormEntity] -> ShowS
$cshowList :: [RxNormEntity] -> ShowS
show :: RxNormEntity -> String
$cshow :: RxNormEntity -> String
showsPrec :: Int -> RxNormEntity -> ShowS
$cshowsPrec :: Int -> RxNormEntity -> ShowS
Prelude.Show, (forall x. RxNormEntity -> Rep RxNormEntity x)
-> (forall x. Rep RxNormEntity x -> RxNormEntity)
-> Generic RxNormEntity
forall x. Rep RxNormEntity x -> RxNormEntity
forall x. RxNormEntity -> Rep RxNormEntity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RxNormEntity x -> RxNormEntity
$cfrom :: forall x. RxNormEntity -> Rep RxNormEntity x
Prelude.Generic)
newRxNormEntity ::
RxNormEntity
newRxNormEntity :: RxNormEntity
newRxNormEntity =
RxNormEntity' :: Maybe [RxNormConcept]
-> Maybe Int
-> Maybe Text
-> Maybe RxNormEntityCategory
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity
RxNormEntity'
{ $sel:rxNormConcepts:RxNormEntity' :: Maybe [RxNormConcept]
rxNormConcepts = Maybe [RxNormConcept]
forall a. Maybe a
Prelude.Nothing,
$sel:beginOffset:RxNormEntity' :: Maybe Int
beginOffset = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:text:RxNormEntity' :: Maybe Text
text = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:category:RxNormEntity' :: Maybe RxNormEntityCategory
category = Maybe RxNormEntityCategory
forall a. Maybe a
Prelude.Nothing,
$sel:score:RxNormEntity' :: Maybe Double
score = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:traits:RxNormEntity' :: Maybe [RxNormTrait]
traits = Maybe [RxNormTrait]
forall a. Maybe a
Prelude.Nothing,
$sel:attributes:RxNormEntity' :: Maybe [RxNormAttribute]
attributes = Maybe [RxNormAttribute]
forall a. Maybe a
Prelude.Nothing,
$sel:endOffset:RxNormEntity' :: Maybe Int
endOffset = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:id:RxNormEntity' :: Maybe Int
id = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:type':RxNormEntity' :: Maybe RxNormEntityType
type' = Maybe RxNormEntityType
forall a. Maybe a
Prelude.Nothing
}
rxNormEntity_rxNormConcepts :: Lens.Lens' RxNormEntity (Prelude.Maybe [RxNormConcept])
rxNormEntity_rxNormConcepts :: (Maybe [RxNormConcept] -> f (Maybe [RxNormConcept]))
-> RxNormEntity -> f RxNormEntity
rxNormEntity_rxNormConcepts = (RxNormEntity -> Maybe [RxNormConcept])
-> (RxNormEntity -> Maybe [RxNormConcept] -> RxNormEntity)
-> Lens
RxNormEntity
RxNormEntity
(Maybe [RxNormConcept])
(Maybe [RxNormConcept])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe [RxNormConcept]
rxNormConcepts :: Maybe [RxNormConcept]
$sel:rxNormConcepts:RxNormEntity' :: RxNormEntity -> Maybe [RxNormConcept]
rxNormConcepts} -> Maybe [RxNormConcept]
rxNormConcepts) (\s :: RxNormEntity
s@RxNormEntity' {} Maybe [RxNormConcept]
a -> RxNormEntity
s {$sel:rxNormConcepts:RxNormEntity' :: Maybe [RxNormConcept]
rxNormConcepts = Maybe [RxNormConcept]
a} :: RxNormEntity) ((Maybe [RxNormConcept] -> f (Maybe [RxNormConcept]))
-> RxNormEntity -> f RxNormEntity)
-> ((Maybe [RxNormConcept] -> f (Maybe [RxNormConcept]))
-> Maybe [RxNormConcept] -> f (Maybe [RxNormConcept]))
-> (Maybe [RxNormConcept] -> f (Maybe [RxNormConcept]))
-> RxNormEntity
-> f RxNormEntity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RxNormConcept] [RxNormConcept] [RxNormConcept] [RxNormConcept]
-> Iso
(Maybe [RxNormConcept])
(Maybe [RxNormConcept])
(Maybe [RxNormConcept])
(Maybe [RxNormConcept])
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
[RxNormConcept] [RxNormConcept] [RxNormConcept] [RxNormConcept]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
rxNormEntity_beginOffset :: Lens.Lens' RxNormEntity (Prelude.Maybe Prelude.Int)
rxNormEntity_beginOffset :: (Maybe Int -> f (Maybe Int)) -> RxNormEntity -> f RxNormEntity
rxNormEntity_beginOffset = (RxNormEntity -> Maybe Int)
-> (RxNormEntity -> Maybe Int -> RxNormEntity)
-> Lens RxNormEntity RxNormEntity (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe Int
beginOffset :: Maybe Int
$sel:beginOffset:RxNormEntity' :: RxNormEntity -> Maybe Int
beginOffset} -> Maybe Int
beginOffset) (\s :: RxNormEntity
s@RxNormEntity' {} Maybe Int
a -> RxNormEntity
s {$sel:beginOffset:RxNormEntity' :: Maybe Int
beginOffset = Maybe Int
a} :: RxNormEntity)
rxNormEntity_text :: Lens.Lens' RxNormEntity (Prelude.Maybe Prelude.Text)
rxNormEntity_text :: (Maybe Text -> f (Maybe Text)) -> RxNormEntity -> f RxNormEntity
rxNormEntity_text = (RxNormEntity -> Maybe Text)
-> (RxNormEntity -> Maybe Text -> RxNormEntity)
-> Lens RxNormEntity RxNormEntity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe Text
text :: Maybe Text
$sel:text:RxNormEntity' :: RxNormEntity -> Maybe Text
text} -> Maybe Text
text) (\s :: RxNormEntity
s@RxNormEntity' {} Maybe Text
a -> RxNormEntity
s {$sel:text:RxNormEntity' :: Maybe Text
text = Maybe Text
a} :: RxNormEntity)
rxNormEntity_category :: Lens.Lens' RxNormEntity (Prelude.Maybe RxNormEntityCategory)
rxNormEntity_category :: (Maybe RxNormEntityCategory -> f (Maybe RxNormEntityCategory))
-> RxNormEntity -> f RxNormEntity
rxNormEntity_category = (RxNormEntity -> Maybe RxNormEntityCategory)
-> (RxNormEntity -> Maybe RxNormEntityCategory -> RxNormEntity)
-> Lens
RxNormEntity
RxNormEntity
(Maybe RxNormEntityCategory)
(Maybe RxNormEntityCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe RxNormEntityCategory
category :: Maybe RxNormEntityCategory
$sel:category:RxNormEntity' :: RxNormEntity -> Maybe RxNormEntityCategory
category} -> Maybe RxNormEntityCategory
category) (\s :: RxNormEntity
s@RxNormEntity' {} Maybe RxNormEntityCategory
a -> RxNormEntity
s {$sel:category:RxNormEntity' :: Maybe RxNormEntityCategory
category = Maybe RxNormEntityCategory
a} :: RxNormEntity)
rxNormEntity_score :: Lens.Lens' RxNormEntity (Prelude.Maybe Prelude.Double)
rxNormEntity_score :: (Maybe Double -> f (Maybe Double))
-> RxNormEntity -> f RxNormEntity
rxNormEntity_score = (RxNormEntity -> Maybe Double)
-> (RxNormEntity -> Maybe Double -> RxNormEntity)
-> Lens RxNormEntity RxNormEntity (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe Double
score :: Maybe Double
$sel:score:RxNormEntity' :: RxNormEntity -> Maybe Double
score} -> Maybe Double
score) (\s :: RxNormEntity
s@RxNormEntity' {} Maybe Double
a -> RxNormEntity
s {$sel:score:RxNormEntity' :: Maybe Double
score = Maybe Double
a} :: RxNormEntity)
rxNormEntity_traits :: Lens.Lens' RxNormEntity (Prelude.Maybe [RxNormTrait])
rxNormEntity_traits :: (Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> RxNormEntity -> f RxNormEntity
rxNormEntity_traits = (RxNormEntity -> Maybe [RxNormTrait])
-> (RxNormEntity -> Maybe [RxNormTrait] -> RxNormEntity)
-> Lens
RxNormEntity
RxNormEntity
(Maybe [RxNormTrait])
(Maybe [RxNormTrait])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe [RxNormTrait]
traits :: Maybe [RxNormTrait]
$sel:traits:RxNormEntity' :: RxNormEntity -> Maybe [RxNormTrait]
traits} -> Maybe [RxNormTrait]
traits) (\s :: RxNormEntity
s@RxNormEntity' {} Maybe [RxNormTrait]
a -> RxNormEntity
s {$sel:traits:RxNormEntity' :: Maybe [RxNormTrait]
traits = Maybe [RxNormTrait]
a} :: RxNormEntity) ((Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> RxNormEntity -> f RxNormEntity)
-> ((Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> (Maybe [RxNormTrait] -> f (Maybe [RxNormTrait]))
-> RxNormEntity
-> f RxNormEntity
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
rxNormEntity_attributes :: Lens.Lens' RxNormEntity (Prelude.Maybe [RxNormAttribute])
rxNormEntity_attributes :: (Maybe [RxNormAttribute] -> f (Maybe [RxNormAttribute]))
-> RxNormEntity -> f RxNormEntity
rxNormEntity_attributes = (RxNormEntity -> Maybe [RxNormAttribute])
-> (RxNormEntity -> Maybe [RxNormAttribute] -> RxNormEntity)
-> Lens
RxNormEntity
RxNormEntity
(Maybe [RxNormAttribute])
(Maybe [RxNormAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe [RxNormAttribute]
attributes :: Maybe [RxNormAttribute]
$sel:attributes:RxNormEntity' :: RxNormEntity -> Maybe [RxNormAttribute]
attributes} -> Maybe [RxNormAttribute]
attributes) (\s :: RxNormEntity
s@RxNormEntity' {} Maybe [RxNormAttribute]
a -> RxNormEntity
s {$sel:attributes:RxNormEntity' :: Maybe [RxNormAttribute]
attributes = Maybe [RxNormAttribute]
a} :: RxNormEntity) ((Maybe [RxNormAttribute] -> f (Maybe [RxNormAttribute]))
-> RxNormEntity -> f RxNormEntity)
-> ((Maybe [RxNormAttribute] -> f (Maybe [RxNormAttribute]))
-> Maybe [RxNormAttribute] -> f (Maybe [RxNormAttribute]))
-> (Maybe [RxNormAttribute] -> f (Maybe [RxNormAttribute]))
-> RxNormEntity
-> f RxNormEntity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RxNormAttribute]
[RxNormAttribute]
[RxNormAttribute]
[RxNormAttribute]
-> Iso
(Maybe [RxNormAttribute])
(Maybe [RxNormAttribute])
(Maybe [RxNormAttribute])
(Maybe [RxNormAttribute])
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
[RxNormAttribute]
[RxNormAttribute]
[RxNormAttribute]
[RxNormAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
rxNormEntity_endOffset :: Lens.Lens' RxNormEntity (Prelude.Maybe Prelude.Int)
rxNormEntity_endOffset :: (Maybe Int -> f (Maybe Int)) -> RxNormEntity -> f RxNormEntity
rxNormEntity_endOffset = (RxNormEntity -> Maybe Int)
-> (RxNormEntity -> Maybe Int -> RxNormEntity)
-> Lens RxNormEntity RxNormEntity (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe Int
endOffset :: Maybe Int
$sel:endOffset:RxNormEntity' :: RxNormEntity -> Maybe Int
endOffset} -> Maybe Int
endOffset) (\s :: RxNormEntity
s@RxNormEntity' {} Maybe Int
a -> RxNormEntity
s {$sel:endOffset:RxNormEntity' :: Maybe Int
endOffset = Maybe Int
a} :: RxNormEntity)
rxNormEntity_id :: Lens.Lens' RxNormEntity (Prelude.Maybe Prelude.Int)
rxNormEntity_id :: (Maybe Int -> f (Maybe Int)) -> RxNormEntity -> f RxNormEntity
rxNormEntity_id = (RxNormEntity -> Maybe Int)
-> (RxNormEntity -> Maybe Int -> RxNormEntity)
-> Lens RxNormEntity RxNormEntity (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe Int
id :: Maybe Int
$sel:id:RxNormEntity' :: RxNormEntity -> Maybe Int
id} -> Maybe Int
id) (\s :: RxNormEntity
s@RxNormEntity' {} Maybe Int
a -> RxNormEntity
s {$sel:id:RxNormEntity' :: Maybe Int
id = Maybe Int
a} :: RxNormEntity)
rxNormEntity_type :: Lens.Lens' RxNormEntity (Prelude.Maybe RxNormEntityType)
rxNormEntity_type :: (Maybe RxNormEntityType -> f (Maybe RxNormEntityType))
-> RxNormEntity -> f RxNormEntity
rxNormEntity_type = (RxNormEntity -> Maybe RxNormEntityType)
-> (RxNormEntity -> Maybe RxNormEntityType -> RxNormEntity)
-> Lens
RxNormEntity
RxNormEntity
(Maybe RxNormEntityType)
(Maybe RxNormEntityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RxNormEntity' {Maybe RxNormEntityType
type' :: Maybe RxNormEntityType
$sel:type':RxNormEntity' :: RxNormEntity -> Maybe RxNormEntityType
type'} -> Maybe RxNormEntityType
type') (\s :: RxNormEntity
s@RxNormEntity' {} Maybe RxNormEntityType
a -> RxNormEntity
s {$sel:type':RxNormEntity' :: Maybe RxNormEntityType
type' = Maybe RxNormEntityType
a} :: RxNormEntity)
instance Core.FromJSON RxNormEntity where
parseJSON :: Value -> Parser RxNormEntity
parseJSON =
String
-> (Object -> Parser RxNormEntity) -> Value -> Parser RxNormEntity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RxNormEntity"
( \Object
x ->
Maybe [RxNormConcept]
-> Maybe Int
-> Maybe Text
-> Maybe RxNormEntityCategory
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity
RxNormEntity'
(Maybe [RxNormConcept]
-> Maybe Int
-> Maybe Text
-> Maybe RxNormEntityCategory
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
-> Parser (Maybe [RxNormConcept])
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe RxNormEntityCategory
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [RxNormConcept]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RxNormConcepts" Parser (Maybe (Maybe [RxNormConcept]))
-> Maybe [RxNormConcept] -> Parser (Maybe [RxNormConcept])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RxNormConcept]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Int
-> Maybe Text
-> Maybe RxNormEntityCategory
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe RxNormEntityCategory
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
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 RxNormEntityCategory
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe RxNormEntityCategory
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
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 RxNormEntityCategory
-> Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
-> Parser (Maybe RxNormEntityCategory)
-> Parser
(Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RxNormEntityCategory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Category")
Parser
(Maybe Double
-> Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
-> Parser (Maybe Double)
-> Parser
(Maybe [RxNormTrait]
-> Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
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 [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
-> Parser (Maybe [RxNormTrait])
-> Parser
(Maybe [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
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 [RxNormAttribute]
-> Maybe Int
-> Maybe Int
-> Maybe RxNormEntityType
-> RxNormEntity)
-> Parser (Maybe [RxNormAttribute])
-> Parser
(Maybe Int -> Maybe Int -> Maybe RxNormEntityType -> RxNormEntity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [RxNormAttribute]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Attributes" Parser (Maybe (Maybe [RxNormAttribute]))
-> Maybe [RxNormAttribute] -> Parser (Maybe [RxNormAttribute])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RxNormAttribute]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Int -> Maybe Int -> Maybe RxNormEntityType -> RxNormEntity)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe RxNormEntityType -> RxNormEntity)
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 RxNormEntityType -> RxNormEntity)
-> Parser (Maybe Int)
-> Parser (Maybe RxNormEntityType -> RxNormEntity)
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 RxNormEntityType -> RxNormEntity)
-> Parser (Maybe RxNormEntityType) -> Parser RxNormEntity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RxNormEntityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
)
instance Prelude.Hashable RxNormEntity
instance Prelude.NFData RxNormEntity