Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/web/src/records.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export function humanName(r) {
}

const IMAGING = /imaging|radiology|\brad\b|x-?ray|\bct\b|mri|ultrasound|mammo|dicom|18748-4/;
const SUMMARY = /after visit|avs|discharge|visit summary|summary of care|continuity of care|ccd|clinical summary|18842-5|34133-9|11506-3/;
const SUMMARY = /after visit|avs|discharge|visit summary|summary of care|continuity of care|ccd|clinical summary|18842-5|34133-9/;

/** Which bucket a resource goes in, a one-line title, and its date. */
export function classify(r) {
Expand Down Expand Up @@ -539,7 +539,7 @@ const SEARCHES = [
['Procedure'],
['ImagingStudy'],
['Media'],
['CarePlan'],
['CarePlan', ['38717003', '734163000', 'assess-plan']],
['Goal'],
['Coverage'],
['ServiceRequest'],
Expand Down
2 changes: 2 additions & 0 deletions test/records.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ describe('records units', () => {
const avs = { resourceType: 'DocumentReference', id: '1', type: { text: 'After Visit Summary' }, date: '2026-01-02T10:00:00Z' };
expect(records.classify(avs)).toEqual({ category: 'summaries', title: 'After Visit Summary', recorded_on: '2026-01-02' });
expect(records.classify({ resourceType: 'DocumentReference', id: '2', type: { text: 'Progress Note' } }).category).toBe('notes');
// Epic's progress notes carry LOINC 11506-3; they are notes, not after-visit summaries.
expect(records.classify({ resourceType: 'DocumentReference', id: '2b', type: { coding: [{ system: 'http://loinc.org', code: '11506-3', display: 'Progress note' }] } }).category).toBe('notes');
expect(records.classify({ resourceType: 'DiagnosticReport', id: '3', category: [{ coding: [{ code: 'RAD' }] }], code: { text: 'Chest X-ray' } }).category).toBe('imaging');
expect(records.classify({ resourceType: 'Observation', id: '4', category: [{ coding: [{ code: 'laboratory' }] }], code: { text: 'A1c' } }).category).toBe('labs');
expect(records.classify({ resourceType: 'Observation', id: '5', category: [{ coding: [{ code: 'vital-signs' }] }], code: { text: 'BP' } }).category).toBe('vitals');
Expand Down
Loading