fhirsmith 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -387,7 +387,7 @@ class TranslateWorker extends TerminologyWorker {
387
387
  }
388
388
  if (!explicit) {
389
389
  matchParts.push({
390
- name: 'sourceMap',
390
+ name: 'originMap',
391
391
  valueCanonical: cm.vurl
392
392
  });
393
393
  }
@@ -476,7 +476,7 @@ class TranslateWorker extends TerminologyWorker {
476
476
  }
477
477
  if (!explicit) {
478
478
  matchParts.push({
479
- name: 'sourceMap',
479
+ name: 'originMap',
480
480
  valueCanonical: cm.vurl
481
481
  });
482
482
  }
@@ -538,7 +538,7 @@ class TranslateWorker extends TerminologyWorker {
538
538
  }
539
539
  if (!explicit) {
540
540
  matchParts.push({
541
- name: 'sourceMap',
541
+ name: 'originMap',
542
542
  valueCanonical: cm.vurl
543
543
  });
544
544
  }
@@ -90,7 +90,9 @@
90
90
  <p>
91
91
  <a href="http://www.hl7.org/fhir" style="color: gold" title="Fast Healthcare Interoperability Resources - Home Page"><img border="0" src="/icon-fhir-16.png" style="vertical-align: text-bottom"/> <b>FHIR</b></a> &copy; HL7.org 2011+. &nbsp;|&nbsp;
92
92
  <a href="https://github.com/HealthIntersections/FHIRsmith/blob/main/README.md" style="color: gold"><img border="0" src="/FHIRsmith16.png" style="vertical-align: text-bottom"/> FHIRsmith</a> [%ver%] &copy; HealthIntersections.com.au 2023+ &nbsp;|&nbsp;
93
- XIG built as of [%download-date%] &nbsp;|&nbsp; [%total-resources%] resources in [%total-packages%] packages &nbsp;|&nbsp; ([%ms%] ms)
93
+ XIG built as of [%download-date%] &nbsp;|&nbsp; [%total-resources%] resources in [%total-packages%] packages &nbsp;|
94
+ &nbsp; ([%ms%] ms)
95
+ [%sponsorMessage%]
94
96
  </p>
95
97
  </div> <!-- /inner-wrapper -->
96
98
  </div> <!-- /container -->
