Home Applications iris-analytics-template

iris-analytics-template

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
5
2 reviews
0
Awards
935
Views
86
IPM installs
4
3
Details
Releases  (8)
Reviews  (2)
Issues
Dependencies  (2)
Basic template for IRIS Analytics solutions

What's new in this version

Fix source control settings for the dashboard

iris-analytics-template

Gitter
Quality Gate Status
GitHub last commit

This is a template for InterSystems IRIS Analytics (DeepSee) solutions.
The template contains a very basic example of the BI solution which contains one source class, data, one cube, two pivots and one dashboard.

Installation

ZPM

It’s packaged with ZPM so it could be installed as:

zpm "install iris-analytics-sample"

then open http://localhost:32792/dsw/index.html#/USER

you should see a dashboard with the data on confirmed COVID-19 cases distributed by countries and its provinces, like that:
Screenshot 2022-08-17 at 11 36 32

Docker

The repo is dockerised so you can clone/git pull the repo into any local directory

$ git clone https://github.com/intersystems-community/iris-analytics-template.git

Open the terminal in this directory and run:

$ docker-compose up -d

and open then http://localhost:32792/dsw/index.html#/USER

Or, open the cloned folder in VSCode, start docker-compose and open the URL via VSCode menu:
Screenshot 2020-11-15 at 20 17 12

How to start coding

Prerequisites

Make sure you have git and Docker desktop installed.

This repository is ready to code in VSCode with ObjectScript plugin.
Install VSCode, Docker and ObjectScript plugin and open the folder in VSCode.
Open /src/cls/PackageSample/ObjectScript.cls class and try to make changes - it will be compiled in running IRIS docker container.
docker_compose

Read more about folder setup for InterSystems ObjectScript

The script in Installer.cls will import everything you place under /src into IRIS.

How this sample was created

The class and data were taken from covid19 CSV Johns Hopkins repository.

zpm “install csvgen” will import csvgen package which lets to create class and import data with the following line:

set file="https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/11-14-2020.csv"
zw ##class(community.csvgen).GenerateFromURL(file,",","dc.irisbi.covid19")

The cube was generated from with:

zw ##class(%DeepSee.WizardUtils).%GenerateCubeDefinition("dc.irisbi.covid19","CovidCube","dc.irisbi.covid19cube",1)

Deployment

To deploy this project via ZPM or docker we need:
classes, data and DFI.
Cube class dc.irisbi.Covid19Cube.cls was exported manually via Server view in VSCode.

Pivots and dashboard were created manually and then were exported with isc dev to the format, which standard import procedures and ZPM can import:

zpm "install isc-dev"
do ##class(dev.code).workdir("/irisdev/app/src")
d ##class(dev.code).export("*.DFI")

And data was exported via standard export utility:

do $System.OBJ.Export("dc*.GBL","/irisdev/app/src/gbl/dc.irisbi.covid19D.xml",,.errors)

after that ZPM module.xml was created manually which includes classes, DFI, global and calls %DeepSee.Utils(“Covid19Cube”) to build the cube data.

How to run unittests

This template goes with TestBI.cls unittest which tests all the pivots and dashboards in a namespace.
Test runs with every commit into Github.
Also you can call the test manually.

What’s inside the repository

Dockerfile

The simplest dockerfile which starts IRIS and imports Installer.cls and then runs the Installer.setup method, which creates IRISAPP Namespace and imports ObjectScript code from /src folder into it.
Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders.
Use .env/ file to adjust the dockerfile being used in docker-compose.

.vscode/settings.json

Settings file to let you immedietly code in VSCode with VSCode ObjectScript plugin)

.vscode/launch.json

Config file if you want to debug with VSCode ObjectScript

Read about all the files in this article

Made with
Install
zpm install iris-analytics-sample download archive
Version
1.1.713 Aug, 2024
Category
Template
Works with
InterSystems IRISInterSystems IRIS for HealthInterSystems IRIS BI
First published
10 Jul, 2020
Last checked by moderator
25 Aug, 2024Works