cTAKES USDHUBClinician documentation
Wrapper referenceOne note from text to reviewed rows

How one clinical note moves through the wrapper

USDHUB00000000000000000001.SYNTHETIC-DEMO.txt enters as a text file. cTAKES marks phrases in that text and attaches coded candidates. The wrapper keeps the filename, source text, character offsets, dictionary, recipe, output rows, and run receipts connected until a reviewer can open the same phrase again.

Input one text fileAnalysis one ordered recipeResult one SQLite databaseReview source-linked rows
01

The filename stays attached to the note

The name USDHUB00000000000000000001.SYNTHETIC-DEMO.txt carries two identifiers. USDHUB00000000000000000001 is the literal USDHUB prefix plus a 20-digit hub identifier. SYNTHETIC-DEMO is the note identifier inside that hub. The wrapper validates both before cTAKES starts, then writes them beside the note text and every extracted row.

If two files normalize to the same hub and note identifiers, the full batch stops. That prevents two source notes from being written under one identity.

02

cTAKES marks text and attaches clinical information

The words in the note remain available after extraction. cTAKES reads them into a Common Analysis Structure, usually called the CAS, then attaches structured information to exact character positions. One annotation can mark characters 85 through 90 as the fever phrase, another can attach a candidate concept to that span, and an assertion can record that the preceding “No” negates it.

Source note

USDHUB00000000000000000001.SYNTHETIC-DEMO.txt
source textannotation
SYNTHETIC NOTE - no patient data.

Assessment
Right flank pain started yesterday. No fever.

Plan
Start DemoMed 10 mg by mouth twice daily for 5 days.

Imaging context
A mass near the right kidney is described.

The concept span points back to the literal text fever. Its character offsets identify the same phrase after cTAKES attaches a CUI, while the assertion fields record that the note negates it.

The source phrase fever keeps its character span while cTAKES adds a synthetic coded meaning and a negated assertion, producing a row that still points to the phrase.
Figure 1. cTAKES adds structured information around the source words; the wrapper keeps the row linked to those words.
Object in the CASWhat it carries
Source textThe complete note exactly as cTAKES received it.
SpanThe begin and end character offsets for a phrase in that source text.
Concept candidateA possible coded meaning such as a UMLS CUI, semantic type, preferred term, or ontology code.
Medication mentionThe drug phrase plus cTAKES fields such as dose, route, frequency, form, duration, and RxNorm identity when available.
AssertionContext such as negation, uncertainty, conditional use, generic use, and subject.
RelationA typed connection between annotations, including degree and anatomical location in this recipe.

Clinical basics explains CUI, RxCUI, semantic type, assertion, relation, CAS, and XMI with the same note example.

03

The terminology supplies possible coded meanings

One note says “renal calculus” and another says “kidney stone.” A selected terminology can map both phrases to the same candidate identity. An ontology also defines relationships among concepts. UMLS integrates concepts from many source vocabularies under CUIs while preserving their source codes, and RxNorm is one source used for medication identity. A returned mapping remains a candidate, not a guaranteed reading of the sentence.

The runtime dictionary is the searchable part cTAKES actually loads. It contains selected terms, codes, semantic types, and source rows from one UMLS release. When cTAKES sees a phrase in the note, it queries that dictionary and adds the supported candidate concepts to the same text span.

A local phrase enters the versioned dictionary, which returns fictional CUI and RxCUI candidates defined by the shared ontology.
Figure 2. The ontology names the possible clinical identities, and cTAKES queries the selected dictionary terms to find them from note wording.

The dictionary can do

  • match a source phrase to one or more coded candidates;
  • retain the vocabulary source and semantic type for each candidate;
  • make the same selected terminology available at each participating site.

The dictionary cannot do alone

  • decide which same-span meaning fits the surrounding sentence;
  • decide whether the note denies or questions the concept;
  • prove that the extracted candidate is clinically correct.

The wrapper activates one versioned dictionary release and records its manifest and database hashes. A run cannot quietly load a different set of terminology rows under the same analysis identity.

