DEV Community 👩‍💻👨‍💻

InterSystems Developer for InterSystems

Posted on • Originally published at community.intersystems.com

Plug and play DATASETS with ObjectScript Package Manager (ZPM)

With the release of InterSystems IRIS 2021.2 Preview and all-new LOAD DATA functionality dataset can by added with Objectscript Package Manager (ZPM) 

Medical Datasets contains following 12 datasets. For dataset tables and data details please visit ONLINE DEMO by using SuperUser | SYS 

ID Dataset Name Tables Licence
1 Synthetic Medical Data 11 Public Domain
2 Health Care Analytics - 1 8 Public Domain
3 Global Suicide Data 7 Public Domain
4 COVID-19 Polls1 7 CC-BY
5 Cancer Rates by U.S. State 2 Public Domain
6 Opioid Overdose Deaths 2 Public Domain
7 Heart Disease Prediction 1 Public Domain
8 Yellowpages medical services dataset 1 Public Domain
9 Hospital ratings 1 Public Domain
10 Heart Failure Prediction 1 (CC BY 4.0)
11 Diabetes Dataset 1 Public Domain
12 Chronic Kidney Disease 1 Public Domain

In order to use any of the above listed dataset we can add in our namespace by using dataset ID, So Let's add Synthetic medical dataset 

First of all we need to install dataset-medical package which can be done by using below command:

zpm "install dataset-medical
Enter fullscreen mode Exit fullscreen mode

Image description

Now we are ready to import dataset. Dataset can be added or removed either by Terminal or by Web Application 

ADDING DATASET FROM TERMINAL

We can add dataset by calling ImportDS function of dc.data.medical.utility class by passing dataset ID from terminal:

do ##class(dc.data.medical.utility).ImportDS(1)
Enter fullscreen mode Exit fullscreen mode

Image description

That's it, Our first dataset is created. 

 

Dataset "synthetic" is created with 11 Tables and 83,341 records, which can be confirm by Management Portal

Image description

Removing Dataset

Use below command to remove particular dataset by passing it's ID 

do ##class(dc.data.medical.utility).RemoveDS(1)
Enter fullscreen mode Exit fullscreen mode

<!--break-->

Adding ALL datasets

To install all the datasets pass 999 to ImportDS function

do ##class(dc.data.medical.utility).ImportDS(999)
Enter fullscreen mode Exit fullscreen mode

Removing ALL datasets

 And to remove all the datasets pass 999 to RemoveDS function

do ##class(dc.data.medical.utility).RemoveDS(999)
Enter fullscreen mode Exit fullscreen mode

ADDING DATASET FROM TERMINAL

Navigate to http://localhost:52773/csp/datasets/index.csp and press Install DataSet button image image

 

View Data from Web Application

Navigate to http://localhost:52773/csp/datasets/index.csp and click any table from sidebarimage

Removing DataSet from Web Application

Navigate to http://localhost:52773/csp/datasets/index.csp and press Remove DataSet button

image

Dataset is removed successfully

image

 

Thanks

 

 

 

Top comments (0)

Need a better mental model for async/await?

Check out this classic DEV post on the subject.

⭐️🎀 JavaScript Visualized: Promises & Async/Await

async await