Module phc.easy.ocr.options.ocr_config_types

Expand source code
# flake8: noqa
# generated by datamodel-codegen:
#   filename:  ocrConfig.json
#   timestamp: 2021-02-24T14:53:55+00:00

from __future__ import annotations

from enum import Enum
from typing import List, Optional

from pydantic import BaseModel, Field, constr


class DenoiserSwitch(Enum):
    ON = "ON"
    OFF = "OFF"
    SMART = "SMART"


class ClassifierSwitch(Enum):
    OFF = "OFF"
    SEARCH = "SEARCH"
    ML = "ML"


class AnalyzeSwitch(Enum):
    OFF = "OFF"
    ON = "ON"
    PROJECT_DATA = "PROJECT_DATA"
    FULL = "FULL"


class AnalyzeConfidence(Enum):
    HIGH = "HIGH"
    STRONG = "STRONG"
    MODERATE = "MODERATE"
    LOW = "LOW"
    OFF = "OFF"


class SpellCheckerSwitch(Enum):
    OFF = "OFF"
    ON = "ON"


class ReportExtractionSwitch(Enum):
    OFF = "OFF"
    ON = "ON"


class Coding(BaseModel):
    code: str = Field(..., title="The code for the search term's coding")
    system: str = Field(..., title="The system for the search term's coding")
    display: str = Field(..., title="The display for the search term's coding")


class ResourceType(Enum):
    MedicationAdministration = "MedicationAdministration"
    Observation = "Observation"
    Procedure = "Procedure"
    Condition = "Condition"


class SearchTerm(BaseModel):
    term: str = Field(
        ...,
        examples=["Cancer", "Date of Birth"],
        title="The explicit term to search in the document for",
    )
    coding: Optional[Coding] = Field(
        None, title="The coding to associate with the search term"
    )
    resourceTypes: Optional[List[ResourceType]] = Field(
        None, title="The resource type(s) to associate with the search term"
    )


class SearchList(BaseModel):
    title: str = Field(..., title="Search List title")
    searchTerms: List[SearchTerm] = Field(
        ..., title="The terms of the search list"
    )


class SearchLists(BaseModel):
    lists: Optional[List[SearchList]] = Field(
        None, title="Configured lists of search terms"
    )


class Config(BaseModel):
    denoiserSwitch: Optional[DenoiserSwitch] = Field(
        None, title="Switch to control denoiser ON|OFF|SMART"
    )
    pathPrefix: Optional[str] = Field(
        None,
        title="Path prefix where output files will be written (in file-service)",
    )
    documentClassifier: Optional[str] = Field(
        None, title="Name of document classifier"
    )
    classifierSwitch: Optional[ClassifierSwitch] = Field(
        None, title="Switch to control classifier OFF|SEARCH|ML"
    )
    analyzeSwitch: Optional[AnalyzeSwitch] = Field(
        None, title="Switch to execute analyze engine on document ingestion"
    )
    analyzeConfidence: Optional[AnalyzeConfidence] = Field(
        None,
        title="Sliding toggle to determine confidence limit on comprehend results to filter out less relevant suggestions",
    )
    spellCheckerSwitch: Optional[SpellCheckerSwitch] = Field(
        None, title="Switch to execute spell checker on document ingestion"
    )
    reportExtractionSwitch: Optional[ReportExtractionSwitch] = Field(
        None, title="Switch to execute report extraction on document ingestion"
    )
    reviewStages: Optional[List[str]] = Field(
        None,
        title="Configurable stages a document goes through during a review process",
    )
    searchLists: Optional[SearchLists] = Field(
        None, title="Configured search sets to help navigate documents"
    )


class OcrConfigPayload(BaseModel):
    project: str = Field(
        pattern=r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
        min_length=36,
        max_length=36,
        examples=["e97e27d3-f553-432a-bde1-7ae3d3ba5078"],
        title="Project Id",
    )
    config: Config

Classes

