SOURCE / PINNED RELEASE
Made of little things.
Body Journal
- Release
- e8049f8da4e2…
- Author-recorded commit
- 61c04bf0e8aa…
- License
- LICENSE
- Author’s source reference
- nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-6c4554844c7
Archive hash verified: 4369d778da046a8b…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
import { makeConcern, type Concern, type Profile } from './case.js';
import type { ConcernGroup } from './concern-groups.js';
import { draftString } from './case-record.js';
import { parseSession, type SessionRecord } from './session-record.js';
export interface CaseExample { id: string; title: string; description: string; learning: string; profile: Partial<Profile>; observations: (Partial<Concern> & { location: string })[]; groups: ConcernGroup[] }
export const caseExamples: CaseExample[] = [
{
id: 'running', title: 'Knee discomfort after a change in activity',
description: 'Two observations, a timeline, activity triggers, daily impact and an uncertain connection.',
learning: 'Describe what you noticed before naming a cause. Record what makes it better or worse, and what remains uncertain.',
profile: { age: '34', sex: 'Female', height: 168, weight: 65, heightConfirmed: true, weightConfirmed: true, conditions: 'Sprained the same ankle five years ago; recovered. No knee diagnosis that I know of.', medications: 'No regular medicines or supplements. I have not tried a medicine for these symptoms.', allergies: 'No known medication allergies.', smoking: 'Never smoked', pregnancy: 'No', recentChanges: 'Increased from two short runs to four runs per week about three weeks ago. No fall or sudden injury that I remember.' },
observations: [
{ location: 'Left knee · front and outer edge', severity: 4, onset: '1–2 weeks ago', timingText: 'Started about ten days before I filled this out. Usually begins after 15–20 minutes of running and settles over the next hour.', chronic: 'no', onsetSpeed: 'Gradual', pattern: 'Comes and goes', description: 'A dull ache around the front and outer side of my left knee. It is sharper going down stairs. I have not noticed visible swelling or locking. I can walk, but have shortened my runs.', triggers: ['Moving', 'After exercise'], impact: 'Taking stairs slowly and missing two runs this week. Sleep is unchanged.', relief: 'Resting from running has helped somewhat. I have not tried other treatment.', pose: 'jogging' },
{ location: 'Left calf · tight sensation', type: 'Other', onset: '1–2 weeks ago', timingText: 'Noticed after the same longer runs. Lasts around half an hour, but I have not timed it carefully.', chronic: 'no', onsetSpeed: 'Gradual', pattern: 'Comes and goes', description: 'Feels tight rather than painful. I have not measured either calf. I am not sure if I changed how I run because of the knee.', triggers: ['After exercise'], impact: 'Makes me stop and rest during runs.', relief: 'Usually eases with rest.', pose: 'standing' },
],
groups: [{ id: 'g-example-running', name: 'Noticed after longer runs', explanation: 'These started after I increased running. I suspect they may be related, but I do not know.', concernIds: [1, 2] }],
},
{
id: 'skin', title: 'Recurring hand irritation and disturbed sleep',
description: 'Skin wording, exposure history, a long-term pattern and a general symptom.',
learning: 'Describe appearance, sensation and exposures separately. A photo caption should identify the area and date without claiming a diagnosis.',
profile: { age: '42', sex: 'Male', height: 178, weight: 79, heightConfirmed: true, weightConfirmed: true, conditions: 'Similar hand irritation on and off in past winters. Never assessed for it.', medications: 'No regular medication. Occasionally use an unscented hand cream.', allergies: 'No known drug allergies; I do not know whether any cleaning product affects my skin.', smoking: 'Previously smoked', pregnancy: 'Not applicable', recentChanges: 'Started using a different hand soap at work two weeks ago. Wash my hands frequently during work.' },
observations: [
{ location: 'Right hand · back and spaces between fingers', type: 'Skin change', onset: 'Over 3 months ago', timingText: 'Intermittent patches for about two years. Current episode began roughly two weeks ago. Itching is more noticeable in the evening.', chronic: 'yes', onsetSpeed: 'Gradual', pattern: 'Comes and goes', description: 'Dry-looking rough patches that itch and sometimes sting after washing. A few small cracks. I do not know the cause. The left hand has a smaller similar area that I have not mapped yet.', triggers: ['At night'], impact: 'Washing and some work tasks are uncomfortable. Occasionally wakes me up.', relief: 'Hand cream helps the tight feeling briefly, but the patches return.', pose: 'standing' },
{ location: 'Sleep changes', localized: false, type: 'Other', onset: '1–2 weeks ago', timingText: 'Woken on three nights this week, once or twice each night. Previously slept through most nights.', chronic: 'no', pattern: 'Comes and goes', description: 'I wake feeling itchy and then struggle to get back to sleep. I am unsure whether itching wakes me or I notice it after waking.', triggers: ['At night'], impact: 'Feel less rested at work the next morning.', relief: 'No changes or treatments tried.' },
],
groups: [{ id: 'g-example-skin', name: 'Itching and interrupted sleep', explanation: 'I notice both at night; I cannot be sure which happens first.', concernIds: [1, 2] }],
},
{
id: 'longstanding', title: 'Symptoms described as “always” and “for decades”',
description: 'Free-text timing, chronic symptoms with recent change, and independent observations.',
learning: 'A long history and a new change can coexist. Record both. “Chronic” does not mean constant, and not every symptom needs to belong to a group.',
profile: { age: '58', sex: 'Female', height: 164, weight: 72, heightConfirmed: true, weightConfirmed: true, conditions: 'Occasional lower-back discomfort for many years. No cause confirmed to me. I do not have earlier reports available.', medications: 'No regular medication. I cannot remember the name of an occasional pain tablet used in the past; not currently taking it.', allergies: 'Not sure; I would need to check my records.', smoking: 'Never smoked', pregnancy: 'Not applicable', recentChanges: 'Started a desk-based role six weeks ago and sit for longer stretches. No recent injury recalled.' },
observations: [
{ location: 'Lower back · central', severity: 5, onset: 'Over 3 months ago', timingText: 'For decades, roughly since my thirties. Comes and goes. More frequent during the last six weeks; now on most workdays. I cannot give an exact original start date.', chronic: 'yes', onsetSpeed: 'Not sure', pattern: 'Comes and goes', description: 'An ache across the lower back after sitting a long time. Does not feel the same every day. I have not noticed pain traveling into a leg.', triggers: ['At rest'], impact: 'Need to stand up during desk work; avoid longer car trips on bad days.', relief: 'Changing position and a short walk sometimes ease it. No current treatment.', pose: 'sitting' },
{ location: 'Cold-feeling hands', type: 'Other', localized: false, timingText: 'Always / as long as I can remember, including childhood. Mainly in cold weather, not literally every moment. No recent change.', chronic: 'yes', pattern: 'Comes and goes', description: 'Both hands feel cold sooner than other people seem to notice. I have not recorded temperature or photographed any color change. I do not think this is connected to my back.', impact: 'Wear gloves even when others do not. Does not interrupt work.', relief: 'Warmer surroundings help.' },
{ location: 'Fatigue', type: 'Other', localized: false, onset: 'Over a month ago', timingText: 'For the past six weeks, mostly late afternoon. New compared with my usual energy.', chronic: 'unsure', onsetSpeed: 'Gradual', pattern: 'Comes and goes', description: 'Less energy by the end of work. Sleeping about six hours on work nights, but I do not know whether this explains it.', impact: 'Have skipped some evening walks.', relief: 'A quiet evening helps; no other treatment tried.' },
],
groups: [{ id: 'g-example-work', name: 'Changes since the new job', explanation: 'The more frequent back symptoms and new tiredness both appeared around the job change. This is just my impression.', concernIds: [1, 3] }],
},
];
export function exampleSession(id: string): SessionRecord {
const example = caseExamples.find(e => e.id === id); if (!example) throw new Error('Unknown example.');
// Build fresh objects so editing an example never changes the next template load.
const p: Profile = { age: '', sex: '', anatomy: 'auto', height: 172, weight: 70, heightConfirmed: false, weightConfirmed: false, conditions: '', medications: '', allergies: '', smoking: '', pregnancy: '', recentChanges: '', ...example.profile };
const concerns = example.observations.map((fields, index) => Object.assign(makeConcern(index + 1, fields.location, fields.pose || 'standing', fields.localized ?? true), structuredClone(fields)));
const record = parseSession(draftString(p, concerns, structuredClone(example.groups)));
record.exampleSource = example.title;
record.view.selectedId = 1; record.view.expandedConcernId = 1; record.view.panel = 'concerns';
return record;
}
