health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38
Loading...

Query the Data Delivery Network

Query the DDN

The easiest way to query any data on Splitgraph is via the "Data Delivery Network" (DDN). The DDN is a single endpoint that speaks the PostgreSQL wire protocol. Any Splitgraph user can connect to it at data.splitgraph.com:5432 and query any version of over 40,000 datasets that are hosted or proxied by Splitgraph.

For example, you can query the individual_provider_network_data_2017 table in this repository, by referencing it like:

"health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38:latest"."individual_provider_network_data_2017"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "pace_indicator", -- 0=No 1=Yes 
    "nysoh_indiv_st_silver", -- 0=No 1=Yes 
    "nysoh_shop_non_st_platinum_1", -- 0=No 1=Yes 
    "nysoh_shop_non_st_bronze_1", -- 0=No 1=Yes 
    "longitude",
    "wheel_chair_accessibility", -- 0=No  1=Yes 
    "primary_designation", -- 1=PCP 2=Specialist 3=PCP and Specialist 
    "national_provider_identifier", -- NPI, 10 digits only
    "first_name", -- First name of provider
    "pndsid", -- ID associated with plan submitter
    "nysoh_shop_non_st_bronze_3", -- 0=No 1=Yes 
    "nysoh_shop_non_st_bronze_2", -- 0=No 1=Yes 
    "nysoh_indiv_st_bronze", -- 0=No 1=Yes 
    "nysoh_indiv_non_st_silver_1", -- 0=No 1=Yes 
    "nysoh_indiv_adult_dental", -- 0=No 1=Yes 
    "nysoh_indiv_pediatric_dental_low", -- 0=No 1=Yes 
    "nysoh_indiv_catastrophic", -- 0=No 1=Yes 
    "nysoh_indiv_child_only_platinum", -- 0=No 1=Yes 
    "nysoh_indiv_child_only_gold", -- 0=No 1=Yes 
    "language_7", -- See Appendix VI of PNDS Data Dictionary at https://www.health.ny.gov/health_care/managed_care/docs/dictionary.pdf
    "provider_location_permanent_facility_identifier_pfi", -- For PCPs only See Operating Facility Codes
    "prov_operating_number",
    "ha_permanent_facility_identifier_pfi_1", -- Corresponds to HA OPCERT #1
    "hospital_affiliation_ha_operating_certificate_opcert_1", -- See Operating Facility codes 99999999=Not Applicable (for non-PCP, non-OB/GYN)
    "nysoh_indiv_st_platinum", -- 0=No 1=Yes 
    "partial_caps_indicator", -- 0=No 1=Yes 
    "nysoh_indiv_family_dental", -- 0=No 1=Yes 
    "nysoh_indiv_non_st_bronze_2", -- 0=No 1=Yes 
    "board_status_primary_specialty", -- 1=Not Board Cert; Residency Incomplete 2=Not Board Certified; Residency Complete. 3=Board Certified 4=No Board Cert Avail 9=Not Applicable
    "nysoh_indiv_non_st_silver_2", -- 0=No 1=Yes 
    "borough_county_code", -- FIPS code
    "nysoh_indiv_non_st_platinum_2", -- 0=No 1=Yes 
    "nysoh_indiv_non_st_bronze_3", -- 0=No 1=Yes 
    "state_std", -- Standardized state name
    "plan_name", -- Name of plan submitter
    "street_address", -- Address 1
    "nysoh_shop_non_st_silver_3", -- 0=No 1=Yes 
    "nysoh_shop_non_st_silver_1", -- 0=No 1=Yes 
    "nysoh_shop_st_platinum", -- 0=No 1=Yes 
    "nysoh_shop_st_gold", -- 0=No 1=Yes 
    "board_status_secondary_specialty", -- 1=Not Board Cert; Residency Incomplete 2=Not Board Certified; Residency Complete. 3=Board Certified 4=No Board Cert Avail
    "nysoh_shop_non_st_gold_1", -- 0=No 1=Yes 
    "nysoh_shop_pediatric_dental_high", -- 0=No 1=Yes 
    "map_indicator", -- 0=No 1=Yes 
    "nysoh_shop_st_silver", -- 0=No 1=Yes 
    "commercial_non_mco_dental_indicator", -- 0=No 1=Yes 
    "nysoh_shop_non_st_gold_2", -- 0=No 1=Yes 
    "nysoh_shop_family_dental", -- 0=No 1=Yes 
    "nysoh_shop_non_st_platinum_2", -- 0=No 1=Yes 
    "latitude",
    "nysoh_shop_adult_dental", -- 0=No 1=Yes 
    "nysoh_shop_st_bronze", -- 0=No 1=Yes 
    "medicaid_provider_indicator", -- 0=No 1=Yes
    "language_5", -- See Appendix VI of PNDS Data Dictionary at https://www.health.ny.gov/health_care/managed_care/docs/dictionary.pdf
    "nysoh_shop_non_st_gold_3", -- 0=No 1=Yes 
    "nysoh_shop_non_st_silver_2", -- 0=No 1=Yes 
    "nysoh_indiv_non_st_bronze_1", -- 0=No 1=Yes 
    "nysoh_indiv_non_st_gold_2", -- 0=No 1=Yes 
    "nysoh_indiv_non_st_gold_1", -- 0=No 1=Yes 
    "nysoh_indiv_child_only_bronze", -- 0=No 1=Yes 
    "nysoh_shop_pediatric_dental_low", -- 0=No 1=Yes 
    "language_3", -- See Appendix VI of PNDS Data Dictionary at https://www.health.ny.gov/health_care/managed_care/docs/dictionary.pdf
    "fida_indicator", -- 0=No 1=Yes 
    "last_name", -- Last name of provider
    "child_health_plus_chp_provider_indicator", -- 0=No 1=Yes
    "nysoh_indiv_st_gold", -- 0=No 1=Yes 
    "nysoh_indiv_child_only_silver", -- 0=No 1=Yes 
    "commercial_non_mco_medical_indicator", -- 0=No 1=Yes 
    "nysoh_indiv_pediatric_dental_high", -- 0=No 1=Yes 
    "harp_indicator", -- 0=No 1=Yes 
    "language_4", -- See Appendix VI of PNDS Data Dictionary at https://www.health.ny.gov/health_care/managed_care/docs/dictionary.pdf
    "nysoh_indiv_non_st_silver_3", -- 0=No 1=Yes 
    "nysoh_shop_non_st_platinum_3", -- 0=No 1=Yes 
    "commercial_non_mco_vision_indicator", -- 0=No 1=Yes 
    "quarter",
    "nysoh_indiv_non_st_platinum_1", -- 0=No 1=Yes 
    "medicaid_advantage_indicator", -- 0=No 1=Yes 
    "gender", -- 1=Male 2=Female
    "commercial_provider_indicator", -- 0=No 1=Yes 
    "nysoh_indiv_non_st_platinum_3", -- 0=No 1=Yes 
    "nysoh_standard_essential_plan_ep_indicator", -- 0=No 1=Yes 
    "nysoh_ep_plus_adult_vision_dental_indicator", -- 0=No 1=Yes 
    "hospital_affiliation_ha_operating_certificate_opcert_2", -- See Operating Facility codes 99999999=Not Applicable (for non-PCP, non-OB/GYN)
    "nysoh_indiv_non_st_gold_3", -- 0=No 1=Yes 
    "ha_permanent_facility_identifier_pfi_2", -- Corresponds to HA OPCERT #2
    "hospital_affiliation_ha_operating_certificate_opcert_3", -- See Operating Facility codes 99999999=Not Applicable (for non-PCP)
    "ha_permanent_facility_identifier_pfi_3", -- Corresponds to HA OPCERT #3
    "language_1", -- See Appendix VI of PNDS Data Dictionary at https://www.health.ny.gov/health_care/managed_care/docs/dictionary.pdf
    "secondary_specialty", -- See Appendix
    "language_2", -- See Appendix VI of PNDS Data Dictionary at https://www.health.ny.gov/health_care/managed_care/docs/dictionary.pdf
    "primary_specialty", -- See Appendix
    "provider_type", -- 01=MD 02=CNP Nurse Practitioner 03=CNM 04=CSW 05=Clinical Psych       06=OD Optometrist 08=DDS 09=DPM Podiatrist 10=Chiropractor 11=Other 12=DO 14=Psychologist  15=Counselor 16=Social Work 18=DMD 19=OMS 20=Acupuncturist 22=RN 23=Physician Assistant (PA) 30=Audiologist 40=CDN Dietician/Nutritionist 50=CM (not a nurse) 60=PT 61=OT 62=SLP 63=CFY 64=RT
    "zip_code", -- Standardized zip code
    "true_county", -- County Name
    "town_city", -- Standardized city name
    "language_6", -- See Appendix VI of PNDS Data Dictionary at https://www.health.ny.gov/health_care/managed_care/docs/dictionary.pdf
    "room_or_suite", -- If Not Applicable “NA”
    "site_name" -- Office or Professional Building