@@ -1,205 +0,0 @@
1
- /**
2
- * Custom Winston transport for streaming logs over a TCP socket
3
- * This allows viewing logs remotely via telnet or a custom client
4
- */
5
- const winston = require('winston');
6
- const net = require('net');
7
- const Transport = winston.Transport;
8
-
9
- /**
10
- * Winston transport that streams logs to connected TCP clients
11
- * @extends {winston.Transport}
12
- */
13
- class SocketTransport extends Transport {
14
- /**
15
- * Create a new socket transport
16
- * @param {Object} options - Transport options
17
- * @param {string} [options.host='127.0.0.1'] - Host to bind to
18
- * @param {number} [options.port=9300] - Port to listen on
19
- * @param {string} [options.level='info'] - Minimum log level to stream
20
- * @param {Function} [options.format] - Custom formatter function (msg, level, meta) => string
21
- */
22
- constructor(options = {}) {
23
- super(options);
24
- this.name = 'socket';
25
- this.level = options.level || 'info';
26
- this.clients = new Set();
27
- this.format = options.format || this._defaultFormat;
28
-
29
- // Create TCP server
30
- this.server = net.createServer((socket) => {
31
- console.log(`Client connected to log stream from ${socket.remoteAddress}`);
32
-
33
- // Send welcome message
34
- socket.write(`=== Connected to log stream (${new Date().toISOString()}) ===\n`);
35
- socket.write(`=== Log level: ${this.level} ===\n\n`);
36
-
37
- // Add to clients set
38
- this.clients.add(socket);
39
-
40
- socket.on('close', () => {
41
- console.log(`Client disconnected from log stream: ${socket.remoteAddress}`);
42
- this.clients.delete(socket);
43
- });
44
-
45
- socket.on('error', (err) => {
46
- console.error(`Socket error: ${err.message}`);
47
- this.clients.delete(socket);
48
- });
49
-
50
- // Support for simple commands
51
- socket.on('data', (data) => {
52
- const command = data.toString().trim().toLowerCase();
53
-
54
- if (command === 'help') {
55
- socket.write(this._getHelpText());
56
- } else if (command === 'stats') {
57
- socket.write(this._getStatsText());
58
- } else if (command === 'quit' || command === 'exit') {
59
- socket.end('=== Disconnected ===\n');
60
- } else if (command.startsWith('level ')) {
61
- const newLevel = command.split(' ')[1];
62
- if (['error', 'warn', 'info', 'debug', 'verbose', 'silly'].includes(newLevel)) {
63
- this.level = newLevel;
64
- socket.write(`=== Log level changed to ${newLevel} ===\n`);
65
- } else {
66
- socket.write(`=== Invalid log level: ${newLevel} ===\n`);
67
- }
68
- }
69
- });
70
- });
71
-
72
- // Start listening
73
- const port = options.port || 9300;
74
- const host = options.host || '127.0.0.1';
75
-
76
- this.server.listen(port, host, () => {
77
- console.log(`Log socket server running on ${host}:${port}`);
78
- });
79
-
80
- this.server.on('error', (err) => {
81
- console.error(`Socket transport error: ${err.message}`);
82
- });
83
- }
84
-
85
- /**
86
- * Winston transport method called for each log
87
- * @param {Object} info - Log information
88
- * @param {Function} callback - Callback function
89
- */
90
- log(info, callback) {
91
- setImmediate(() => {
92
- this.emit('logged', info);
93
- });
94
-
95
- // Skip if no clients connected
96
- if (this.clients.size === 0) {
97
- callback();
98
- return;
99
- }
100
-
101
- // Format the log entry
102
- const logEntry = this.format(info);
103
-
104
- // Send to all connected clients
105
- const deadClients = [];
106
- for (const client of this.clients) {
107
- try {
108
- client.write(logEntry);
109
- } catch (err) {
110
- deadClients.push(client);
111
- }
112
- }
113
-
114
- // Remove dead connections
115
- deadClients.forEach(client => this.clients.delete(client));
116
-
117
- callback();
118
- }
119
-
120
- /**
121
- * Default log formatter
122
- * @param {Object} info - Log information
123
- * @returns {string} Formatted log entry
124
- * @private
125
- */
126
- _defaultFormat(info) {
127
- const timestamp = info.timestamp || new Date().toISOString();
128
- const level = info.level.toUpperCase().padEnd(7);
129
- const message = info.message || '';
130
-
131
- // Extract metadata excluding standard fields
132
- const meta = { ...info };
133
- delete meta.timestamp;
134
- delete meta.level;
135
- delete meta.message;
136
-
137
- const metaStr = Object.keys(meta).length > 0
138
- ? ` ${JSON.stringify(meta)}`
139
- : '';
140
-
141
- return `${timestamp} [${level}] ${message}${metaStr}\n`;
142
- }
143
-
144
- /**
145
- * Get help text for connected clients
146
- * @returns {string} Help text
147
- * @private
148
- */
149
- _getHelpText() {
150
- return `
151
- === Log Viewer Commands ===
152
- help - Show this help
153
- stats - Show connection statistics
154
- level <level> - Change log level (error, warn, info, debug, verbose, silly)
155
- quit/exit - Disconnect
156
-
157
- === Log Format ===
158
- TIMESTAMP [LEVEL] MESSAGE {metadata}
159
-
160
- === Examples ===
161
- level debug - Show debug and higher priority logs
162
- level error - Show only error logs
163
-
164
- `.trim() + '\n\n';
165
- }
166
-
167
- /**
168
- * Get statistics text for connected clients
169
- * @returns {string} Statistics text
170
- * @private
171
- */
172
- _getStatsText() {
173
- return `
174
- === Log Statistics ===
175
- Connected clients: ${this.clients.size}
176
- Current log level: ${this.level}
177
- Server started: ${this.server.startTime || 'unknown'}
178
- Current time: ${new Date().toISOString()}
179
-
180
- `.trim() + '\n\n';
181
- }
182
-
183
- /**
184
- * Close the socket server
185
- * @param {Function} [callback] - Callback function
186
- */
187
- close(callback) {
188
- // Notify all clients
189
- for (const client of this.clients) {
190
- try {
191
- client.end('=== Log server shutting down ===\n');
192
- } catch (err) {
193
- // Ignore errors during shutdown
194
- }
195
- }
196
-
197
- // Close server
198
- this.server.close(callback);
199
- }
200
- }
201
-
202
- // Register the transport with Winston
203
- winston.transports.Socket = SocketTransport;
204
-
205
- module.exports = SocketTransport;