covid19-etl/etl/idph_hospital.py
def parse_file(self, latest_submitted_date, url):
        """
        Converts a JSON files to data we can submit via Sheepdog. Stores the
        records to submit in `self.summary_locations` and `self.summary_clinicals`.

        Args:
            latest_submitted_date (date): the date of latest available "summary_clinical" for project
            url (str): URL at which the JSON file is available
        """
        print("Getting data from {}".format(url))
        with closing(self.get(url, stream=True)) as r:
            data = r.json()
            date = idph_get_date(data["LastUpdateDate"])

            if latest_submitted_date and date == latest_submitted_date.strftime(
                "%Y-%m-%d"
            ):
                print(
                    "Nothing to submit: latest submitted date and date from data are the same."
                )
                return

            (
                summary_location,
                summary_clinical_statewide_current,
            ) = self.parse_statewide_values(date, data["statewideValues"])

            self.summary_locations.append(summary_location)

            for utilization in data["HospitalUtilizationResults"]:
                summary_clinical = self.parse_historical(
                    utilization, summary_clinical_statewide_current
                )

                self.summary_clinicals.append(summary_clinical)

            for region in data["regionValues"]:
                (summary_location, summary_clinical) = self.parse_region(date, region)

                self.summary_locations.append(summary_location)
                self.summary_clinicals.append(summary_clinical)

        Converts a JSON files to data we can submit via Sheepdog. Stores the
        records to submit in `self.summary_locations` and `self.summary_clinicals`.

        Args:
            latest_submitted_date (date): the date of latest available "summary_clinical" for project
            url (str): URL at which the JSON file is available
        
Converts a JSON files to data we can submit via Sheepdog.
Converts a JSON files to data we can submit via Sheepdog .
def parse_file(self, latest_submitted_date, url):
        print("Getting data from {}".format(url))
        with closing(self.get(url, stream=True)) as r:
            data = r.json()
            date = idph_get_date(data["LastUpdateDate"])
            if latest_submitted_date and date == latest_submitted_date.strftime(
                "%Y-%m-%d"
            ):
                print(
                    "Nothing to submit: latest submitted date and date from data are the same."
                )
                return
            (
                summary_location,
                summary_clinical_statewide_current,
            ) = self.parse_statewide_values(date, data["statewideValues"])
            self.summary_locations.append(summary_location)
            for utilization in data["HospitalUtilizationResults"]:
                summary_clinical = self.parse_historical(
                    utilization, summary_clinical_statewide_current
                )
                self.summary_clinicals.append(summary_clinical)
            for region in data["regionValues"]:
                (summary_location, summary_clinical) = self.parse_region(date, region)
                self.summary_locations.append(summary_location)
                self.summary_clinicals.append(summary_clinical)
def parse_file ( self , latest_submitted_date , url ) : print ( "Getting data from {}" . format ( url ) ) with closing ( self . get ( url , stream = True ) ) as r : data = r . json ( ) date = idph_get_date ( data [ "LastUpdateDate" ] ) if latest_submitted_date and date == latest_submitted_date . strftime ( "%Y-%m-%d" ) : print ( "Nothing to submit: latest submitted date and date from data are the same." ) return ( summary_location , summary_clinical_statewide_current , ) = self . parse_statewide_values ( date , data [ "statewideValues" ] ) self . summary_locations . append ( summary_location ) for utilization in data [ "HospitalUtilizationResults" ] : summary_clinical = self . parse_historical ( utilization , summary_clinical_statewide_current ) self . summary_clinicals . append ( summary_clinical ) for region in data [ "regionValues" ] : ( summary_location , summary_clinical ) = self . parse_region ( date , region ) self . summary_locations . append ( summary_location ) self . summary_clinicals . append ( summary_clinical )
Converts a JSON files to data we can submit via Sheepdog.
Converts a JSON files to data we can submit via Sheepdog .
"""
        Converts a JSON files to data we can submit via Sheepdog. Stores the
        records to submit in `self.summary_locations` and `self.summary_clinicals`.

        Args:
            latest_submitted_date (date): the date of latest available "summary_clinical" for project
            url (str): URL at which the JSON file is available
        """
self
latest_submitted_date
the date of latest available "summary_clinical" for project
the date of latest available " summary_clinical " for project
url
URL at which the JSON file is available
URL at which the JSON file is available