Mappers

DemographicInfoMapper

class q2_cores.SOA.mappers.demographic_info_mapper.DemographicInfoMapper(list_of_queries, ssn, ident_info_mapping, flex_field_mapping, address_name_mapping, primary_cif, hq_credentials=None, zone_context=None)[source]

Bases: BaseMapper

parse_returned_queries(list_of_queries)[source]

After all queries in list_of_queries have been run, this parses the results into a standardized response type.

Return type:

DemographicInfo

check_ssn_from_queries(list_of_queries)[source]

Searches a list of demo queries and checks that the ssn matches the given ssn :type list_of_queries: :param list_of_queries: a list of demographic queries :rtype: list :return: list of queries already objectified

sort_through_address_ids()[source]
Return type:

list

get_names_from_demos()[source]

Searches a list of demo queries to find the names in the object :rtype: tuple :return: first name, middle initial, last name

get_dob_from_demos()[source]

Searches a list of demo queries to find the dob and format it correctly :rtype: str :return: dob

gather_phones_from_demo()[source]

Searches a list of demo queries to all phone numbers and builds phone objects from them :rtype: list :return: A list of phone objects

gather_emails_from_demo()[source]

Searches a list of demo queries to all emails :param list_of_queries: A list of already cleared demo objects :rtype: list :return: A list of emails

static search_ident_fields(xml_object, type_code)[source]

Searches the ident fields in the demo object for various data :type xml_object: :param xml_object: The xml object to search in :type type_code: :param type_code: The type code to look for :rtype: tuple :return: The value for the ident field if found and issuing value

static search_flex_fields(xml_object, type_code)[source]

Searches the flex fields in the demo object for various data :type xml_object: :param xml_object: The xml object to search in :type type_code: :param type_code: The type code to look for :rtype: str :return: The value for the ident field if found and issuing value

get_drivers_license()[source]

Searches a list of demo queries to find the drivers license wherever it might be :rtype: DriverLicense :return: drivers license object

get_mothers_maiden_name()[source]

Searches a list of demo queries to find the Mothers Maiden Name wherever it might be :rtype: str :return: drivers license object

get_addresses(list_of_address_queries, address_ids)[source]

Creates Address objects for each address query given :type list_of_address_queries: :param list_of_address_queries: A list of address queries :type address_ids: :param address_ids: A list of address IDs to look for specifically :rtype: List[Address] :return: A list of Address objects

static unpack_address(address_object)[source]

Unpacks the address from an xml object and returns it as an Address object :type address_object: :param address_object: xml object of address response :rtype: Optional[Address] :return: Address object

InitialSearchMapper

class q2_cores.SOA.mappers.initial_search_mapper.InitialSearchMapper(list_of_queries, cif_mapping=None, hq_credentials=None, zone_context=None)[source]

Bases: BaseMapper

parse_returned_queries(list_of_queries)[source]

After all queries in list_of_queries have been run, this parses the results into a standardized response type.

Return type:

SOAData