FROM
    "health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38:latest"."individual_provider_network_data_2017"
LIMIT 100;

Connecting to the DDN is easy. All you need is an existing SQL client that can connect to Postgres. As long as you have a SQL client ready, you'll be able to query health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38 with SQL in under 60 seconds.

Query Your Local Engine

Install Splitgraph Locally
bash -c "$(curl -sL https://github.com/splitgraph/splitgraph/releases/latest/download/install.sh)"
 

Read the installation docs.

Splitgraph Cloud is built around Splitgraph Core (GitHub), which includes a local Splitgraph Engine packaged as a Docker image. Splitgraph Cloud is basically a scaled-up version of that local Engine. When you query the Data Delivery Network or the REST API, we mount the relevant datasets in an Engine on our servers and execute your query on it.

It's possible to run this engine locally. You'll need a Mac, Windows or Linux system to install sgr, and a Docker installation to run the engine. You don't need to know how to actually use Docker; sgrcan manage the image, container and volume for you.

There are a few ways to ingest data into the local engine.

For external repositories, the Splitgraph Engine can "mount" upstream data sources by using sgr mount. This feature is built around Postgres Foreign Data Wrappers (FDW). You can write custom "mount handlers" for any upstream data source. For an example, we blogged about making a custom mount handler for HackerNews stories.

