Henry M. Blair
A command line interface for the TriNetX query browser · Research tooling · TriNetX US Collaborative Network
Research tooling · TriNetX US Collaborative Network

A command line interface for the TriNetX query browser

Henry M. Blair

A federated-network query tool gives you a browser and no API. The numbers it returns are real, but the path to them lives in whoever did the clicking. The point of this script is that the path becomes a file you can read, diff and run again.

4,007
lines of zsh
16
command-line actions
2
studies driven
0
counts typed by hand
Status. In active use on the prostate cancer and vaginal estrogen studies.

Why the counts stopped being typed

The output of this tool is the input to everything downstream.

Each run writes a counts file and a folder of query definitions. Those counts are what the master workbook reads, and the workbook is what the cohort figure on this site reads — live, by query name. A number on the prostate cancer page is therefore traceable back through the sheet, through the dump, to the query definition that produced it, without any step in that chain being a person retyping a figure.

The question

If the analysis has to be defensible, can the query layer underneath it be made reproducible when the vendor only offers a web interface?

How it is being done

What comes next

The same treatment for the parts still done by hand — chiefly turning a dumped definition straight into the methods paragraph that describes it.

This page grows as the work does.