Dictionary and recipes shows the selected UMLS sources, term types, semantic types, database build, audit, and activation.

04

The recipe controls the order of analysis

The note does not pass through every component available in cTAKES. The effective recipe lists the components used for this run and their order. That order changes the result because later components use annotations created by earlier components.

The wrapper validates the batch before cTAKES, then runs text structure, dictionary lookup, WSD, medication extraction, five assertion properties, degree and location relations, and the selected writers in that order.
Figure 3. One recipe controls the stages applied to every accepted note in the batch.
  1. Structure stages divide the note into sections, sentences, tokens, parts of speech, and chunks.
  2. The dictionary stage adds coded concept candidates to matching spans.
  3. WSD examines spans that have more than one distinct CUI candidate.
  4. Drug NER adds medication mentions and their structured attributes.
  5. Five assertion models add negation, uncertainty, conditional, generic, and subject context.
  6. Relation stages connect supported degree and anatomical-location annotations.
  7. The selected writers serialize the completed CAS.

The wrapper builds an effective recipe for the run and saves it as run_pipeline.effective.piper. That file records the stage order cTAKES actually received.

Open the full recipe with the input and output expected at each stage.

05

The wrapper checks the batch before, during, and after cTAKES

The wrapper surrounds the cTAKES process because a Java process exiting successfully does not prove that every input identity, source span, output row, and receipt still agrees.

WhenChecks tied to the noteWhat happens on failure
Before JavaEvery filename matches USDHUB####################.NoteID.txt; normalized identities are unique; input, output, work, and SQLite paths do not overlap; the recipe, dictionary, WSD model, JDBC asset, capacity plan, and expected output space are available.The batch stops before a note enters cTAKES.
During cTAKESThe effective recipe controls stage order; dictionary and WSD assets remain bound to the run; concept and medication rows retain their CUI/RxCUI pair, source text span, and run identity.The note transaction rolls back or the run exits incomplete.
After JavaSQLite opens cleanly; note hashes and UTF-16 spans match the stored text; candidate identities are atomic; CSV cells equal their SQLite views; XMI hashes are registered when XMI is selected; manifest and database identities agree.The manifest is marked failed, and the batch is not presented as complete.
The USDHUB wrapper validates identity and capacity before Java, assembles the reviewed cTAKES recipe with Apache and wrapper-owned stages, writes canonical SQLite inside that recipe, and validates completed outputs afterward.
Figure 4. The wrapper controls the complete batch boundary and assembles the exact analysis recipe that runs inside Java.
06

WSD keeps every candidate while it ranks the same-span meanings

Word-sense disambiguation runs when one text span has more than one distinct CUI candidate. It compares the words around that span with the candidate names, definitions, semantic types, and dictionary relations stored in the versioned WSD model. A decision requires complete candidate profiles, direct lexical, graph, or preferred-term evidence, a sufficient raw score, and a sufficient normalized margin.

Candidate groupStored result
One distinct CUIThe row stays in SQLite and both WSD fields stay blank because there was nothing to disambiguate.
Several CUIs with enough evidence and separationEvery row stays. One receives Y, the others receive N, and the scores sum to one inside that span group.
Several CUIs with weak or closely tied evidenceEvery row stays and all WSD fields stay blank. That is an abstention, so the uncertainty remains visible.

The WSD model is generated from the same validated dictionary release that cTAKES queries. The wrapper checks the model hash, build receipt, profile, and dictionary binding before Java starts. WSD is on for the production recipe, and a missing or mismatched model stops the run.

WSD shows the candidate scores, decision gates, abstention path, model receipt, and review plan.

07

The source note and its structured rows commit together

The SQLite writer records run metadata when it initializes. It then opens one transaction for each note and writes the document identity, full source text, source hash, concept candidates, medication rows, and CUI counts together. If that note write fails, the note and its partial rows roll back together.

