# Cohort

What is in the rig, and what each patient is for.

**Generated. Do not edit by hand** -- run `./regenerate-cohort.sh` and commit the result.
The same rows are served live at `/` as a table and at `/_fake/cohort` as JSON. This file
says what was baked in; those say what is there now.

| handle          | fhir id                | identifier | name                                 | dob        | diagnosis                                                                                                                                | resources                                                                                                              | origin  | staged for                                              |
|-----------------|------------------------|------------|--------------------------------------|------------|------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|---------|---------------------------------------------------------|
| HAPPY-01        | eT4rQm9XbK2wPzL7HdN3vA | 771502     | Rivera, Dolores                      | 1971-03-04 | Malignant neoplasm of breast (Stage IIB); Essential hypertension                                                                         | C:2 O:12 DR:3 DocRef:1 Enc:2 MedReq:1 Proc:1                                                                           | fixture | normal import                                           |
| NO-LABS-01      | eB8kR2wQmX7zT4pL9HdN6C | 771518     | Chen, Mei                            | 1965-11-22 | Non-small cell lung cancer (Stage IIIA)                                                                                                  | C:1 O:0 DR:1 Enc:1                                                                                                     | fixture | missing records                                         |
| MERGE-OLD-01    | eM3nW8qZrK5tY2vB7cX4dF | 771533     | Okafor, Adaeze                       | 1958-06-30 | Malignant tumor of colon                                                                                                                 | [retired] C:1 O:0 DR:0 Enc:1                                                                                           | fixture | merge handling, retired record                          |
| MERGE-NEW-01    | eM9pL4sVtN6uH3jK8mQ2wR | 771534     | Okafor, Adaeze                       | 1958-06-30 | Malignant tumor of colon (Stage IIIB)                                                                                                    | C:1 O:3 DR:1 Enc:1                                                                                                     | fixture | merge handling, surviving record                        |
| DUP-01          | eD5hJ7kL9mN2pQ4rS6tU8v | 771540     | Baptiste, Yves                       | 1949-09-12 | Malignant tumor of prostate (Stage IIA)                                                                                                  | C:1 O:2 DR:1 Enc:1                                                                                                     | fixture | duplicate identifier                                    |
| DUP-02          | eD1aB3cD5eF7gH9iJ2kL4m | 771540     | Baptiste, Yvon                       | 1949-09-12 | Malignant tumor of prostate                                                                                                              | C:1 O:1 DR:1 Enc:1                                                                                                     | fixture | duplicate identifier                                    |
| NO-DIAGNOSIS-01 | eN7yU5tR3eW1qA9sD7fG5h | 771556     | Halvorsen, Ingrid                    | 1980-01-17 | (none)                                                                                                                                   | C:0 O:1 DR:0 Enc:1                                                                                                     | fixture | no cancer diagnosis on file                             |
| PAGING-01       | eP2zX4cV6bN8mQ1wE3rT5y | 771562     | Adeyemi, Tunde                       | 1962-05-08 | Multiple myeloma (ISS stage II)                                                                                                          | C:1 O:24 DR:0 Enc:1                                                                                                    | fixture | paging, more observations than one page                 |
| GEN-BREAST-01   | 1215                   | 772000     | Leannon79, Alla648 Cordelia715       | 1952-02-09 | Malignant neoplasm of breast (disorder) (Stage IIB); Medication review due (situation); Reports of violence in the environment (finding) | C:3 O:37 DR:8 Allergy:1 Appt:1 Enc:13 FamHx:1 Img:1 MedReq:2 Proc:16 Research:1 SvcReq:1 Spec:1                        | fixture | generated, plus staging, biomarkers, report and imaging |
| GEN-BREAST-02   | 1286                   | 772001     | Larkin917, Cristen212 Larraine124    | 1972-01-27 | Malignant neoplasm of breast (disorder); Medication review due (situation); Part-time employment (finding); +1 more                      | C:4 O:17 DR:4 Enc:13 MedReq:3 Proc:17                                                                                  | fixture | generated breadth, no oncology depth                    |
| GEN-LUNG-01     | 1345                   | 772002     | Nicolas769, Austin578 Keneth579      | 1966-07-12 | Non-small cell lung cancer (disorder) (Stage IIIA); Suspected lung cancer (situation); Medication review due (situation); +3 more        | C:6 O:37 DR:19 Allergy:1 Appt:1 CarePlan:1 Enc:12 FamHx:1 Img:7 MedAdm:30 MedReq:30 Proc:30 Research:1 SvcReq:1 Spec:1 | fixture | generated, plus staging, biomarkers, report and imaging |
| GEN-LUNG-02     | 1508                   | 772003     | Halvorson124, Cherlyn665 Shavonda114 | 1978-04-13 | Non-small cell lung cancer (disorder)                                                                                                    | C:1 O:30 DR:30 Enc:13 Img:17 MedAdm:30 MedReq:30 Proc:30                                                               | fixture | generated breadth, no oncology depth                    |
| GEN-COLON-01    | 1690                   | 772004     | Hoeger474, Britt177                  | 1986-08-21 | Bleeding from anus (disorder); Protracted diarrhea (finding); Medication review due (situation); +3 more                                 | C:6 O:30 DR:15 CarePlan:2 Enc:12 MedAdm:12 MedReq:12 Proc:15                                                           | fixture | generated breadth, no oncology depth                    |
| GEN-COLON-02    | 1795                   | 772005     | Jacobs452, Casie505                  | 1957-10-16 | Recurrent rectal polyp (disorder); Anemia (disorder); Malignant neoplasm of colon (disorder); +1 more                                    | C:4 O:30 DR:16 CarePlan:2 Enc:12 MedAdm:12 MedReq:12 Proc:30                                                           | fixture | generated breadth, no oncology depth                    |

## Reading it

**identifier** is the medical record number, in system `urn:oid:1.3.6.1.4.1.99999.2.1`.
A patient may carry others; this is the one the identifier search is made with.

**fhir id** shapes differ on purpose. The hand-authored patients carry long opaque
strings, the generated ones short numbers assigned by the server the fixture pipeline
normalises through. A client must treat a logical id as an opaque string, and a rig
where every id looked alike would let one that did not get away with it.

**diagnosis** lists the conditions on file with staged ones first, which is the
closest derivable thing to the cancer without putting a marker in the data. For a
patient with nothing staged it is the first few problems in store order, so read the
handle for the intended diagnosis.

**resources** counts what is in the patient's compartment. Condition, Observation and
DiagnosticReport are always shown even at zero, because a zero is the point of some of
these patients. `[retired]` means the Patient record is marked inactive.

**origin** is `fixture` while the patient and everything of theirs came out of this
fixture set, and `seeded` once anything was written at runtime. A restart reloads the
fixtures and puts every row back to `fixture`.

**staged for** is the only hand-declared column, and it lives in `cohort-staging.toml`.
Each staging kind carries a predicate checked against the data whenever this table is
built, so a claim that stops being true is rendered as such rather than quietly kept.

## Handles

Handles are test API. They survive regeneration unchanged, so a test may hold one. They
are deliberately absent from the FHIR data: reach a patient the way a client would reach
one at a hospital, by identifier or by name and birth date, and use the `fhir id` column
when you need the logical id directly.
