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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ All notable changes to Health Intersections FHIRsmith will be documented in this
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.14.2] -


## [0.14.1] - 2026-09-29

Expand Down
14 changes: 9 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fhirsmith",
"version": "0.14.1",
"version": "0.14.2-snapshot",
"txVersion": "1.9.5-SNAPSHOT",
"description": "A Node.js server that provides a collection of tools to serve the FHIR ecosystem",
"main": "server.js",
Expand Down
29 changes: 24 additions & 5 deletions packages/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@
pckLog.info('Starting initial package crawler...');

// Run crawler in background (non-blocking)
setImmediate(async () => {

Check warning on line 980 in packages/packages.js

View workflow job for this annotation

GitHub Actions / Code Quality

Promise returned in function argument where a void return was expected
try {
await this.runCrawler();
pckLog.info('Initial package crawler completed successfully');
Expand Down Expand Up @@ -2867,13 +2867,14 @@

if (logData) {
if (logData.startTime) {
content += `<tr><td>Start Time:</td><td>${new Date(logData.startTime).toLocaleString()}</td></tr>`;
}
if (logData.endTime) {
content += `<tr><td>End Time:</td><td>${new Date(logData.endTime).toLocaleString()}</td></tr>`;
// relative, because the server's local clock means nothing to the reader
content += `<tr><td>Started:</td><td title="${new Date(logData.startTime).toISOString()}">${this.formatTimeAgo(logData.startTime)}</td></tr>`;
}
if (logData.runTime) {
content += `<tr><td>Duration:</td><td>${logData.runTime}</td></tr>`;
const ms = parseInt(logData.runTime, 10);
if (!isNaN(ms)) {
content += `<tr><td>Duration:</td><td>${(ms / 1000).toFixed(1)} seconds</td></tr>`;
}
}
if (logData.totalBytes) {
content += `<tr><td>Total Bytes:</td><td>${logData.totalBytes.toLocaleString()}</td></tr>`;
Expand Down Expand Up @@ -2909,6 +2910,24 @@
return content;
}

formatTimeAgo(time) {
const secs = Math.max(0, Math.round((Date.now() - new Date(time).getTime()) / 1000));
const plural = (n, unit) => `${n} ${unit}${n === 1 ? '' : 's'} ago`;
if (secs < 60) {
return plural(secs, 'second');
}
const mins = Math.floor(secs / 60);
if (mins < 60) {
return plural(mins, 'minute');
}
const hours = Math.floor(mins / 60);
if (hours < 24) {
const rem = mins % 60;
return rem ? `${hours} hour${hours === 1 ? '' : 's'} ${rem} minute${rem === 1 ? '' : 's'} ago` : plural(hours, 'hour');
}
return plural(Math.floor(hours / 24), 'day');
}

// Add this new method to format the crawler log as readable text
formatCrawlerLog(logData) {
let output = '';
Expand Down
Loading