Skip to content

Files

Latest commit

2806653 · Oct 15, 2024

History

History
197 lines (151 loc) · 4.68 KB

CONTRIB.md

File metadata and controls

197 lines (151 loc) · 4.68 KB

Please, go through the following steps if you want to contribute to this project:

  1. Report an issue. Describe it as much as possible.
  2. Fork the repository, create a new branch.
  3. Develop your changes, make sure all unit tests are working. Add new unit tests as needed.
  4. Create a pull request.

Development Environment

Build:

docker compose build

Run:

docker compose up

IRIS instance:

See README.md, QuickStart section.

Utils

Generate 100 sample hl7 files for processing in test production:

do ##class(DataPipe.Test.HL7.Helper).GenerateFilesHL7ADT(100)

Generate 100 REST requests for processing in test production:

do ##class(DataPipe.Test.REST.Helper).SendHTTPRequests(100)

Delete DataPipe.Data.* data:

do ##class(DataPipe.Test.Helper).KillData()

Unit Tests

Open an IRIS interactive session:

docker exec -it datapipe bash
iris session IRIS

Run all unit tests:

zn "dpipe"
set ^UnitTestRoot = "/app/src/DataPipe/UnitTest"
do ##class(%UnitTest.Manager).RunTest("", "/nodelete")

Run an specific test case:

zn "dpipe"
set ^UnitTestRoot = "/app/src/DataPipe/UnitTest"
do ##class(%UnitTest.Manager).RunTest(":DataPipe.UnitTest.HL7:TestDone", "/nodelete")

Test publishing & deploying using IPM

See Testing packages for ZPM

Load module from local dev environment:

zpm "load /app"

Set up testing IPM repository:

zpm "repo -n registry -r -url https://test.pm.community.intersystems.com/registry/ -user test -pass PassWord42"

Search packages already published in testing IPM repository:

zpm "search"

Test publishing process:

zpm "iris-datapipe publish -verbose"

Search published package in testing IPM repository:

zpm "search"

Run a container with an IRIS instance

docker compose -f docker-compose.test.yml up -d

Install ipm

docker compose -f docker-compose.test.yml exec -it iris bash
iris session iris
zn "USER"
set r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")

Set up testing IPM repository:

zpm "repo -n test -r -url https://test.pm.community.intersystems.com/registry/ -user test -pass PassWord42"

Search published packages:

zpm "search"

Install the package:

zpm "install iris-datapipe 2.0.0"

Upgrading from previous versions

Upgrade from DataPipe 0.0.2 to DataPipe 2.x

You can test an upgrade from DataPipe 0.0.2 to DataPipe 2.x following these steps

Run a container with a brand new IRIS (upgrade)

docker compose -f docker-compose.test.yml up -d

Install ipm

docker compose -f docker-compose.test.yml exec -it iris bash
iris session iris
set r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")

Create a Pre-Upgrade situation

Install previous datapipe version

zpm "install iris-datapipe 0.0.2"

Start production

Generate data:

do ##class(DataPipe.Test.HL7.Helper).GenerateFilesHL7ADT(100)

Upgrade to new version

Stop Production

Create a temporary table to store Flows, they will be migrated into Pipes in new version

CREATE TABLE TempDataPipeMigration(Code CHAR(255) NOT NULL)
INSERT INTO TempDataPipeMigration (Code) SELECT DISTINCT Flow FROM DataPipe_Data.Inbox

Install latest local datapipe version

zpm "load /app"

Delete WebApp "/dpipe/api/rf2"

Make sure all your references to "Flow" field are transformed to "Pipe" field (e.g. in your data transformations)

Migrate legacy Flows to Pipes:

INSERT INTO DataPipe_Data.Pipe (Code, Description) SELECT Code, 'Migrated' FROM TempDataPipeMigration
DROP TABLE TempDataPipeMigration

Rebuild indices:

write ##class(DataPipe.Data.Inbox).%BuildIndices($lb("PipeIdx"))

Setup security privileges as in README.md Users and privileges section.

Enable CORS for deploying datapipe-UI:

do $system.OBJ.Load("/app/src/Form/REST/Abstract.cls", "ck") 

Make sure CSPSystem has read privileges on DataPipe database.

Deploy datapipe-UI changing environment.ts config as needed.

Start production