# Data flow diagram

> A one-page 1920 × 1080 data flow diagram for a physiotherapy clinic, showing seven transfers between a booking form, a clinic system, a lab, a billing provider and an archive. The stores are one filing cabinet component with name, contents and retention to change, and each arrow's colour and line style marks it encrypted or not.

- The design, as a .vd file: https://getv.design/library/data-flow-diagram.vd
- Its page: https://getv.design/library/data-flow-diagram

## How it was made

Drafted from this prompt:

> A data flow diagram for Elmstead Physio showing how patient data moves from an online form to the clinic system, a lab, a billing provider and an archive. Mark encrypted and unencrypted transfers.

Then refined:

- Added a retention line under each filing cabinet.
- Enlarged the arrow labels and the title, and moved the diagram down to use the space under the heading.

## Make it yours

- "Make a data flow diagram for our dental practice."
- "Mark the lab arrow as encrypted and add what data it carries."
- "Add a second billing provider and a retention period for it."

## The source

```vd
version 12
kind design
title "Data flow diagram"
$clinic = #FBFCFD
$teal = #0E7490
$tealpale = #E1F0F4
$coral = #F2545B
$grey = #4B5563
$ink = #12303A
$m = 80
$r1 = 450
$r2 = 815
$ah = 200
$ch = 150

font head = "Federo"
  fallback "Georgia, serif"
  face asset=federo-400 weight=400

font body = "Mukta"
  fallback "system-ui, sans-serif"
  face asset=mukta-400 weight=400
  face asset=mukta-600 weight=600

asset federo-400 = font/woff2 hash=sha256-18bd9648ff05f6a9c624d71099e512c962b4912b969266e7ccb2dbd40af35788 bytes=26620 license=OFL
asset mukta-400 = font/woff2 hash=sha256-510168c767781af2e91c8c62b29baef5673b3b00445e9ab97fc2d0cdc99fd8c3 bytes=20480 license=OFL
asset mukta-600 = font/woff2 hash=sha256-1e86a6af02aed7cee7e326ba92128aa3f738f1e92f17cd3726757819a420b2fe bytes=21176 license=OFL

frame flow x=0 y=0 w=1920 h=1080 background=clinic
  text flow.title x=$m y=60 w=1760 h=84 font=head size=70 letterSpacing=-0.5 fill=ink
    "Seven routes for patient data, two not yet encrypted"
  text flow.sub x=$m y=(@flow.title.bottom + 10) w=1500 h=34 font=body size=26 fill=grey
    "Elmstead Physio, Norwich. From online booking to the lab, billing and the archive."

  rect patient x=$m y=($r1 - $ch / 2) w=200 h=$ch fill=none stroke=grey strokeWidth=3 radius=10
  text patient.name x=(@patient.x + 16) y=(@patient.y + 24) w=168 h=70 font=head size=28 align=center fill=ink
    "Online booking form"
  text patient.cap x=(@patient.x + 16) y=(@patient.bottom - 44) w=168 h=28 font=body size=20 align=center fill=grey
    "Patients, all sites"

  instance inbox component=cab x=440 y=($r1 - $ch / 2)
    override cab.name
      "Form inbox"
    override cab.detail
      "Booking requests"
    override cab.keep
      "Cleared after 30 days"

  rect system x=950 y=($r1 - $ah / 2) w=300 h=$ah fill=teal radius=14
  text system.name x=@system.x y=(@system.y + 54) w=@system.w h=48 font=head size=38 align=center fill=clinic
    "Clinic system"
  text system.cap x=(@system.x + 20) y=(@system.y + 112) w=260 h=56 font=body size=21 align=center fill=clinic
    "Appointments, notes and referrals"

  rect lab x=1560 y=($r1 - $ah / 2) w=280 h=$ah fill=none stroke=grey strokeWidth=3 radius=10
  text lab.name x=@lab.x y=(@lab.y + 56) w=@lab.w h=44 font=head size=34 align=center fill=ink
    "Wensum Lab"
  text lab.cap x=(@lab.x + 16) y=(@lab.y + 112) w=248 h=56 font=body size=21 align=center fill=grey
    "External laboratory"

  instance records component=cab x=940 y=($r2 - $ch / 2)
    override cab.name
      "Clinic records"
    override cab.detail
      "Notes, referrals, letters"
    override cab.keep
      "Live while in treatment"

  instance archive component=cab x=440 y=($r2 - $ch / 2)
    override cab.name
      "Archive"
    override cab.detail
      "Closed records"
    override cab.keep
      "Destroyed after 8 years"

  rect billing x=1560 y=($r2 - $ch / 2) w=280 h=$ch fill=none stroke=grey strokeWidth=3 radius=10
  text billing.name x=(@billing.x + 16) y=(@billing.y + 24) w=248 h=44 font=head size=34 align=center fill=ink
    "Marlow Billing"
  text billing.cap x=(@billing.x + 16) y=(@billing.bottom - 52) w=248 h=28 font=body size=20 align=center fill=grey
    "Invoices and insurers"

  connector t1 x1=@patient.right y1=$r1 x2=@inbox.cab.body.left y2=$r1 stroke=teal strokeWidth=6 end=arrow
  text t1.data x=(@patient.right + 10) y=($r1 - 70) w=(@inbox.cab.body.left - @patient.right - 20) h=58 font=body size=22 align=center valign=bottom fill=grey
    "Name, date of birth, phone"
  text t1.state x=@t1.data.x y=($r1 + 10) w=@t1.data.w h=30 font=body size=22 weight=600 align=center fill=teal
    "Encrypted, HTTPS"

  connector t2 x1=@inbox.cab.body.right y1=$r1 x2=@system.left y2=$r1 stroke=teal strokeWidth=6 end=arrow
  text t2.data x=(@inbox.cab.body.right + 10) y=($r1 - 70) w=(@system.left - @inbox.cab.body.right - 20) h=58 font=body size=22 align=center valign=bottom fill=grey
    "Booking checked by reception"
  text t2.state x=@t2.data.x y=($r1 + 10) w=@t2.data.w h=30 font=body size=22 weight=600 align=center fill=teal
    "Encrypted, TLS"

  connector t3 x1=@system.right y1=($r1 - 44) x2=@lab.left y2=($r1 - 44) stroke=teal strokeWidth=6 end=arrow
  text t3.data x=(@system.right + 10) y=($r1 - 44 - 70) w=(@lab.left - @system.right - 20) h=58 font=body size=22 align=center valign=bottom fill=grey
    "Referral: name, NHS number, test"
  text t3.state x=@t3.data.x y=($r1 - 44 + 8) w=@t3.data.w h=30 font=body size=22 weight=600 align=center fill=teal
    "Encrypted, secure portal"

  connector t4 x1=@lab.left y1=($r1 + 44) x2=@system.right y2=($r1 + 44) stroke=coral strokeWidth=6 dash="14 10" end=arrow
  text t4.state x=@t3.data.x y=($r1 + 44 - 38) w=@t3.data.w h=30 font=body size=22 weight=600 align=center fill=coral
    "Not encrypted, plain email"
  text t4.data x=@t3.data.x y=($r1 + 44 + 10) w=@t3.data.w h=58 font=body size=22 align=center fill=grey
    "Results as a PDF attachment"

  connector t5 x1=@system.cx y1=@system.bottom x2=@system.cx y2=@records.cab.body.top stroke=teal strokeWidth=6 end=arrow
  text t5.data x=(@system.cx + 26) y=(@system.bottom + 70) w=260 h=30 font=body size=22 fill=grey
    "Full treatment record"
  text t5.state x=@t5.data.x y=(@t5.data.bottom + 2) w=260 h=30 font=body size=22 weight=600 fill=teal
    "Encrypted, TLS"

  connector t6 x1=@records.cab.body.right y1=$r2 x2=@billing.left y2=$r2 stroke=teal strokeWidth=6 end=arrow
  text t6.data x=(@records.cab.body.right + 10) y=($r2 - 70) w=(@billing.left - @records.cab.body.right - 20) h=58 font=body size=22 align=center valign=bottom fill=grey
    "Name, address, session codes"
  text t6.state x=@t6.data.x y=($r2 + 10) w=@t6.data.w h=30 font=body size=22 weight=600 align=center fill=teal
    "Encrypted, SFTP"

  connector t7 x1=@records.cab.body.left y1=$r2 x2=@archive.cab.body.right y2=$r2 stroke=coral strokeWidth=6 dash="14 10" end=arrow
  text t7.data x=(@archive.cab.body.right + 10) y=($r2 - 70) w=(@records.cab.body.left - @archive.cab.body.right - 20) h=58 font=body size=22 align=center valign=bottom fill=grey
    "Closed records, copied nightly"
  text t7.state x=@t7.data.x y=($r2 + 10) w=@t7.data.w h=30 font=body size=22 weight=600 align=center fill=coral
    "Not encrypted, USB disk"

  text key.title x=$m y=735 w=300 h=40 font=head size=30 fill=ink
    "How to read it"
  connector key.enc x1=$m y1=(@key.title.bottom + 34) x2=($m + 90) y2=(@key.title.bottom + 34) stroke=teal strokeWidth=6
  text key.enc.t x=($m + 108) y=(@key.title.bottom + 18) w=210 h=32 font=body size=22 fill=grey
    "Encrypted transfer"
  connector key.raw x1=$m y1=(@key.title.bottom + 84) x2=($m + 90) y2=(@key.title.bottom + 84) stroke=coral strokeWidth=6 dash="14 10"
  text key.raw.t x=($m + 108) y=(@key.title.bottom + 68) w=210 h=32 font=body size=22 fill=grey
    "Not encrypted"
  rect key.cab x=($m + 12) y=(@key.title.bottom + 112) w=66 h=60 fill=tealpale stroke=teal strokeWidth=3 radius=4
  rect key.cab.d1 x=(@key.cab.x + 8) y=(@key.cab.y + 8) w=50 h=19 fill=clinic stroke=teal strokeWidth=2 radius=2
  rect key.cab.d2 x=(@key.cab.x + 8) y=(@key.cab.y + 33) w=50 h=19 fill=clinic stroke=teal strokeWidth=2 radius=2
  text key.cab.t x=($m + 108) y=(@key.cab.y + 4) w=210 h=56 font=body size=22 fill=grey
    "Filing cabinet, where data is stored"

frame cab x=0 y=1200 w=320 h=280 component
  rect cab.body x=40 y=0 w=240 h=150 fill=tealpale stroke=teal strokeWidth=4 radius=8
  rect cab.d1 x=54 y=12 w=212 h=38 fill=clinic stroke=teal strokeWidth=2 radius=4
  rect cab.d2 x=54 y=56 w=212 h=38 fill=clinic stroke=teal strokeWidth=2 radius=4
  rect cab.d3 x=54 y=100 w=212 h=38 fill=clinic stroke=teal strokeWidth=2 radius=4
  rect cab.h1 x=(@cab.body.cx - 28) y=27 w=56 h=8 fill=teal radius=4
  rect cab.h2 x=(@cab.body.cx - 28) y=71 w=56 h=8 fill=teal radius=4
  rect cab.h3 x=(@cab.body.cx - 28) y=115 w=56 h=8 fill=teal radius=4
  text cab.name x=0 y=162 w=320 h=44 font=head size=32 align=center fill=ink
    "Store"
  text cab.detail x=0 y=206 w=320 h=28 font=body size=21 align=center fill=grey
    "Detail"
  text cab.keep x=0 y=234 w=320 h=28 font=body size=21 weight=600 align=center fill=teal
    "Kept"
```