The completed cTAKES CAS can write native XMI and canonical SQLite in parallel. Concepts CSV, drugs CSV, and the clinician viewer are derived from the completed SQLite database.
Figure 5. SQLite is the structured source for CSV and the viewer. Native XMI comes from the same completed CAS.
FileWhere it comes fromWhat it is for
annotations.sqliteWritten from the completed CAS, one note transaction at a time.The canonical structured result, source text, run metadata, and row-level evidence.
concepts.csv and drugs.csvStreamed from run-scoped SQLite views after the database closes cleanly.The reviewed 26-field concept and 34-field drug delivery tables.
XMI filesWritten directly from the completed cTAKES CAS when standard output is selected.The native serialized analysis structure for tools that consume CAS/XMI.
Clinician viewer HTMLBuilt from a completed and checked SQLite database.Offline review of each row beside the exact phrase and full source note.

Outputs and review lists every delivered file, field, receipt, and read-back check.

08

The run starts only when the job fits the available machine

The same server can expose different capacity to different jobs. A container or scheduler may allow four CPUs on a 32-core host, or a WSL environment may have less usable memory and disk than the physical machine. The wrapper plans against the capacity visible to the cTAKES job.

The wrapper validates capacity and inputs, starts Java and loads shared assets once, commits the first note, reuses the loaded analysis for later notes, then finishes outputs and receipts.
Figure 6. Capacity admission happens before Java. The accepted process loads shared assets once and reuses them across the batch.
Capacity inputHow the wrapper uses it
CPU affinity and cgroup quotaCaps analysis threads and total async workers at the CPUs the job can actually use.
Available memory and cgroup headroomSizes the Java heap from memory still available inside the job boundary.
Linux commit headroomChecks CommitLimit - Committed_AS so a heap is not admitted only because free-RAM math looked safe.
Input size and selected writersEstimates persistent and temporary output for SQLite, CSV, XMI, viewer, logs, receipts, and async shards.
Free space on each filesystemChecks output, work, and custom SQLite locations separately and leaves the configured reserve.

A plan with missing probes, insufficient memory, or insufficient disk stops before Java. If an operator supplies a heap size manually, the wrapper compares that value with the same live job boundary before accepting it.

Startup and capacity explains the admission math, cold start, first-note timing, steady processing, drain, and storage receipt.

09

Three identifiers answer three different questions

The CSV row needs a readable software release, two hospitals need to know whether they ran the same extraction definition, and an operator needs to find one execution in the logs. Those are three different identities.

IdentifierWhat it bindsQuestion it answers
release_idWrapper version + dictionary release + cTAKES versionWhich named software and terminology release produced this row?
analysis_idRelease + exact wrapper source + normalized recipe + dictionary database + SQLite schema + WSD model or off stateDid these runs use the same extraction definition?
run_idOne UTC start time and one unique execution nonceWhich logs, files, rows, and receipts belong to this execution?

Two sites can have the same analysis_id and different run_id values. That means they used the same extraction definition in two separate executions. A recipe, dictionary, WSD model, schema, or wrapper-source change produces a new analysis_id.

The filenames, full source note, output rows, effective recipe, dictionary manifest, WSD receipt, timing report, storage report, sanity report, and viewer all carry or connect back to these identifiers.

10

A reviewer can move from a row back to the source phrase

Each concept and medication row stores a document identity plus begin and end offsets. The viewer uses those offsets to select the phrase in the full note. It also verifies the stored note hash before showing the evidence, so a row cannot quietly point into different text.

The reviewer can check

  • whether the selected phrase is the intended clinical mention;
  • whether the CUI, RxCUI, assertion, relation, and medication fields fit the sentence;
  • whether WSD decided or abstained for a same-span candidate group.

The wrapper records

  • the source note and SHA-256 hash;
  • the exact UTF-16 offsets and evidence text;
  • the release, analysis, run, dictionary, recipe, schema, and WSD identities.

The result stays reviewable because the coded row never loses its link to the original phrase. That same link also lets a site correct local labels and build a training set without sending the source note to another site.

Continue with the task you are doing