Slide 1

Slide 1 text

🧑⚕ Clinics on Rails Alex Watt
 @alexcwatt

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

🎓 2,200 families self-supporting

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

2025 Pittsburgh Team

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Benefits of clinical data ● Set volunteer expectations ● Plan for pharmacy ● Understand community health over time

Slide 12

Slide 12 text

Requirements doc January 2024

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Surveyed options Throughout 2024

Slide 15

Slide 15 text

BackpackEMR ✅ Designed for mobile medical clinics
 ❌ PII stored outside of Ethiopia, could not host in country, limited reporting

Slide 16

Slide 16 text

Google Sheet ✅ Free, ubiquitous, simple
 ❌ Relational data, limited data validation, more difficult integrations, permissions

Slide 17

Slide 17 text

OpenMRS & others ✅ Powerful open source package
 ❌ Seemed non-trivial to deploy and customize

Slide 18

Slide 18 text

It had to be simple.

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Built in a week (January 2025) Monday rails new Tuesday Finished data models Wednesday Deployed with Hatchbox Thursday User policies & launch Friday Addressed feedback

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Project Impact ● Volunteers can help with medical data ● Medical teams see their impact ● Future teams are better prepared

Slide 24

Slide 24 text

1,583 patient encounters documented in 5 communities in Addis

Slide 25

Slide 25 text

Innovation Tokens acw.sh/boring

Slide 26

Slide 26 text

I spent only one token — on search.

Slide 27

Slide 27 text

Neoplasms Diseases of the blood or blood-forming organs Endocrine, nutritional, or metabolic diseases etc.

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Simple Hybrid Search + semantic fuzzy match

Slide 30

Slide 30 text

Simple Hybrid Search + semantic fuzzy match Query: fizzy sparkling water soda frizzy hair Fizzy’s Diner

Slide 31

Slide 31 text

Simple Hybrid Search + informers gem (sentence-transformers) Jaro-Winkler

Slide 32

Slide 32 text

sentence-transformers/all-MiniLM-L6-v2 91 MB 1 vCPU and 1 GB RAM

Slide 33

Slide 33 text

Embedding computation MODEL_NAME = "sentence-transformers/all-MiniLM-L6-v2" EMBEDDER = Informers.pipeline("embedding", MODEL_NAME) def embedding(text) embeddings_array = EMBEDDER.(text) Vector[*embeddings_array] end

Slide 34

Slide 34 text

Embedding computation MODEL_NAME = "sentence-transformers/all-MiniLM-L6-v2" EMBEDDER = Informers.pipeline("embedding", MODEL_NAME) def embedding(text) embeddings_array = EMBEDDER.(text) Vector[*embeddings_array] end

Slide 35

Slide 35 text

Embeddings for diagnoses diagnoses_with_embeddings = Diagnosis.all.map do |diagnosis| text = "#{diagnosis.name} (e.g., #{diagnosis.examples})" embedding = embedding(text) { diagnosis: diagnosis, embedding: embedding } end

Slide 36

Slide 36 text

Query embedding QUERY_PREFIX = "Represent this sentence for searching relevant passages: " query_embedding = embedding(QUERY_PREFIX + query)

Slide 37

Slide 37 text

Search with embeddings and fuzzy text search LIMIT = 3 diagnoses_with_embeddings.filter_map do |d| semantic = cosine_similarity(query_embedding, d[:embedding]) fuzzy = fuzzy_score(query, d) semantic_relevant = semantic >= MIN_SEMANTIC_SCORE fuzzy_relevant = fuzzy >= MIN_FUZZY_SCORE next unless semantic_relevant || fuzzy_relevant [d[:diagnosis], [semantic, fuzzy].max] end.sort_by { |_, score| -score }.first(LIMIT).map(&:first)

Slide 38

Slide 38 text

Search with embeddings and fuzzy text search LIMIT = 3 diagnoses_with_embeddings.filter_map do |d| semantic = cosine_similarity(query_embedding, d[:embedding]) fuzzy = fuzzy_score(query, d) semantic_relevant = semantic >= MIN_SEMANTIC_SCORE fuzzy_relevant = fuzzy >= MIN_FUZZY_SCORE next unless semantic_relevant || fuzzy_relevant [d[:diagnosis], [semantic, fuzzy].max] end.sort_by { |_, score| -score }.first(LIMIT).map(&:first)

Slide 39

Slide 39 text

Search with embeddings and fuzzy text search LIMIT = 3 diagnoses_with_embeddings.filter_map do |d| semantic = cosine_similarity(query_embedding, d[:embedding]) fuzzy = fuzzy_score(query, d) semantic_relevant = semantic >= MIN_SEMANTIC_SCORE fuzzy_relevant = fuzzy >= MIN_FUZZY_SCORE next unless semantic_relevant || fuzzy_relevant [d[:diagnosis], [semantic, fuzzy].max] end.sort_by { |_, score| -score }.first(LIMIT).map(&:first)

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

What I hope you take away

Slide 43

Slide 43 text

#1: Your coffee ritual is (probably) weak ☕

Slide 44

Slide 44 text

#2: End-to-end ASAP 📅

Slide 45

Slide 45 text

#3: Simple software is great 👨🔧

Slide 46

Slide 46 text

#4: Open-weight models are awesome ✨

Slide 47

Slide 47 text

#5: You can just do things 💪

Slide 48

Slide 48 text

አመሰግናለሁ acw.sh/act