Skip to content

Commit

Permalink
add: init mainzelliste
Browse files Browse the repository at this point in the history
  • Loading branch information
m-benamor committed Nov 22, 2023
1 parent 60768e6 commit 456df91
Show file tree
Hide file tree
Showing 21 changed files with 332 additions and 7,075 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions assets/scss/common/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ body {
font-size: $font-size-base;
}
}

.navbar-logo {
background-repeat:no-repeat;
max-height:60px;
max-width:223px
}
.navbar a:hover,
.navbar a:focus {
text-decoration: none;
Expand Down Expand Up @@ -269,7 +273,7 @@ body {

.card-bar {
border-top: 4px solid;
border-image-source: linear-gradient(90deg, $primary, #8ed6fb 50%, #d32e9d);
border-image-source: linear-gradient(90deg, $primary, #8ed6fb 50%, #2e91d3);
border-image-slice: 1;
}

Expand Down
3 changes: 2 additions & 1 deletion assets/scss/common/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ $purple: #5d2f86;
$brown: #aa9c84;

$blue-300: #8ed6fb;
$ml-blue: #2950a3;
$pink-100: #fcfaff;
$pink-500: #d32e9d;

$primary: $purple;
$primary: $ml-blue;

$color-btn-bg: $pink-500;
$color-btn-border: darken($pink-500, 5%);
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/layouts/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ button#doks-versions {

.header-bar {
border-top: 4px solid;
border-image-source: linear-gradient(90deg, $primary, #8ed6fb 50%, #d32e9d);
border-image-source: linear-gradient(90deg, $primary, #8ed6fb 50%, #2e91d3);
border-image-slice: 1;
}

Expand Down
17 changes: 8 additions & 9 deletions config/_default/menus/menus.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@
parent = "get-started"

[[social]]
name = "GitHub"
pre = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-github\"><path d=\"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22\"></path></svg>"
url = "https://github.com/h-enk/doks"
post = "v0.1.0"
name = "Bitbucket"
pre = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 32 32\" fill=\"currentColor\" fill-rule=\"evenodd\" stroke-miterlimit=\"1.41400003\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-github\"><path d=\"M25.943 22.468c-.272 0-.407.137-.407.137S22.13 25.337 16 25.337s-9.528-2.734-9.528-2.734-.272-.135-.407-.135c-.273 0-.547.137-.547.545v.135l.954 5.175C6.88 30.366 10.967 32 15.868 32s9-1.634 9.397-3.677c0-.272.407-2.314.945-5.175v-.135c.13-.273 0-.545-.276-.545zM16.007 0C8.377 0 2.112 2.04 2.112 4.627c0 .683 1.634 10.35 2.316 14.163C4.7 20.56 9.196 23 16.003 23s11.166-2.442 11.575-4.215l2.3-14.158C29.743 2.05 23.623.01 15.992.01zm0 19.88a4.3 4.3 0 0 1-4.356-4.358c0-2.457 1.904-4.36 4.355-4.36a4.3 4.3 0 0 1 4.358 4.361c0 2.3-1.907 4.346-4.358 4.346zm.001-6.667a2.19 2.19 0 0 1 2.18 2.18 2.18 2.18 0 1 1-4.361 0 2.19 2.19 0 0 1 2.18-2.18zm-.003-7.224c-4.904 0-8.852-.814-8.852-1.904s3.948-1.907 8.852-1.907 8.852.817 8.852 1.904S20.906 6 16.005 6z\"></path></svg>"
url = "https://bitbucket.org/medicalinformatics/mainzelliste/src/master/"
weight = 10

[[social]]
name = "Twitter"
pre = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-twitter\"><path d=\"M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z\"></path></svg>"
url = "https://twitter.com/getdoks"
weight = 20
#[[social]]
# name = "Twitter"
# pre = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-twitter\"><path d=\"M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z\"></path></svg>"
# url = "https://twitter.com/getdoks"
# weight = 20

# [[footer]]
# name = "Privacy"
Expand Down
7 changes: 4 additions & 3 deletions content/en/_index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title : "Modern Documentation Theme"
description: "Doks is a Hugo theme for building secure, fast, and SEO-ready documentation websites, which you can easily update and customize."
lead: "Doks is a Hugo theme for building secure, fast, and SEO-ready documentation websites, which you can easily update and customize."
title : "Mainzelliste"
description: "Die Mainzelliste ist ein webbasierter Pseudonymisierungsdienst, die die Erzeugung von Personenidentifikatoren (PID) aus identifizierenden Attributen (IDAT) erlaubt, dank Record-Linkage-Funktionalität auch bei wechselnder Qualität identifizierender Daten. Ihre Funktionen werden über eine REST-Schnittstelle bereitgestellt, die besonders flexible Integration durch andere Software ermöglicht."
lead: "Die Mainzelliste ist ein webbasierter Pseudonymisierungsdienst, die die Erzeugung von Personenidentifikatoren (PID) aus identifizierenden Attributen (IDAT) erlaubt, dank Record-Linkage-Funktionalität auch bei wechselnder Qualität identifizierender Daten. Ihre Funktionen werden über eine REST-Schnittstelle bereitgestellt, die besonders flexible Integration durch andere Software ermöglicht."
date: 2020-10-06T08:47:36+00:00
lastmod: 2020-10-06T08:47:36+00:00
draft: false
images: []
version: 1.10.1
---
245 changes: 245 additions & 0 deletions content/en/docs/prologue/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
---
title: "Getting Started"
description: "One page summary of how to start a new Doks project."
lead: "One page summary of how to start a new Doks project."
date: 2020-11-16T13:59:39+01:00
lastmod: 2020-11-16T13:59:39+01:00
draft: false
images: []
menu:
docs:
parent: "prologue"
weight: 110
toc: true
---

# Getting Started with Mainzelliste
The following steps will give you a first overview of how to run a Mainzelliste instance and perform
basic tasks. This is one of many ways to use the Mainzelliste; for more details and to understand
each API call below, please have the [API Documentation](https://bitbucket.org/medicalinformatics/mainzelliste/downloads/Mainzelliste_Schnittstelle_v3.1.0.pdf) ready.

Mainzelliste comes packaged in a well-documented, versatile Docker container; find more info [at](.././docker.md).
For now, just run the mainzelliste with the default docker-compose config:
```shell
docker-compose up
```

You should now reach Mainzelliste at http://localhost:8080. Needless to say, not use real identifying data in the following steps.

## Task 1: Add new Patient and generate Pseudonym
---

### 1. Create Mainzelliste Session <a name="tutorial-1.1"></a>
To authenticate, each request needs to provide a valid token (See [API Documentation](https://bitbucket.org/medicalinformatics/mainzelliste/downloads/Mainzelliste_Schnittstelle_v3.1.0.pdf)).
These tokens are in turn bundled into a Session. So first create a session with the following _cURL_ statement:
```bash
curl --location --request POST 'localhost:8080/sessions' \
--header 'mainzellisteApiKey: changeThisApiKey' \
--header 'mainzellisteApiVersion: 3.1'
```
The returned session json object:
```json
{
"sessionId": "{session-id}",
"uri": "http://localhost:8080/sessions/{session-id}/"
}
```

### 2. Create Mainzelliste addPatient Token
We would like to allow the bearer of the token to create up to 10 patient datasets and receive the
pseudonym of type “pid”. Use the `{session-id}` you created in the preview step as an url parameter
and run the following _cURL_ statement:
```bash
curl --location --request POST 'localhost:8080/sessions/{session-id}/tokens' \
--header 'Content-Type: application/json' \
--header 'mainzellisteApiKey: changeThisApiKey' \
--header 'mainzellisteApiVersion: 3.1' \
--data-raw '{
"type": "addPatient",
"allowedUses": "10",
"data": {
"idtypes": ["pid"]
}
}'
```
The returned token json object:
```json
{
"id": "{token-id}",
"type": "addPatient",
"allowedUses": 10,
"remainingUses": 10,
"data": {
"idTypes": [
"pid"
]
},
"uri": "http://localhost:8080/sessions/{session-id}/tokens/{token-id}"
}
```

### 3. Open Add Patient Form in Web browser <a name="tutorial-1.3"></a>
Open a web browser and use the `{token-id}` you created in the preview step as url parameter:
```url
http://localhost:8080/html/createPatient?tokenId={token-id}
```
You will see a simple, built-in web form baked directly into Mainzelliste – one of many ways users can create pseudonyms.

[//]: # (![Create Patient Form]&#40;./images/mainzelliste-createPatient-html.png&#41;{width=400})

### 4. Add Patient Identifying Data and Generate ID <a name="tutorial-1.4"></a>
Now enter the patient identifying data and submit the form.

[//]: # (![Generated ID]&#40;./images/mainzelliste-createPatient-result-html.png&#41;{width=350})

:fireworks: Congratulations, you've just pseudonymized your first patient ! :fireworks:

## Task 2: Add new Patient and control user navigation flow
---

The Mainzelliste API can accommodate a wide variety of use-cases. For example, as a developer of the
MDAT application, you can control what a user sees and what the web browser does after submitting
IDAT. We will now add a new patient just like in Task 1 but redirect the user after submission to a
specific webpage.

### 1. Create Mainzelliste Session
Repeat [step 1 in task 1](#tutorial-1.1), or just re-use the existing session.

### 2. Create Mainzelliste addPatient Token
The attribute `redirect` of the json object `data` allows you to configure a redirect url. Use the `{session-id}` you created in the preview step as an url parameter and run the following _cURL_ statement:
```bash
curl --location --request POST 'localhost:8080/sessions/{session-id}/tokens' \
--header 'Content-Type: application/json' \
--header 'mainzellisteApiKey: changeThisApiKey' \
--header 'mainzellisteApiVersion: 3.1' \
--data-raw '{
"type": "addPatient",
"allowedUses": "10",
"data": {
"idtypes": ["pid"],
"redirect": "https://httpbin.org/get?pid={pid}&tid={tokenId}"
}
}'
```
The returned token json object:
```json
{
"id": "{token-id}",
"type": "addPatient",
"allowedUses": 10,
"remainingUses": 10,
"data": {
"redirect": "https://httpbin.org/get?pid={pid}&tid={tokenId}",
"idTypes": [
"pid"
]
},
"uri": "http://localhost:8080/sessions/{session-id}/tokens/{token-id}"
}
```

### 3. Open Add Patient Form in Web browser
Same as [step 3 in task 1](#tutorial-1.3)

### 4. Add Patient Identifying Data and Generate ID
Same as [step 4 in task 1](#tutorial-1.4)

### 5. Print Result and Redirect the User
After pressing the submit button to print the result you will be redirected to the url you configured in step 2.

[//]: # (![Generated ID with Print button]&#40;./images/mainzelliste-createPatient-print-result-html.png&#41;{width=350})

You can also hide the identifying data in the result page by setting the following configuration
variables (See [Configuration Handbook](https://bitbucket.org/medicalinformatics/mainzelliste/downloads/Mainzelliste__Konfigurationshandbuch_v1.8.pdf)):
```properties
result.printIdat = false
```

[//]: # (![Generated ID with Redirect button]&#40;./images/mainzelliste-createPatient-result-redirect-html.png&#41;{width=350})

Or you can hide the result screen altogether
```properties
result.show = false
```

## Task 3: Edit Patient identifying data
---

We will now edit an existing dataset.

### 1. Create Mainzelliste Session
Repeat [step 1 in task 1](#tutorial-1.1), or just re-use the existing session.

### 2. Create Mainzelliste editPatient Token
We want the bearer of the token to edit the IDAT of the dataset with pid “0003Y0WZ“. At the same
time, we want to hide the pseudonym. Use the `{session-id}` you created in the preview step as an
url parameter and run the following _cURL_ statement:

```bash
curl --location --request POST 'localhost:8080/sessions/{session-id}/tokens' \
--header 'Content-Type: application/json' \
--header 'mainzellisteApiKey: changeThisApiKey' \
--header 'mainzellisteApiVersion: 3.1' \
--data-raw '{
"type": "editPatient",
"data": {
"patientId": {
"idType": "pid",
"idString": "0003Y0WZ"
},
"fields": [
"vorname",
"nachname",
"geburtsname",
"plz",
"ort",
"geburtstag",
"geburtsmonat",
"geburtsjahr"
]
}
}'
```
The returned token json object:
```json
{
"id": "{token-id}",
"type": "editPatient",
"allowedUses": 1,
"remainingUses": 1,
"data": {
"patientId": {
"idType": "pid",
"idString": "0003Y0WZ"
},
"fields": [
"vorname",
"nachname",
"geburtsname",
"plz",
"ort",
"geburtstag",
"geburtsmonat",
"geburtsjahr"
]
},
"uri": "http://localhost:8080/sessions/{session-id}/tokens/{token-id}"
}
```

### 3. Edit Patient Identifying data in Web browser
Open a web browser and use the `{token-id}` you created in the preview step as url parameter:
```url
http://localhost:8080/html/editPatient?tokenId={token-id}
```
Edit the desired fields, then submit the page

[//]: # (![Create Patient Form]&#40;./images/mainzelliste-editPatient-html.png&#41;{width=70%})

Congratulations, you have just explored some basic Mainzelliste functionality. But you have just
scratched the surface. Mainzelliste comes with a comprehensive API, allowing you to use it in a
myriad of pseudonymization schemes, attach your own applications, hide or show pseudonyms or build
advanced workflows such as selecting an existing patient or transparently loading IDAT into other applications.

For more details, please look into the Mainzelliste documentation, in particular the
[API Documentation](https://bitbucket.org/medicalinformatics/mainzelliste/downloads/Mainzelliste_Schnittstelle_v3.1.0.pdf).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 456df91

Please sign in to comment.