# ssi-hf-research/re-identification architecture

> Architecture diagram of the GitHub repository ssi-hf-research/re-identification, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ssi-hf-research/re-identification
- Repository: https://github.com/ssi-hf-research/re-identification

## Overview

This repository implements Fabric chaincode for pseudonymous study and warehouse identity mapping and controlled re-identification. Organizations invoke contract transactions: study mapping creates and resolves study pseudonyms; study re-identification manages requests, committee approvals, and private work-package results. Warehouse mapping and identity mapping store separate private mappings; warehouse re-identification verifies approvals and records or retrieves re-identified PII. The excerpts show contracts reading and writing Fabric state and private data. The README is empty, so links between contracts and deployment wiring are not established here.

Main entry points: [`chaincode/study/study-reidentification/src/studyReIdentification.contract.ts`](https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/study/study-reidentification/src/studyReIdentification.contract.ts) (Study re-identification), [`chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts`](https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts) (Warehouse re-identification), [`chaincode/warehouse/warehouse-mapping/src/warehouseMapping.contract.ts`](https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/warehouse/warehouse-mapping/src/warehouseMapping.contract.ts) (Warehouse mapping), [`chaincode/warehouse/identity-mapping/src/identityMapping.contract.ts`](https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/warehouse/identity-mapping/src/identityMapping.contract.ts) (Identity mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_study["Study workflows"]
  node_study_mapping["Study mapping"]
  node_study_reid["Study re-identification"]
end

subgraph group_warehouse["Warehouse workflows"]
  node_warehouse_mapping["Warehouse mapping"]
  node_identity_mapping["Identity mapping"]
  node_warehouse_reid["Warehouse re-identification"]
end

subgraph group_state["Fabric state"]
  node_fabric_state[("Fabric ledger and private data")]
end

node_ro(("Research organization"))
node_ec(("Ethics committee"))
node_spi(("Study provider"))
node_wpi(("Warehouse provider"))
node_im(("Identity manager"))
node_mo(("Medical organization"))

node_study_mapping -->|"reads/writes private data"| node_fabric_state
node_study_reid -->|"reads/writes state"| node_fabric_state
node_study_reid -->|"reads/writes private data"| node_fabric_state
node_warehouse_mapping -->|"reads/writes private data"| node_fabric_state
node_identity_mapping -->|"reads/writes private data"| node_fabric_state
node_warehouse_reid -->|"reads/writes state"| node_fabric_state
node_warehouse_reid -->|"reads/writes private data"| node_fabric_state
node_ro -.->|"creates requests"| node_study_reid
node_ec -.->|"signs decisions"| node_study_reid
node_spi -.->|"registers results"| node_study_reid
node_wpi -.->|"registers pseudonyms"| node_warehouse_mapping
node_im -.->|"registers identities"| node_identity_mapping
node_ro -.->|"creates requests"| node_warehouse_reid
node_wpi -.->|"registers PII"| node_warehouse_reid
node_mo -.->|"retrieves PII"| node_warehouse_reid

click node_study_mapping "https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/study/study-mapping/src/studyMapping.contract.ts"
click node_study_reid "https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/study/study-reidentification/src/studyReIdentification.contract.ts"
click node_warehouse_mapping "https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/warehouse/warehouse-mapping/src/warehouseMapping.contract.ts"
click node_identity_mapping "https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/warehouse/identity-mapping/src/identityMapping.contract.ts"
click node_warehouse_reid "https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_study_mapping,node_study_reid toneBlue
class node_warehouse_mapping,node_identity_mapping,node_warehouse_reid toneAmber
class node_fabric_state toneMint
class node_ro,node_ec,node_spi,node_wpi,node_im,node_mo toneIndigo
```

## Components

### Study workflows

- [Study mapping](https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/study/study-mapping/src/studyMapping.contract.ts): `chaincode/study/study-mapping/src/studyMapping.contract.ts`
- [Study re-identification](https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/study/study-reidentification/src/studyReIdentification.contract.ts): `chaincode/study/study-reidentification/src/studyReIdentification.contract.ts`

### Warehouse workflows

- [Warehouse mapping](https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/warehouse/warehouse-mapping/src/warehouseMapping.contract.ts): `chaincode/warehouse/warehouse-mapping/src/warehouseMapping.contract.ts`
- [Identity mapping](https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/warehouse/identity-mapping/src/identityMapping.contract.ts): `chaincode/warehouse/identity-mapping/src/identityMapping.contract.ts`
- [Warehouse re-identification](https://github.com/ssi-hf-research/re-identification/blob/master/chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts): `chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts`

### Fabric state

- **Fabric ledger and private data**

### Other components

- **Research organization**
- **Ethics committee**
- **Study provider**
- **Warehouse provider**
- **Identity manager**
- **Medical organization**

## Connections

- Study mapping → Fabric ledger and private data: reads/writes private data (evidence: `chaincode/study/study-mapping/src/studyMapping.contract.ts`)
- Study re-identification → Fabric ledger and private data: reads/writes state (evidence: `chaincode/study/study-reidentification/src/studyReIdentification.contract.ts`)
- Study re-identification → Fabric ledger and private data: reads/writes private data (evidence: `chaincode/study/study-reidentification/src/studyReIdentification.contract.ts`)
- Warehouse mapping → Fabric ledger and private data: reads/writes private data (evidence: `chaincode/warehouse/warehouse-mapping/src/warehouseMapping.contract.ts`)
- Identity mapping → Fabric ledger and private data: reads/writes private data (evidence: `chaincode/warehouse/identity-mapping/src/identityMapping.contract.ts`)
- Warehouse re-identification → Fabric ledger and private data: reads/writes state (evidence: `chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts`)
- Warehouse re-identification → Fabric ledger and private data: reads/writes private data (evidence: `chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts`)
- Research organization → Study re-identification: creates requests (evidence: `chaincode/study/study-reidentification/src/studyReIdentification.contract.ts`)
- Ethics committee → Study re-identification: signs decisions (evidence: `chaincode/study/study-reidentification/src/studyReIdentification.contract.ts`)
- Study provider → Study re-identification: registers results (evidence: `chaincode/study/study-reidentification/src/studyReIdentification.contract.ts`)
- Warehouse provider → Warehouse mapping: registers pseudonyms (evidence: `chaincode/warehouse/warehouse-mapping/src/warehouseMapping.contract.ts`)
- Identity manager → Identity mapping: registers identities (evidence: `chaincode/warehouse/identity-mapping/src/identityMapping.contract.ts`)
- Research organization → Warehouse re-identification: creates requests (evidence: `chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts`)
- Warehouse provider → Warehouse re-identification: registers PII (evidence: `chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts`)
- Medical organization → Warehouse re-identification: retrieves PII (evidence: `chaincode/warehouse/warehouse-reidentification/src/warehouseReIdentification.contract.ts`)
