tangier_api.api package¶
Submodules¶
tangier_api.api.location module¶
-
class
tangier_api.api.location.
LocationConnection
(xml_string='', endpoint='https://tangierweb.com/webservices/LocationMaintenance/LocationMaintenance.asmx?WSDL', show_xml_request=False, show_xml_response=False)[source]¶ Bases:
object
-
MaintainLocations
(xml_string)[source]¶ WSDL GetLocation method
Parameters: xml_string – (xml str) fully formed xml string for GetLocation request Returns:
-
add_location
(site_id=None, xml_string=None, name=None, short_name=None, **kwargs)[source]¶ Parameters: - site_id – (str) id of site to be added
- xml_string – (xml string) overrides the default credential and/or location injection into base_xml
- kwargs – additional named properties to be provided in the creation request.
Returns: xml response string with an error message or info about a location.
-
delete_location
(site_id=None, xml_string=None)[source]¶ Parameters: - site_id – (str) id of site to be deleted
- xml_string – (xml string) overrides the default credential and/or location injection into base_xml
Returns: xml response string with an error message or info about a location.
-
get_locations_info
(site_ids=None, xml_string=None)[source]¶ Parameters: xml_string – (xml string) overrides the default credential and/or location injection into base_xml Returns: xml response string with an error message or info about a location.
-
location_info_values_list
(site_ids=None)[source]¶ Returns a Searchable List object (subclass of list) of all locations returned by get_locations_info :param provider_ids: (list) of all emp_ids corresponding to desired locations info :return: (SearchableList) of all locations returned by get_locations_info
-
update_location
(site_id=None, new_site_id=None, xml_string=None, name=None, short_name=None, **kwargs)[source]¶ Parameters: - site_id – (str) id of site to be added
- new_site_id – (str) id of site to be renamed, if desired
- xml_string – (xml string) overrides the default credential and/or location injection into base_xml
- kwargs – additional named properties to be provided in the creation request.
Returns: xml response string with an error message or info about a location.
-
tangier_api.api.provider module¶
-
class
tangier_api.api.provider.
ProviderConnection
(xml_string='', endpoint='https://tangierweb.com/webservices/ProviderMaintenance/ProviderMaintenance.asmx?WSDL')[source]¶ Bases:
object
-
get_provider_info
(provider_ids=None, use_primary_keys=True, all_providers=True, xml_string='', **tags)[source]¶ Method to retrieve info on all providers corresponding to the list “provider_ids”
Parameters: - provider_ids – (list) of all emp_ids corresponding to desired provider info
- use_primary_keys – (bool) indicates whether provider_ids should be treated as emp_id or provider_primary_key
- all_providers – (bool) indicates whether to return data on all existing providers
- xml_string – (xml string) overrides default xml string provided by the instantiation of the class object
- tags – (kwargs) things to be injected into the request. ex: start_date=”2017-05-01”, end_date=”2017-05-02”
Returns:
-
tangier_api.api.schedule module¶
-
class
tangier_api.api.schedule.
ScheduleConnection
(xml_string='', site_file=None, site_id_column_header='site_id', testing=False, endpoint='https://tangierweb.com/webservices/schedulerequest/schedulerequest.asmx?WSDL', debug=False)[source]¶ Bases:
object
-
GetSchedule
(xml_string='')[source]¶ WSDL GetSchedule method
Parameters: xml_string – (xml str) fully formed xml string for GetSchedule request Returns:
-
date_format
= '%Y-%m-%d'¶
-
datetime_format
= '%Y-%m-%dT%H:%M:%S'¶
-
get_schedule
(start_date=None, end_date=None, site_id=None, emp_id=None, xml_string='', **tags)[source]¶ Wrapper for the GetSchedule method which facilitates adding necessary tags to the default xml string. Pulls schedule for one site for a given date range.
Parameters: - start_date – (str) %Y-%m-%d date string indicating the beginning of the range from which to pull the schedule
- end_date – (str) %Y-%m-%d date string indicating the ending of the range from which to pull the schedule
- site_id – (str or int) id corresponding to the site that the schedule will be pulled from
- xml_string – (xml string)overrides the default credential and/or schedule injection into base_xml
- tags – (kwargs) things to be injected into the request.
Returns: xml response string with an error message or a schedule.
-
get_schedule_values_list
(start_date=None, end_date=None, site_ids=None, emp_ids=None, xml_string='', **tags)[source]¶ Wrapper for the get_schedules function that returns the retrieved schedules as a list of dicts. This can easily be converted into a DataFrame
Parameters: - start_date – (str) %Y-%m-%d date string indicating the beginning of the range from which to pull the schedule
- end_date – (str) %Y-%m-%d date string indicating the ending of the range from which to pull the schedule
- site_ids – (list or None) list of ids corresponding to the site(s) that the schedule will be pulled from, defaults to the list pulled from site_file in the __init__ function
- emp_ids – (list or None) list of emp_ids corresponding to the employee(s) that the schedule will be pulled for
- xml_string – (xml string) overrides the default credential and/or schedule injection into base_xml
- tags – (kwargs) things to be injected into the request.
Returns: (OrderedDict) filled with schedules.
-
get_schedules
(start_date=None, end_date=None, site_ids=None, xml_string='', **tags)[source]¶ Wrapper for the GetSchedule method which facilitates adding necessary tags to the default xml string. Pulls schedule for multiple sites for a given date range. Makes multiple API calls to get schedules from multiple facilities.
Parameters: - start_date – (str) %Y-%m-%d date string indicating the beginning of the range from which to pull the schedule
- end_date – (str) %Y-%m-%d date string indicating the ending of the range from which to pull the schedule
- site_ids – (list or None) list of ids corresponding to the site(s) that the schedule will be pulled from, defaults to the list pulled from site_file in the __init__ function
- xml_string – (xml string) overrides the default credential and/or schedule injection into base_xml
- tags – (kwargs) things to be injected into the request.
Returns: xml response string with an error message or a schedule.
-
in_date_format
= '%m/%d/%Y'¶
-
time_format
= '%I:%M %p'¶
-
tangier_api.api.specialty module¶
-
class
tangier_api.api.specialty.
ProviderLocations
(pconn, lconn)[source]¶ Bases:
object
-
all_location_provider_values
¶ we want to go get them if an access is attempted and we haven’t gotten them already
-
-
class
tangier_api.api.specialty.
ProviderReport
(file, *args, **kwargs)[source]¶ Bases:
tangier_api.api.provider.ProviderConnection
-
add_to_report
(*args, key_column='provider_id')[source]¶ Adds the specified provider information to an excel or csv report according to NPI (emp_id)
Parameters: - args – (list) of provider fields to be retrieved from tangier and added to the report
- key_column – (str) indicates the header name of the column that contains npis or emp_ids on the report
Returns: None
-
-
class
tangier_api.api.specialty.
ScheduleManipulation
(xml_string='', site_file=None, site_id_column_header='site_id', testing=False, endpoint='https://tangierweb.com/webservices/schedulerequest/schedulerequest.asmx?WSDL', debug=False)[source]¶ Bases:
tangier_api.api.schedule.ScheduleConnection
-
get_schedule_conflicts
(info=False)[source]¶ Gets DataFrame of all entries where an employee worked a double-booked shift in the saved_schedule
Parameters: info – (bool) whether or not to print out progress Returns: (DataFrame) of all entries where an employee worked a double-booked shift
-
get_schedule_duplicates
(info=False)[source]¶ Gets DataFrame of all duplicate entries in the saved_schedule
Parameters: info – (bool) whether or not to print out progress Returns: (DataFrame) of all duplicate entries
-
get_schedule_empties
(info=False)[source]¶ Gets DataFrame of all entries from schedule which were not worked (reportedminutes == 0) in the saved_schedule
Parameters: info – (bool) whether or not to print out progress Returns: (DataFrame) of all entries from schedule which were not worked (reportedminutes == 0)
-
get_schedule_open
(info=False)[source]¶ Gets DataFrame of all entries from schedule where providername == “open” in the saved_schedule
Parameters: info – (bool) whether or not to print out progress Returns: (DataFrame) of all entries from schedule which were not worked (reportedminutes == 0)
-
remove_schedule_empties
()[source]¶ Removes all entries from schedule which were not worked (reportedminutes == 0) in the saved_schedule
Returns:
-
remove_schedule_open
()[source]¶ Removes all entries from schedule which are just open shifts (providername == ‘open’) in the saved_schedule
Returns:
-
save_schedule_from_range
(start_date=None, end_date=None, site_ids=None, xml_string='', **tags)[source]¶ Saves schedule for indicated date range and facilities to ScheduleConnection object
Parameters: - start_date – (str) %Y-%m-%d date string indicating the beginning of the range from which to pull the schedule
- end_date – (str) %Y-%m-%d date string indicating the ending of the range from which to pull the schedule
- site_ids – (list or None) list of ids corresponding to the site(s) that the schedule will be pulled from, defaults to the list pulled from site_file in the __init__ function
- xml_string – (xml string) overrides the default credential and/or schedule injection into base_xml
- tags – (kwargs) things to be injected into the request.
Returns:
-