class AnalyzeConfidence (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Expand source code
class AnalyzeConfidence(Enum):
    HIGH = "HIGH"
    STRONG = "STRONG"
    MODERATE = "MODERATE"
    LOW = "LOW"
    OFF = "OFF"

Ancestors

  • enum.Enum

Class variables

var HIGH
var LOW
var MODERATE
var OFF
var STRONG
class AnalyzeSwitch (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Expand source code
class AnalyzeSwitch(Enum):
    OFF = "OFF"
    ON = "ON"
    PROJECT_DATA = "PROJECT_DATA"
    FULL = "FULL"

Ancestors

  • enum.Enum

Class variables

var FULL
var OFF
var ON
var PROJECT_DATA
class ClassifierSwitch (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Expand source code
class ClassifierSwitch(Enum):
    OFF = "OFF"
    SEARCH = "SEARCH"
    ML = "ML"

Ancestors

  • enum.Enum

Class variables

var ML
var OFF
var SEARCH
class Coding (**data: Any)

Usage docs: https://docs.pydantic.dev/2.10/concepts/models/

A base class for creating Pydantic models.

Attributes

__class_vars__
The names of the class variables defined on the model.
__private_attributes__
Metadata about the private attributes of the model.
__signature__
The synthesized __init__ [Signature][inspect.Signature] of the model.
__pydantic_complete__
Whether model building is completed, or if there are still undefined fields.
__pydantic_core_schema__
The core schema of the model.
__pydantic_custom_init__
Whether the model has a custom __init__ function.
__pydantic_decorators__
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_generic_metadata__
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
The name of the post-init method for the model, if defined.
__pydantic_root_model__
Whether the model is a [RootModel][pydantic.root_model.RootModel].
__pydantic_serializer__
The pydantic-core SchemaSerializer used to dump instances of the model.
__pydantic_validator__
The pydantic-core SchemaValidator used to validate instances of the model.
__pydantic_fields__
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
__pydantic_computed_fields__
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_extra__
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
__pydantic_fields_set__
The names of fields explicitly set during instantiation.
__pydantic_private__
Values of private attributes set on the model instance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class Coding(BaseModel):
    code: str = Field(..., title="The code for the search term's coding")
    system: str = Field(..., title="The system for the search term's coding")
    display: str = Field(..., title="The display for the search term's coding")

Ancestors

  • pydantic.main.BaseModel

Class variables

var code : str
var display : str
var model_config
var system : str
class Config (**data: Any)

Usage docs: https://docs.pydantic.dev/2.10/concepts/models/

A base class for creating Pydantic models.

Attributes

__class_vars__
The names of the class variables defined on the model.
__private_attributes__
Metadata about the private attributes of the model.
__signature__
The synthesized __init__ [Signature][inspect.Signature] of the model.
__pydantic_complete__
Whether model building is completed, or if there are still undefined fields.
__pydantic_core_schema__
The core schema of the model.
__pydantic_custom_init__
Whether the model has a custom __init__ function.
__pydantic_decorators__
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_generic_metadata__
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
The name of the post-init method for the model, if defined.
__pydantic_root_model__
Whether the model is a [RootModel][pydantic.root_model.RootModel].
__pydantic_serializer__
The pydantic-core SchemaSerializer used to dump instances of the model.
__pydantic_validator__
The pydantic-core SchemaValidator used to validate instances of the model.
__pydantic_fields__
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
__pydantic_computed_fields__
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_extra__
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
__pydantic_fields_set__
The names of fields explicitly set during instantiation.
__pydantic_private__
Values of private attributes set on the model instance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class Config(BaseModel):
    denoiserSwitch: Optional[DenoiserSwitch] = Field(
        None, title="Switch to control denoiser ON|OFF|SMART"
    )
    pathPrefix: Optional[str] = Field(
        None,
        title="Path prefix where output files will be written (in file-service)",
    )
    documentClassifier: Optional[str] = Field(
        None, title="Name of document classifier"
    )
    classifierSwitch: Optional[ClassifierSwitch] = Field(
        None, title="Switch to control classifier OFF|SEARCH|ML"
    )
    analyzeSwitch: Optional[AnalyzeSwitch] = Field(
        None, title="Switch to execute analyze engine on document ingestion"
    )
    analyzeConfidence: Optional[AnalyzeConfidence] = Field(
        None,
        title="Sliding toggle to determine confidence limit on comprehend results to filter out less relevant suggestions",
    )
    spellCheckerSwitch: Optional[SpellCheckerSwitch] = Field(
        None, title="Switch to execute spell checker on document ingestion"
    )
    reportExtractionSwitch: Optional[ReportExtractionSwitch] = Field(
        None, title="Switch to execute report extraction on document ingestion"
    )
    reviewStages: Optional[List[str]] = Field(
        None,
        title="Configurable stages a document goes through during a review process",
    )
    searchLists: Optional[SearchLists] = Field(
        None, title="Configured search sets to help navigate documents"
    )

Ancestors

  • pydantic.main.BaseModel

Class variables

var analyzeConfidence : Optional[AnalyzeConfidence]
var analyzeSwitch : Optional[AnalyzeSwitch]
var classifierSwitch : Optional[ClassifierSwitch]
var denoiserSwitch : Optional[DenoiserSwitch]
var documentClassifier : Optional[str]
var model_config
var pathPrefix : Optional[str]
var reportExtractionSwitch : Optional[ReportExtractionSwitch]
var reviewStages : Optional[List[str]]
var searchLists : Optional[SearchLists]
var spellCheckerSwitch : Optional[SpellCheckerSwitch]
class DenoiserSwitch (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Expand source code
class DenoiserSwitch(Enum):
    ON = "ON"
    OFF = "OFF"
    SMART = "SMART"

Ancestors

  • enum.Enum

Class variables

var OFF
var ON
var SMART
class OcrConfigPayload (**data: Any)

Usage docs: https://docs.pydantic.dev/2.10/concepts/models/

A base class for creating Pydantic models.

Attributes

__class_vars__
The names of the class variables defined on the model.
__private_attributes__
Metadata about the private attributes of the model.
__signature__
The synthesized __init__ [Signature][inspect.Signature] of the model.
__pydantic_complete__
Whether model building is completed, or if there are still undefined fields.
__pydantic_core_schema__
The core schema of the model.
__pydantic_custom_init__
Whether the model has a custom __init__ function.
__pydantic_decorators__
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_generic_metadata__
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
The name of the post-init method for the model, if defined.
__pydantic_root_model__
Whether the model is a [RootModel][pydantic.root_model.RootModel].
__pydantic_serializer__
The pydantic-core SchemaSerializer used to dump instances of the model.
__pydantic_validator__
The pydantic-core SchemaValidator used to validate instances of the model.
__pydantic_fields__
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
__pydantic_computed_fields__
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_extra__
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
__pydantic_fields_set__
The names of fields explicitly set during instantiation.
__pydantic_private__
Values of private attributes set on the model instance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class OcrConfigPayload(BaseModel):
    project: str = Field(
        pattern=r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
        min_length=36,
        max_length=36,
        examples=["e97e27d3-f553-432a-bde1-7ae3d3ba5078"],
        title="Project Id",
    )
    config: Config

Ancestors

  • pydantic.main.BaseModel

Class variables

var configConfig
var model_config
var project : str
class ReportExtractionSwitch (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Expand source code
class ReportExtractionSwitch(Enum):
    OFF = "OFF"
    ON = "ON"

Ancestors

  • enum.Enum

Class variables

var OFF
var ON
class ResourceType (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Expand source code
class ResourceType(Enum):
    MedicationAdministration = "MedicationAdministration"
    Observation = "Observation"
    Procedure = "Procedure"
    Condition = "Condition"

Ancestors

  • enum.Enum

Class variables

var Condition
var MedicationAdministration
var Observation
var Procedure
class SearchList (**data: Any)

Usage docs: https://docs.pydantic.dev/2.10/concepts/models/

A base class for creating Pydantic models.

Attributes

__class_vars__
The names of the class variables defined on the model.
__private_attributes__
Metadata about the private attributes of the model.
__signature__
The synthesized __init__ [Signature][inspect.Signature] of the model.
__pydantic_complete__
Whether model building is completed, or if there are still undefined fields.
__pydantic_core_schema__
The core schema of the model.
__pydantic_custom_init__
Whether the model has a custom __init__ function.
__pydantic_decorators__
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_generic_metadata__
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
The name of the post-init method for the model, if defined.
__pydantic_root_model__
Whether the model is a [RootModel][pydantic.root_model.RootModel].
__pydantic_serializer__
The pydantic-core SchemaSerializer used to dump instances of the model.
__pydantic_validator__
The pydantic-core SchemaValidator used to validate instances of the model.
__pydantic_fields__
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
__pydantic_computed_fields__
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_extra__
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
__pydantic_fields_set__
The names of fields explicitly set during instantiation.
__pydantic_private__
Values of private attributes set on the model instance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class SearchList(BaseModel):
    title: str = Field(..., title="Search List title")
    searchTerms: List[SearchTerm] = Field(
        ..., title="The terms of the search list"
    )

Ancestors

  • pydantic.main.BaseModel

Class variables

var model_config
var searchTerms : List[SearchTerm]
var title : str
class SearchLists (**data: Any)

Usage docs: https://docs.pydantic.dev/2.10/concepts/models/

A base class for creating Pydantic models.

Attributes

__class_vars__
The names of the class variables defined on the model.
__private_attributes__
Metadata about the private attributes of the model.
__signature__
The synthesized __init__ [Signature][inspect.Signature] of the model.
__pydantic_complete__
Whether model building is completed, or if there are still undefined fields.
__pydantic_core_schema__
The core schema of the model.
__pydantic_custom_init__
Whether the model has a custom __init__ function.
__pydantic_decorators__
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_generic_metadata__
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
The name of the post-init method for the model, if defined.
__pydantic_root_model__
Whether the model is a [RootModel][pydantic.root_model.RootModel].
__pydantic_serializer__
The pydantic-core SchemaSerializer used to dump instances of the model.
__pydantic_validator__
The pydantic-core SchemaValidator used to validate instances of the model.
__pydantic_fields__
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
__pydantic_computed_fields__
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_extra__
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
__pydantic_fields_set__
The names of fields explicitly set during instantiation.
__pydantic_private__
Values of private attributes set on the model instance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class SearchLists(BaseModel):
    lists: Optional[List[SearchList]] = Field(
        None, title="Configured lists of search terms"
    )

Ancestors

  • pydantic.main.BaseModel

Class variables

var lists : Optional[List[SearchList]]
var model_config
class SearchTerm (**data: Any)

Usage docs: https://docs.pydantic.dev/2.10/concepts/models/

A base class for creating Pydantic models.

Attributes

__class_vars__
The names of the class variables defined on the model.
__private_attributes__
Metadata about the private attributes of the model.
__signature__
The synthesized __init__ [Signature][inspect.Signature] of the model.
__pydantic_complete__
Whether model building is completed, or if there are still undefined fields.
__pydantic_core_schema__
The core schema of the model.
__pydantic_custom_init__
Whether the model has a custom __init__ function.
__pydantic_decorators__
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
__pydantic_generic_metadata__
Metadata for generic models; contains data used for a similar purpose to args, origin, parameters in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__
Parent namespace of the model, used for automatic rebuilding of models.
__pydantic_post_init__
The name of the post-init method for the model, if defined.
__pydantic_root_model__
Whether the model is a [RootModel][pydantic.root_model.RootModel].
__pydantic_serializer__
The pydantic-core SchemaSerializer used to dump instances of the model.
__pydantic_validator__
The pydantic-core SchemaValidator used to validate instances of the model.
__pydantic_fields__
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
__pydantic_computed_fields__
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
__pydantic_extra__
A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to 'allow'.
__pydantic_fields_set__
The names of fields explicitly set during instantiation.
__pydantic_private__
Values of private attributes set on the model instance.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class SearchTerm(BaseModel):
    term: str = Field(
        ...,
        examples=["Cancer", "Date of Birth"],
        title="The explicit term to search in the document for",
    )
    coding: Optional[Coding] = Field(
        None, title="The coding to associate with the search term"
    )
    resourceTypes: Optional[List[ResourceType]] = Field(
        None, title="The resource type(s) to associate with the search term"
    )

Ancestors

  • pydantic.main.BaseModel

Class variables

var coding : Optional[Coding]
var model_config
var resourceTypes : Optional[List[ResourceType]]
var term : str
class SpellCheckerSwitch (value, names=None, *, module=None, qualname=None, type=None, start=1)

An enumeration.

Expand source code
class SpellCheckerSwitch(Enum):
    OFF = "OFF"
    ON = "ON"

Ancestors

  • enum.Enum

Class variables

var OFF
var ON