{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ComprehendMedical.Types.RxNormAttribute
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | The extracted attributes that relate to this entity. The attributes
-- recognized by InferRxNorm are @DOSAGE@, @DURATION@, @FORM@, @FREQUENCY@,
-- @RATE@, @ROUTE_OR_MODE@.
--
-- /See:/ 'newRxNormAttribute' smart constructor.
data RxNormAttribute = RxNormAttribute'
  { -- | The level of confidence that Amazon Comprehend Medical has that the
    -- attribute is accurately linked to an entity.
    RxNormAttribute -> Maybe Double
relationshipScore :: Prelude.Maybe Prelude.Double,
    -- | The 0-based character offset in the input text that shows where the
    -- attribute begins. The offset returns the UTF-8 code point in the string.
    RxNormAttribute -> Maybe Int
beginOffset :: Prelude.Maybe Prelude.Int,
    -- | The segment of input text which corresponds to the detected attribute.
    RxNormAttribute -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
    -- | The level of confidence that Comprehend Medical has that the segment of
    -- text is correctly recognized as an attribute.
    RxNormAttribute -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
    -- | Contextual information for the attribute. InferRxNorm recognizes the
    -- trait @NEGATION@ for attributes, i.e. that the patient is not taking a
    -- specific dose or form of a medication.
    RxNormAttribute -> Maybe [RxNormTrait]
traits :: Prelude.Maybe [RxNormTrait],
    -- | The 0-based character offset in the input text that shows where the
    -- attribute ends. The offset returns the UTF-8 code point in the string.
    RxNormAttribute -> Maybe Int
endOffset :: Prelude.Maybe Prelude.Int,
    -- | The numeric identifier for this attribute. This is a monotonically
    -- increasing id unique within this response rather than a global unique
    -- identifier.
    RxNormAttribute -> Maybe Int
id :: Prelude.Maybe Prelude.Int,
    -- | The type of attribute. The types of attributes recognized by InferRxNorm
    -- are @BRAND_NAME@ and @GENERIC_NAME@.
    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)

-- |
-- Create a value of 'RxNormAttribute' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'relationshipScore', 'rxNormAttribute_relationshipScore' - The level of confidence that Amazon Comprehend Medical has that the
-- attribute is accurately linked to an entity.
--
-- 'beginOffset', 'rxNormAttribute_beginOffset' - The 0-based character offset in the input text that shows where the
-- attribute begins. The offset returns the UTF-8 code point in the string.
--
-- 'text', 'rxNormAttribute_text' - The segment of input text which corresponds to the detected attribute.
--
-- 'score', 'rxNormAttribute_score' - The level of confidence that Comprehend Medical has that the segment of
-- text is correctly recognized as an attribute.
--
-- 'traits', 'rxNormAttribute_traits' - Contextual information for the attribute. InferRxNorm recognizes the
-- trait @NEGATION@ for attributes, i.e. that the patient is not taking a
-- specific dose or form of a medication.
--
-- 'endOffset', 'rxNormAttribute_endOffset' - The 0-based character offset in the input text that shows where the
-- attribute ends. The offset returns the UTF-8 code point in the string.
--
-- 'id', 'rxNormAttribute_id' - The numeric identifier for this attribute. This is a monotonically
-- increasing id unique within this response rather than a global unique
-- identifier.
--
-- 'type'', 'rxNormAttribute_type' - The type of attribute. The types of attributes recognized by InferRxNorm
-- are @BRAND_NAME@ and @GENERIC_NAME@.
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
    }

-- | The level of confidence that Amazon Comprehend Medical has that the
-- attribute is accurately linked to an entity.
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)

-- | The 0-based character offset in the input text that shows where the
-- attribute begins. The offset returns the UTF-8 code point in the string.
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)

-- | The segment of input text which corresponds to the detected attribute.
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)

-- | The level of confidence that Comprehend Medical has that the segment of
-- text is correctly recognized as an attribute.
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)

-- | Contextual information for the attribute. InferRxNorm recognizes the
-- trait @NEGATION@ for attributes, i.e. that the patient is not taking a
-- specific dose or form of a medication.
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

-- | The 0-based character offset in the input text that shows where the
-- attribute ends. The offset returns the UTF-8 code point in the string.
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)

-- | The numeric identifier for this attribute. This is a monotonically
-- increasing id unique within this response rather than a global unique
-- identifier.
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)

-- | The type of attribute. The types of attributes recognized by InferRxNorm
-- are @BRAND_NAME@ and @GENERIC_NAME@.
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