Public
Edited
Apr 9
Insert cell
Insert cell
Insert cell
MedicaidSDK = await import ('https://episphere.github.io/medicaid/sdk.js');
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// MedicaidSDK.clearCache() commented out to prevent retrieval of data every time notebook is opened
Insert cell
Insert cell
getSchemas = MedicaidSDK.getSchemas();
Insert cell
Insert cell
getSpecificSchema = MedicaidSDK.getSpecificSchema("distribution", true);
Insert cell
Insert cell
getSchemaItems = MedicaidSDK.getSchemaItems("dataset");
Insert cell
Insert cell
getSchemaItemById = MedicaidSDK.getSchemaItemById('dataset', 'd5eaf378-dcef-5779-83de-acdd8347d68e')
Insert cell
Insert cell
getDatasetById = MedicaidSDK.getDatasetById('d5eaf378-dcef-5779-83de-acdd8347d68e')
Insert cell
Insert cell
getDistributionById = MedicaidSDK.getDistributionById("1266b3ce-6bd6-5bbe-a6d5-61796e8b0348");
Insert cell
Insert cell
getAllDatasetUrls = MedicaidSDK.getAllDatasetUrls();
Insert cell
Insert cell
parseDatasetUrl = MedicaidSDK.parseDatasetUrl(getDatasetById)
Insert cell
Insert cell
Insert cell
getDatasetByTitleName = MedicaidSDK.getDatasetByTitleName('NADAC (National Average Drug Acquisition Cost) 2021')
Insert cell
getDatasetByKeyword = MedicaidSDK.getDatasetByKeyword('nadac')
Insert cell
getDatasetByDescription = MedicaidSDK.getDatasetByDescription("National Average Drug Acquisition Cost (NADAC) weekly reference data for the calendar year.")
Insert cell
getDatasetByDownloadUrl = MedicaidSDK.getDatasetByDownloadUrl("https://download.medicaid.gov/data/national-average-drug-acquisition-cost-12-29-2021.csv");
Insert cell
Insert cell
Insert cell
convertDatasetToDistributionId = MedicaidSDK.convertDatasetToDistributionId("d5eaf378-dcef-5779-83de-acdd8347d68e");
Insert cell
Insert cell
convertDistributionToDatasetId = MedicaidSDK.convertDistributionToDatasetId("a276955e-7bfc-5841-a6c7-44f279b5309d")
Insert cell
Insert cell
Insert cell
Insert cell
getDatastoreImport = MedicaidSDK.getDatastoreImport("1266b3ce-6bd6-5bbe-a6d5-61796e8b0348")
Insert cell
Insert cell
Insert cell
Insert cell
postDatastoreQueryDistributionId = MedicaidSDK.postDatastoreQueryDistributionId("1266b3ce-6bd6-5bbe-a6d5-61796e8b0348", {columnName: "otc", columnValue: "Y", operator: "=", limit: 15})
Insert cell
postDatastoreQueryDatasetId = MedicaidSDK.postDatastoreQueryDatasetId("d5eaf378-dcef-5779-83de-acdd8347d68e", {columnName: "otc", columnValue: "N", operator: "=", limit: 15})
Insert cell
Insert cell
Insert cell
Insert cell
getDatastoreQueryDatasetId = MedicaidSDK.getDatastoreQueryDatasetId('d5eaf378-dcef-5779-83de-acdd8347d68e', 10)
Insert cell
Insert cell
getAllDataFromDistribution = MedicaidSDK.getAllDataFromDistribution(await MedicaidSDK.convertDatasetToDistributionId(getSchemaItems[0].identifier))
//params: identifier
Insert cell
getAllDataFromDataset = MedicaidSDK.getAllDataFromDataset(getSchemaItems[0].identifier)
Insert cell
Insert cell
Insert cell
Insert cell
postDatastoreQueryDownload = MedicaidSDK.postDatastoreQueryDownload("1266b3ce-6bd6-5bbe-a6d5-61796e8b0348", {columnName: "otc", columnValue: "Y", operator: "=", limit: 10})
Insert cell
Insert cell
getDownloadByDistributionId = MedicaidSDK.getDownloadByDistributionId(await MedicaidSDK.convertDatasetToDistributionId(getSchemaItems[0].identifier), {convertBlob: true, filename: "my_file", textContent: "Download file"})
Insert cell
getDownloadByDatasetId = MedicaidSDK.getDownloadByDatasetId("c1028fdf-2e43-5d5e-990b-51ed03428625", {convertBlob: false})
Insert cell
Insert cell
Insert cell
getDatastoreQuerySql = MedicaidSDK.getDatastoreQuerySql(`[SELECT * FROM ${await MedicaidSDK.convertDatasetToDistributionId(getSchemaItems[0].identifier)}]`)
Insert cell
getSchemaItems[0].identifier
Insert cell
ex1 = MedicaidSDK.getDatastoreQuerySql('[SELECT state,state_rate FROM ca46c5df-b656-5176-934f-e25d6dbd9c85]')
Insert cell
ex2 = MedicaidSDK.getDatastoreQuerySql('[SELECT ndc_description,nadac_per_unit FROM 1266b3ce-6bd6-5bbe-a6d5-61796e8b0348][WHERE otc = "N"][LIMIT 10]')
Insert cell
ex3 = MedicaidSDK.getDatastoreQuerySql('[SELECT * FROM ca46c5df-b656-5176-934f-e25d6dbd9c85][LIMIT 10]')
Insert cell
Insert cell
Insert cell
// plot = MedicaidSDK.plot() to see output visit the visualization notebook or the interactive notebooks
Insert cell
Insert cell
Insert cell
getNadacInfo = MedicaidSDK.getNadacInfo();
Insert cell
Insert cell
getallNdcObjs = MedicaidSDK.getAllNdcObjs()
Insert cell
Insert cell
getNadacMeds = MedicaidSDK.getNadacMeds()
Insert cell
Insert cell
getNdcFromMed = MedicaidSDK.getNdcFromMed('HM LANSOPRAZOLE DR 15 MG CAP');
Insert cell
Insert cell
getMedData = MedicaidSDK.getMedData(["CALCITRIOL 1 MCG/ML SOLUTION"], "ndc_description")
Insert cell
Insert cell
medPlot = MedicaidSDK.plotNadacMed('HM LANSOPRAZOLE DR 15 MG CAP');
Insert cell
Insert cell
ndcPlot = MedicaidSDK.plotNadacNdc('37205044652');
Insert cell
Insert cell
Insert cell
getUtilInfo = MedicaidSDK.getUtilInfo();
Insert cell
Insert cell
getUtilData = MedicaidSDK.getUtilData(['24385005452']);
Insert cell
Insert cell
plotUtilTimeSeries = MedicaidSDK.plotUtilTimeSeries('24385005452');
Insert cell
Insert cell
drugUtilBarData = MedicaidSDK.getDrugUtilDataBar('00536105556')
Insert cell
Insert cell
drugUtilBar = MedicaidSDK.plotDrugUtilBar('00536105556');
Insert cell
Insert cell
getUtilMapData = MedicaidSDK.getUtilMapData('00536105556')
Insert cell
Insert cell
choroplethMap = MedicaidSDK.plotUtilMap('00536105556')
Insert cell
Insert cell
// plotDrugUtilXX = MedicaidSDK.plotDrugUtilDataXX();
Insert cell
Insert cell
Insert cell
getHealthcareMeasuresInfo = MedicaidSDK.getHealthcareMeasuresInfo()
Insert cell
Insert cell
qualityMeasures = MedicaidSDK.getQualityMeasures();
Insert cell
Insert cell
rateDefinitions = MedicaidSDK.getRateDefinitions("Follow-Up After Hospitalization for Mental Illness: Ages 6 to 17");
Insert cell
Insert cell
states = MedicaidSDK.getStates("Percentage of Hospitalizations for Mental Illness or Intentional Self-Harm with a Follow-Up Visit Within 7 Days after Discharge: Ages 6 to 17", "Follow-Up After Hospitalization for Mental Illness: Ages 6 to 17")
Insert cell
Insert cell
ratePlot = MedicaidSDK.plotRateBar("Percentage of Hospitalizations for Mental Illness or Intentional Self-Harm with a Follow-Up Visit Within 7 Days after Discharge: Ages 6 to 17", "Follow-Up After Hospitalization for Mental Illness: Ages 6 to 17")
Insert cell
Insert cell
// rateTimeSeries = MedicaidSDK.plotRateTimeSeries("")
Insert cell
Insert cell
Insert cell
getDiseaseIdMap = MedicaidSDK.getDiseaseIdMap();
Insert cell
Insert cell
getRxcuiFromNdc = MedicaidSDK.getRxcuiFromNdc("00591040801");
Insert cell
Insert cell
getNDCsFromRxcui = MedicaidSDK.getNDCsFromRxcui("314077")
Insert cell
Insert cell
getRxcuiProperties = MedicaidSDK.getRxcuiProperties("314077")
Insert cell
Insert cell
getRxcuiFromDisease = MedicaidSDK.getRxcuiFromDisease("Abdominal Neoplasms")
Insert cell
Insert cell
getDrugsFromDisease = MedicaidSDK.getDrugsFromDisease("Abdominal Neoplasms")
Insert cell
Insert cell
// getNdcsFromDisease = MedicaidSDK.getNdcsFromDisease("Abdominal Neoplasms")
Insert cell
Insert cell
getDrugContext = MedicaidSDK.getDrugContext("314077")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more