Skip to content

Commit 7b48d2f

Browse files
committed
First commit
0 parents  commit 7b48d2f

24 files changed

+7112
-0
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text=auto eol=lf
2+
3+
*.{cmd,[cC][mM][dD]} text eol=crlf
4+
*.{bat,[bB][aA][tT]} text eol=crlf
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: objectscriptquality
2+
on: push
3+
4+
jobs:
5+
linux:
6+
name: Linux build
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Execute ObjectScript Quality Analysis
11+
run: wget https://raw.githubusercontent.com/litesolutions/objectscriptquality-jenkins-integration/master/iris-community-hook.sh && sh ./iris-community-hook.sh

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
iris/shared/durable
2+
iris/shared/model/*
3+
!iris/shared/model/.gitkeep
4+
iris/shared/HL7Out/*
5+
!iris/shared/HL7Out/.gitkeep
6+
iris/shared/in/*
7+
!iris/shared/in/.gitkeep
8+
iris/shared/HL7In/*
9+
!iris/shared/HL7In/.gitkeep
10+
settings.json
11+
# Compiled output
12+
encoder-ui/dist
13+
encoder-ui/tmp
14+
encoder-ui/out-tsc
15+
encoder-ui/bazel-out
16+
17+
# Node
18+
encoder-ui/node_modules
19+
encoder-uinpm-debug.log
20+
encoder-uiyarn-error.log
21+
22+
# IDEs and editors
23+
encoder-ui/.idea/
24+
encoder-ui/.project
25+
encoder-ui/.classpath
26+
encoder-ui/.c9/
27+
encoder-ui/*.launch
28+
encoder-ui/.settings/
29+
encoder-ui/*.sublime-workspace
30+
31+
# Visual Studio Code
32+
encoder-ui/.vscode/*
33+
encoder-ui/!.vscode/settings.json
34+
encoder-ui/!.vscode/tasks.json
35+
encoder-ui/!.vscode/launch.json
36+
encoder-ui/!.vscode/extensions.json
37+
encoder-ui/.history/*
38+
39+
# Miscellaneous
40+
encoder-ui/.angular/cache
41+
encoder-ui/.sass-cache/
42+
encoder-ui/connect.lock
43+
encoder-ui/coverage
44+
encoder-ui/libpeerconnection.log
45+
encoder-ui/testem.log
46+
encoder-ui/typings
47+
48+
# System files
49+
encoder-ui/.DS_Store
50+
encoder-ui/Thumbs.db
51+
webgateway/shared/durable
52+
webgateway/shared/CA_Server.srl

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 InterSystems Developer Community
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Vector Search for MPI
2+
In this workflow we are going to test the Vector Search functionality applied for the management of an hipotetic Master Patient Index making use of the Vector Storage capabilities of IRIS database.
3+
4+
.
5+
6+
# What do you need to install?
7+
* [Git](https://git-scm.com/downloads)
8+
* [Docker](https://www.docker.com/products/docker-desktop) (if you are using Windows, make sure you set your Docker installation to use "Linux containers").
9+
* [Docker Compose](https://docs.docker.com/compose/install/)
10+
* [Visual Studio Code](https://code.visualstudio.com/download) + [InterSystems ObjectScript VSCode Extension](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript)
11+
12+
# Setup
13+
Build the image we will use during the workshop:
14+
15+
```console
16+
$ git clone https://github.com/intersystems-ib/workshop-empi
17+
$ cd workshop-empi
18+
$ docker-compose build
19+
```
20+
21+
# Introduction
22+
23+
## What is purpose of this project?
24+
25+
The main purpose of this project is to develop an interoperability production to generate embeddings for the demographic information of patients received from HL7 messages and to provide possible duplicated patients as the Master Patient Index tools do.
26+
27+
## How does this project work?
28+
29+
This project is designed as a docker compose project developed on InterSystems IRIS for Health Community edition and it uses a pre-trained text-similarity model named [all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2).
30+
31+
## Project
32+
33+
As we said before, our code is developed on InterSystems IRIS for Health leveraging the Embedded Python and Vector Search functionalities. The project is responsible for:
34+
* Import HL7 file from */shared/in* folder.
35+
* Transform the PID segment of HL7 message into a custom message.
36+
* Download model and generate the embeddings for the demographic info using [Embedded Python](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=AFL_epython) capabilities.
37+
* Storage of embeddings into IRIS database and generation of response with the list of possible patient duplicates using Vector Search.
38+
39+
40+
# Testing the project
41+
* Run the containers to deploy the backend and the frontend:
42+
```
43+
docker-compose up -d
44+
```
45+
Automatically an IRIS instance will be deployed and a production will be configured and run available to import data to create the prediction model and train it.
46+
47+
* Open the [Management Portal](http://localhost:52774/csp/sys/%25CSP.Portal.Home.zen?$NAMESPACE=EMPI).
48+
* Login using the default `superuser`/ `SYS` account.
49+
* Click on [Production](http://localhost:52774/csp/healthshare/empi/EnsPortal.ProductionConfig.zen?$NAMESPACE=EMPI) to access the production that we are going to use. You can access also through *Interoperability > User > Configure > Production*.

docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
3+
# iris
4+
iris:
5+
init: true
6+
container_name: iris
7+
build:
8+
context: .
9+
dockerfile: iris/Dockerfile
10+
ports:
11+
- 52774:52773
12+
- 51774:1972
13+
volumes:
14+
- ./iris/shared:/iris-shared
15+
environment:
16+
- ISC_DATA_DIRECTORY=/iris-shared/durable
17+
command: --check-caps false --ISCAgent false
18+
mem_limit: 30G
19+
memswap_limit: 32G

iris/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
ARG IMAGE=containers.intersystems.com/intersystems/irishealth-community:latest-cd
2+
FROM $IMAGE
3+
4+
USER root
5+
6+
WORKDIR /opt/irisapp
7+
RUN chown -R irisowner:irisowner /opt/irisapp
8+
9+
RUN apt-get update && apt-get install -y python3
10+
11+
# install required packages
12+
COPY --chown=$ISC_PACKAGE_MGRUSER:$ISC_PACKAGE_IRISGROUP /requirements.txt /
13+
RUN chmod 777 /requirements.txt
14+
15+
RUN pip3 install -r /requirements.txt --break-system-packages
16+
17+
USER irisowner
18+
19+
# copy files to image
20+
WORKDIR /opt/irisapp
21+
COPY --chown=irisowner:irisowner src src
22+
23+
COPY --chown=$ISC_PACKAGE_MGRUSER:$ISC_PACKAGE_IRISGROUP /iris/irissession.sh /
24+
RUN chmod +x /irissession.sh
25+
26+
COPY --chown=$ISC_PACKAGE_MGRUSER:$ISC_PACKAGE_IRISGROUP /iris/iris.cpf /
27+
RUN chmod +x /iris.cpf
28+
29+
ENV ISC_CPF_MERGE_FILE=/iris.cpf
30+
31+
SHELL ["/irissession.sh"]
32+
33+
RUN \
34+
zn "EMPI" \
35+
set sc = $SYSTEM.OBJ.LoadDir("/opt/irisapp/src/EMPI", "ck", , 1)

iris/iris.cpf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Actions]
2+
CreateDatabase:Name=EMPI_DATA,Directory=/usr/irissys/mgr/EMPI_DATA
3+
4+
CreateDatabase:Name=EMPI_CODE,Directory=/usr/irissys/mgr/EMPI_CODE
5+
6+
CreateNamespace:Name=EMPI,Globals=EMPI_DATA,Routines=EMPI_CODE,Interop=1
7+
8+
ModifyUser:Name=SuperUser,PasswordHash=9b900b7299f13b10d9aa5f41a8ce98b55f7e99831f988f596f7048e6647e4f2c3ebbcd3c104b9510a4a8707c9b864e6e550a95e269b4b1dffb8613d85c10e313,ae216ebb10fa9b741efa40fe91236be31d06af08569cca75f78cde36afeafd88505c3d4b3092238074cac14087b9c95a08214e3c0ecbf62e0527c29c82ce097d,10000,SHA512

iris/irissession.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
iris start $ISC_PACKAGE_INSTANCENAME quietly
4+
5+
cat << EOF | iris session $ISC_PACKAGE_INSTANCENAME -U %SYS
6+
do ##class(%SYSTEM.Process).CurrentDirectory("$PWD")
7+
$@
8+
if '\$Get(sc, 1) do ##class(%SYSTEM.Process).Terminate(, 1)
9+
zn "%SYS"
10+
do ##class(SYS.Container).QuiesceForBundling()
11+
do ##class(Security.Users).UnExpireUserPasswords("*")
12+
13+
halt
14+
EOF
15+
16+
exit=$?
17+
18+
iris stop $ISC_PACKAGE_INSTANCENAME quietly
19+
20+
exit $exit

iris/shared/in/.gitkeep

Whitespace-only changes.

iris/shared/messagea28.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
MSH|^~\&|HIS|H12O|EMPI||20240514094951||ADT^A28|788826|P|2.5.1
2+
EVN|A28|20240514094951|20240514094951|1
3+
PID|||1556655112^^^SERMAS^SN~556432^^^H12O^PI||MARTÍN SOLÍS^ROBERTO^^^||20150403|M|||PASEO PEDRO ÁLVAREZ^195 1 CENTRO^LEGANÉS^MADRID^28379^SPAIN||555283055^PRN^^JUAN.GARCIA@YAHOO.COM|||||||||||||||||N|
4+
PV1||N
5+
AL1|1|MA|^Polen de olivo^|MI^^||20360331040605
6+
ZBT|AB-
7+
8+
9+
MSH|^~\&|HIS|H12O|EMPI||20240514094951||ADT^A28|255913|P|2.5.1
10+
EVN|A28|20240514094951|20240514094951|1
11+
PID|||1398528318^^^SERMAS^SN~2312421^^^H120^PI||LÓPEZ MARTÍN^MARÍA^^^||19560121|F|||PASEO MARIO FERNÁNDEZ^258 1 DERECHA^MADRID^MADRID^28627^SPAIN||^PRN^^MARIA.LOPEZ@GOOGLE.COM|||||||||||||||||N|
12+
PV1||N
13+
DG1|1||V935^ACC EN EMBARCACION SIN ACC A EMBARC, NO AHOGAM O SUMERS, CANOA O KAYAK^||20240514|||||||||||^MARTÍNEZ SOLCHAGA^MARCOS^^^Dr|
14+
ZBT|AB-

0 commit comments

Comments
 (0)