For hosted datasets (like this repository), where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Cloning Data

Because health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38:latest is a Splitgraph Image, you can clone the data from Spltgraph Cloud to your local engine, where you can query it like any other Postgres database, using any of your existing tools.

First, install Splitgraph if you haven't already.

Clone the metadata with sgr clone

This will be quick, and does not download the actual data.

sgr clone health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38

Checkout the data

Once you've cloned the data, you need to "checkout" the tag that you want. For example, to checkout the latest tag:

sgr checkout health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38:latest

This will download all the objects for the latest tag of health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38 and load them into the Splitgraph Engine. Depending on your connection speed and the size of the data, you will need to wait for the checkout to complete. Once it's complete, you will be able to query the data like you would any other Postgres database.

Alternatively, use "layered checkout" to avoid downloading all the data

The data in health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38:latest is 0 bytes. If this is too big to download all at once, or perhaps you only need to query a subset of it, you can use a layered checkout.:

sgr checkout --layered health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38:latest

This will not download all the data, but it will create a schema comprised of foreign tables, that you can query as you would any other data. Splitgraph will lazily download the required objects as you query the data. In some cases, this might be faster or more efficient than a regular checkout.

Read the layered querying documentation to learn about when and why you might want to use layered queries.

Query the data with your existing tools

Once you've loaded the data into your local Splitgraph Engine, you can query it with any of your existing tools. As far as they're concerned, health-data-ny-gov/individual-provider-network-data-2017-eshx-ep38 is just another Postgres schema.

Related Documentation:

Loading...