EPJ System DEMO
Eksempel: Ekstern applikasjon med innebygd HL7 vitals-widget
Vitale verdier
Widgeten nedenfor viser sanntidsdata fra pasientmonitor via HL7. I produksjon lastes denne fra en ekstern PHP-applikasjon.
Hente verdier fra widgeten (JavaScript)
// Hent alle verdier som objekt
const vitals = widget.getVitals();
// Returnerer:
// {
// heartRate: 72, // Puls (BPM)
// spO2: 98, // Oksygenmetning (%)
// respirationRate: 18, // Respirasjonsfrekvens (RPM)
// temperature: 36.5, // Temperatur (°C)
// systolicBP: 120, // Systolisk blodtrykk (mmHg)
// diastolicBP: 80 // Diastolisk blodtrykk (mmHg)
// }
// Verdier som ikke er mottatt enda er null.
// Eksempel: Lagre til backend via POST
fetch('/api/save-vitals', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
patientId: 'c89d2555-da31-494f-ab93-52e4f8063c5d',
timestamp: new Date().toISOString(),
vitals: widget.getVitals()
})
});Integrasjonskode for PHP (med autentisering)
<?php
// Backend: Hent token fra HL7 gateway
$widgetHost = 'https://monitor.demo.spirare.com';
$apiKey = getenv('WIDGET_API_KEY');
// Alternativ 1: Dynamisk JWT-token (backend-til-backend)
$ch = curl_init("$widgetHost/api/widget/token");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
"Authorization: Bearer $apiKey"
],
CURLOPT_POSTFIELDS => json_encode([
'tenant' => 'min-klinikk',
'scope' => ['read', 'stream']
]),
CURLOPT_RETURNTRANSFER => true
]);
$response = json_decode(curl_exec($ch));
$token = $response->token;
// Alternativ 2: Statisk demo-token
// $token = 'demo-secret-token-2024';
?>
<script src="<?= $widgetHost ?>/api/widget/embed"></script>
<div id="vitals-widget"></div>
<script>
const widget = new HL7VitalsWidget('#vitals-widget', {
baseUrl: '<?= $widgetHost ?>',
token: '<?= $token ?>',
onAuthError: (res) => console.error('Auth failed:', res.status)
});
</script>Intended use: This software is a communication middleware and LIMS integration component intended for use by healthcare IT administrators and biomedical engineers. It receives, parses, displays, and forwards HL7 v2.x data between medical devices and information systems without interpreting, analysing, or altering clinical data. It is not intended for clinical decision-making, patient monitoring, or direct patient care. It does not generate alarms or clinical recommendations. Not a medical device under EU MDR 2017/745. See REGULATORY_CLASSIFICATION.md for the full determination.