Query the Data Delivery Network
Query the DDNThe 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_2020_quarter_4
table in this repository, by referencing it like:
"health-data-ny-gov/individual-provider-network-data-2020-quarter-4-q8n3-y6yf:latest"."individual_provider_network_data_2020_quarter_4"
or in a full query, like:
SELECT
":id", -- Socrata column ID
"chp_panel_status", -- Child Health Plus (CHP) Panel Status refers to the availability of a physician to accept new CHP members which may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing Child Health Plus members 2 = Existing Child Health Plus members only 3 = Closed Child Health Plus Panel 9 = Not Applicable for Non-PCP
"harp_panel_size", -- Total number of HARP enrollees assigned to this provider at your managed care plan.
"commercial_panel_size", -- Panel size is the total number of capitated Commercial members assigned to this provider at your managed care plan.
"nysoh_medical_network_6_panel", -- NYSoH Medical Network Panel Status refers to the availability of a physician to accept new NYSoH Medical QHP members. 1 = Open to new and existing NYSoH Medical QHP members 2 = Existing NYSoH Medical QHP members only 3 = Closed NYSoH Medical QHP Panel 9 = Not Applicable for Non-PC
"site_npi", -- Provider facility’s National Provider Identifier (NPI)
"nysoh_ep_plus_adult_vision_1", -- NYSOH EP plus Adult Vision and Dental Panel Status refers to the availability of a physician to accept new NYSOH EP plus Adult Vision and Dental members. 1 = Open to new and existing NYSOH EP plus Adult Vision and Dental members 2 = Existing NYSOH EP plus Adult Vision and Dental members only 3 = Closed NYSOH EP plus Adult Vision and Dental Panel 9 = Not Applicable for Non-PCP
"medicaid_advantage_panel", -- Medicaid Advantage Panel Status refers to the availability of a physician to accept new Medicaid Advantage members which may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing Medicaid Advantage members 2 = Existing Medicaid Advantage members only 3 = Closed Medicaid Advantage Panel 9 = Not Applicable for Non-PC
"commercial_panel_status", -- Commercial Panel Status refers to the availability of a PCP to accept new members who may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing Commercial members 2 = Existing Commercial members/enrollees only 3 = Closed Commercial Panel 9 = Not Applicable for Non-PC
"nysoh_medical_network_6", -- 0=No 1=Yes
"nysoh_medical_network_2", -- 0=No 1=Yes
"pnds_id", -- Provider Network Data System (PNDS) identification number associated with plan submitter
"language_4", -- Languages that a provider or clinical staff member can speak to a member.
"language_3", -- Languages that a provider or clinical staff member can speak to a member.
"language_1", -- Languages that a provider or clinical staff member can speak to a member.
"ha_permanent_facility_2", -- Permanent Facility Identifier (PFI) corresponding to HAOPECRT #3
"ha_permanent_facility", -- Permanent Facility Identifier (PFI) corresponding to HAOPECRT #1
"commercial_non_mco_dental_3", -- 0=No 1=Yes
"national_provider_identifier", -- The National Provider Identifier (NPI) is a 10-digit identification number issued to health care providers
"site_name", -- Standardized name of the office or facility building
"commercial_non_mco_vision_5", -- 0=No 1=Yes
"room_or_suite", -- Room or suite number of the provider’s office
"street_address", -- Standardized street address of the site
"town_city", -- Standardized name of the town or city
"county", -- County name
"nysoh_medical_network_9_panel_1", -- Total number of NYSoH Medical Network enrollees assigned to this provider at your managed care plan.
"borough_county_code", -- Federal Information Processing Standard (FIPS) county or borough code, based on geolocation
"state", -- Standardized state name
"zip_code", -- Standardized zip code
"latitude", -- System-generated latitude for reported address
"longitude", -- System-generated longitude for reported address
"area_code", -- Area code of the provider
"phone_number", -- Phone number of the provider
"provider_type", -- Degree or licensure of the provider. Refer to codes in the PNDS data dictionary.
"primary_specialty", -- Primary specialty of the provider. Refer to codes in the PNDS data dictionary.
"secondary_specialty", -- Secondary specialty of the provider. Refer to codes in the PNDS data dictionary.
"board_status_primary_specialty", -- Level of education/training completed by a provider towards a recognized medical specialty certificate for the provider’s primary specialty. Refer to codes in the PNDS data dictionary.
"provider_s_gender", -- 1=Male 2=Female
"harp_indicator", -- 0=No 1=Yes
"medicaid_advantage_indicator", -- 0=No 1=Yes
"nysoh_ep_plus_adult_vision", -- 0=No 1=Yes
"commercial_non_mco_medical_1", -- 0=No 1=Yes
"commercial_non_mco_medical_6", -- 0=No 1=Yes
"commercial_non_mco_vision_2", -- 0=No 1=Yes
"commercial_non_mco_dental_2", -- 0=No 1=Yes
"hospital_affiliation_ha", -- Operating certificate (OPCERT) number of hospitals affiliated with the provider
"hospital_affiliation_ha_1", -- Operating certificate (OPCERT) number of hospitals affiliated with the provider
"ha_permanent_facility_1", -- Permanent Facility Identifier (PFI) corresponding to HAOPECRT #2
"commercial_non_mco_vision_4", -- 0=No 1=Yes
"hospital_affiliation_ha_2", -- Operating certificate (OPCERT) number of hospitals affiliated with the provider
"provider_location_facility", -- Operating certificate (OPCERT) number of the provider’s location
"provider_location_permanent", -- The Permanent Facility Identifier (PFI) of the provider’s location
"nysoh_medical_network_1_panel_1", -- Total number of NYSoH Medical Network enrollees assigned to this provider at your managed care plan.
"language_2", -- Languages that a provider or clinical staff member can speak to a member.
"language_6", -- Languages that a provider or clinical staff member can speak to a member.
"language_7", -- Languages that a provider or clinical staff member can speak to a member.
"nysoh_medical_network_3", -- 0=No 1=Yes
"nysoh_medical_network_7", -- 0=No 1=Yes
"nysoh_dental_network_2", -- 0=No 1=Yes
"nysoh_dental_network_3", -- 0=No 1=Yes
"medicaid_panel_status", -- Medicaid Panel Status refers to the availability of a PCP or designated OB/GYN Specialist to accept new Medicaid or HIV SNP members. 1=Open to new and existing Medicaid and/or HIV SNP members 2=Existing Medicaid and/or SNP members only 3=Closed Medicaid and/or HIV SNP Panel 9=Not Applicable for Non-PCP and non-Medicaid/SNP OB/GYNs
"partial_caps_panel_status", -- Partial CAPS Panel Status refers to the availability of a physician to accept new Partial CAPS members which may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing Partial CAPS members 2 = Existing Partial CAPS members only 3 = Closed Partial CAPS Panel 9 = Not Applicable for Non-PCP
"map_panel_status", -- MAP Panel Status refers to the availability of a physician to accept new MAP members which may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing MAP members 2 = Existing MAP members only 3 = Closed MAP Panel 9 = Not Applicable for Non-PCP
"pace_panel_status", -- Panel Status refers to the availability of a physician to accept new PACE members which may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing PACE members 2 = Existing PACE members only 3 = Closed PACE Panel 9 = Not Applicable for Non-PCP
"nysoh_medical_network_1_panel", -- NYSoH Medical Network Panel Status refers to the availability of a physician to accept new NYSoH Medical QHP members. 1 = Open to new and existing NYSoH Medical QHP members 2 = Existing NYSoH Medical QHP members only 3 = Closed NYSoH Medical QHP Panel 9 = Not Applicable for Non-PC
"nysoh_medical_network_2_panel", -- NYSoH Medical Network Panel Status refers to the availability of a physician to accept new NYSoH Medical QHP members. 1 = Open to new and existing NYSoH Medical QHP members 2 = Existing NYSoH Medical QHP members only 3 = Closed NYSoH Medical QHP Panel 9 = Not Applicable for Non-PC
"nysoh_medical_network_3_panel", -- NYSoH Medical Network Panel Status refers to the availability of a physician to accept new NYSoH Medical QHP members. 1 = Open to new and existing NYSoH Medical QHP members 2 = Existing NYSoH Medical QHP members only 3 = Closed NYSoH Medical QHP Panel 9 = Not Applicable for Non-PC
"nysoh_medical_network_4_panel", -- NYSoH Medical Network Panel Status refers to the availability of a physician to accept new NYSoH Medical QHP members. 1 = Open to new and existing NYSoH Medical QHP members 2 = Existing NYSoH Medical QHP members only 3 = Closed NYSoH Medical QHP Panel 9 = Not Applicable for Non-PC
"nysoh_medical_network_7_panel", -- NYSoH Medical Network Panel Status refers to the availability of a physician to accept new NYSoH Medical QHP members. 1 = Open to new and existing NYSoH Medical QHP members 2 = Existing NYSoH Medical QHP members only 3 = Closed NYSoH Medical QHP Panel 9 = Not Applicable for Non-PC
"nysoh_medical_network_8_panel", -- NYSoH Medical Network Panel Status refers to the availability of a physician to accept new NYSoH Medical QHP members. 1 = Open to new and existing NYSoH Medical QHP members 2 = Existing NYSoH Medical QHP members only 3 = Closed NYSoH Medical QHP Panel 9 = Not Applicable for Non-PC
"nysoh_medical_network_9_panel", -- NYSoH Medical Network Panel Status refers to the availability of a physician to accept new NYSoH Medical QHP members. 1 = Open to new and existing NYSoH Medical QHP members 2 = Existing NYSoH Medical QHP members only 3 = Closed NYSoH Medical QHP Panel 9 = Not Applicable for Non-PC
"sip_pl_panel_status", -- SIP-PL Panel Status refers to the availability of a physician to accept new SIPPL members which may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing SIP-PL members 2 = Existing SIP-PL members only 3 = Closed SIP-PL Panel 9 = Not Applicable for Non-PCP
"hiv_snp_panel_status", -- HIV SNP Panel Status refers to the availability of a physician to accept new HIV SNP members which may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing HIV SNP members 2 = Existing HIV SNP members only 3 = Closed HIV SNP Panel 9 = Not Applicable for Non-PCP
"chp_panel_size", -- Total number of capitated Child Health Plus enrollees assigned to this provider at your managed care plan.
"medicaid_advantage_panel_1", -- Total number of capitated Medicaid Advantage enrollees assigned to this provider at your managed care plan.
"partial_caps_panel_size", -- Total number of Partial CAPS enrollees assigned to this provider at your managed care plan.
"pace_panel_size", -- Total number of PACE enrollees assigned to this provider at your managed care plan.
"nysoh_standard_essential_2", -- Total number of NYSOH Standard EP enrollees assigned to this provider at your plan.
"nysoh_medical_network_2_panel_1", -- Total number of NYSoH Medical Network enrollees assigned to this provider at your managed care plan.
"nysoh_medical_network_3_panel_1", -- Total number of NYSoH Medical Network enrollees assigned to this provider at your managed care plan.
"nysoh_medical_network_4_panel_1", -- Total number of NYSoH Medical Network enrollees assigned to this provider at your managed care plan.
"nysoh_medical_network_5_panel_1", -- Total number of NYSoH Medical Network enrollees assigned to this provider at your managed care plan.
"commercial_non_mco_vision_1", -- 0=No 1=Yes
"fidaidd_indicator", -- 0=No 1=Yes
"fida_idd_panel_size", -- Total number of FIDA IDD enrollees assigned to this provider at your managed care plan.
"child_health_plus_chp_provider", -- 0=No 1=Yes
"medicaid_provider_indicator", -- 0=No 1=Yes
"board_status_secondary", -- Level of education/training completed by a provider towards a recognized medical specialty certificate for the provider’s secondary specialty. Refer to codes in the PNDS data dictionary.
"medicaid_provider", -- Medicaid Provider Identification Number
"hiv_snp_panel_size", -- Total number of HIV SNP enrollees assigned to this provider at your managed care plan.
"first_name", -- Standardized first name of provider
"plan_name", -- Name of submitted health plan
"last_name", -- Standardized last name of provider
"wheel_chair_accessibility", -- Whether the office is wheelchair accessible 0=No 1=Yes
"quarter_year", -- Quarter and year of data submission
"primary_designation", -- Primary designation of a provider. Refer to codes in the PNDS data dictionary.
"pace_indicator", -- 0=No 1=Yes
"nysoh_standard_essential_1", -- NYSOH Standard EP Panel Status refers to the availability of a physician to accept new NYSOH Standard EP members. 1 = Open to new and existing NYSOH Standard EP members 2 = Existing NYSOH Standard EP members only 3 = Closed NYSOH Standard EP Panel 9 = Not Applicable for Non-PCP
"nysoh_standard_essential", -- 0=No 1=Yes
"nysoh_medical_network_8_panel_1", -- Total number of NYSoH Medical Network enrollees assigned to this provider at your managed care plan.
"nysoh_medical_network_8", -- 0=No 1=Yes
"nysoh_medical_network_6_panel_1", -- Total number of NYSoH Medical Network enrollees assigned to this provider at your managed care plan.
"nysoh_medical_network_5_panel", -- NYSoH Medical Network Panel Status refers to the availability of a physician to accept new NYSoH Medical QHP members. 1 = Open to new and existing NYSoH Medical QHP members 2 = Existing NYSoH Medical QHP members only 3 = Closed NYSoH Medical QHP Panel 9 = Not Applicable for Non-PC
"nysoh_medical_network_5", -- 0=No 1=Yes
"nysoh_ep_plus_adult_vision_2", -- Total number of NYSOH EP plus Adult Vision and Dental enrollees assigned to this provider at your plan.
"nysoh_dental_network_1", -- 0=No 1=Yes
"medicaid_panel_size", -- Panel size is the total number of capitated Medicaid and HIV SNP members assigned to this PCP at your managed care plan.
"map_panel_size", -- Total number of MAP enrollees assigned to this provider at your managed care plan.
"language_5", -- Languages that a provider or clinical staff member can speak to a member.
"harp_panel_status", -- HARP Panel Status refers to the availability of a physician to accept new HARP members which may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing HARP members 2 = Existing HARP members only 3 = Closed HARP Panel 9 = Not Applicable for Non-PCP
"fida_indicator", -- 0=No 1=Yes
"fida_idd_panel_status", -- FIDA IDD Panel Status refers to the availability of a physician to accept new FIDA IDD members which may be either an existing member within the managed care plan or a member joining the plan for the first time. 1 = Open to new and existing FIDA IDD members 2 = Existing FIDA IDD members only 3 = Closed FIDA IDD Panel 9 = Not Applicable for Non-PCP
"commercial_provider_indicator", -- 0=No 1=Yes
"commercial_non_mco_medical_5", -- 0=No 1=Yes
"commercial_non_mco_medical", -- 0=No 1=Yes
"commercial_non_mco_dental_4", -- 0=No 1=Yes
"nysoh_medical_network_7_panel_1", -- Total number of NYSoH Medical Network enrollees assigned to this provider at your managed care plan.
"nysoh_medical_network_9", -- 0=No 1=Yes
"sip_pl_indicator", -- 0=No 1=Yes
"nysoh_medical_network_1", -- 0=No 1=Yes
"commercial_non_mco_medical_4", -- 0=No 1=Yes
"commercial_non_mco_vision_3", -- 0=No 1=Yes
"commercial_non_mco_medical_2", -- 0=No 1=Yes
"commercial_non_mco_vision", -- 0=No 1=Yes
"commercial_non_mco_dental_1", -- 0=No 1=Yes
"nysoh_dental_network_4", -- 0=No 1=Yes
"commercial_non_mco_dental", -- 0=No 1=Yes
"partial_caps_indicator", -- 0=No 1=Yes
"commercial_non_mco_medical_7", -- 0=No 1=Yes
"map_indicator", -- 0=No 1=Yes
"hivsnp_indicator", -- 0=No 1=Yes
"nysoh_medical_network_4", -- 0=No 1=Yes
"commercial_non_mco_medical_3", -- 0=No 1=Yes
"sip_pl_panel_size" -- Total number of SIP-PL enrollees assigned to this provider at your managed care plan.
FROM
"health-data-ny-gov/individual-provider-network-data-2020-quarter-4-q8n3-y6yf:latest"."individual_provider_network_data_2020_quarter_4"
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-2020-quarter-4-q8n3-y6yf
with SQL in under 60 seconds.
This repository is an "external" repository. That means it's hosted elsewhere, in this case at health.data.ny.gov. When you queryhealth-data-ny-gov/individual-provider-network-data-2020-quarter-4-q8n3-y6yf:latest
on the DDN, we "mount" the repository using the socrata
mount handler. The mount handler proxies your SQL query to the upstream data source, translating it from SQL to the relevant language (in this case SoQL).
We also cache query responses on the DDN, but we run the DDN on multiple nodes so a CACHE_HIT
is only guaranteed for subsequent queries that land on the same node.
Query Your Local Engine
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; sgr
can manage the image, container and volume for you.
There are a few ways to ingest data into the local engine.
For external repositories (like this repository), 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, where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr clone
and sgr checkout
.
Mounting Data
This repository is an external repository. It's not hosted by Splitgraph. It is hosted by health.data.ny.gov, and Splitgraph indexes it. This means it is not an actual Splitgraph image, so you cannot use sgr clone
to get the data. Instead, you can use the socrata
adapter with the sgr mount
command. Then, if you want, you can import the data and turn it into a Splitgraph image that others can clone.
First, install Splitgraph if you haven't already.
Mount the table with sgr mount
sgr mount socrata \
"health-data-ny-gov/individual-provider-network-data-2020-quarter-4-q8n3-y6yf" \
--handler-options '{
"domain": "health.data.ny.gov",
"tables": {
"individual_provider_network_data_2020_quarter_4": "q8n3-y6yf"
}
}'
That's it! Now you can query the data in the mounted table like any other Postgres table.
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-2020-quarter-4-q8n3-y6yf
is just another Postgres schema.