This article provides a practical, in-depth guide to implementing a radiology Picture Archiving and Communication System (PACS) and integrating it with a Hospital Management Information System (SIMRS). Learn concrete steps, relevant technologies, and best practices to improve operational efficiency
In this digital era, efficient management of medical imaging data is no longer merely an option, but an urgent necessity for every healthcare facility. Hospitals and clinics often face significant challenges in managing the ever-increasing volume of radiology images, from X-ray, CT scan, MRI, to ultrasound results. Manual processes that still rely on physical film or data transfer via CD/DVD are not only time-consuming and costly, but also prone to errors, data loss, and diagnostic delays. Imagine a doctor needing quick access to a patient's imaging history to make crucial clinical decisions, but having to wait for hours because the data is stored in a separate location or difficult to access. This situation directly impacts the quality of patient care and operational efficiency. To address this problem, Picture Archiving and Communication System (PACS) becomes a vital solution.
This article will guide you comprehensively on how to set up radiology PACS and integrate it seamlessly with an existing Hospital Management Information System (SIMRS). We will discuss the basic concepts of PACS, implementation stages, technical details of integration using HL7 and FHIR standards, runnable code examples, error handling, and best practices to ensure the success of your project. This discussion is designed for Hospital IT Managers, clinic owners, operations managers, and decision-makers seeking technology solutions to improve radiology workflows and overall healthcare services.
Picture Archiving and Communication System (PACS) is a medical technology system designed to store, retrieve, distribute, and display digital medical images efficiently. PACS replaces traditional film-based systems with a comprehensive digital workflow, from image acquisition from modalities to reporting and long-term storage. The main components of PACS include: Imaging Modalities (CT, MRI, X-ray, ultrasound) that produce digital images; an Archive Server that serves as a central repository for all images and related data; a Radiologist Workstation equipped with advanced image viewer software for analysis and diagnosis; and a Clinical Viewer that allows doctors throughout the hospital to access images from various departments. The main communication standard that enables all these components to interact is DICOM (Digital Imaging and Communications in Medicine), which governs image formats, metadata, and communication protocols.
PACS implementation brings significant transformative benefits to healthcare facilities. First, improved operational efficiency. With PACS, images can be accessed instantly from anywhere and at any time, reducing patient waiting times and speeding up the diagnostic process. No more time-consuming searches for physical films or sending CDs/DVDs between departments. A study shows that PACS can reduce image retrieval time by up to 90% and radiology reporting time by up to 50%. Second, higher diagnostic accuracy. Radiologists can utilize advanced features such as image manipulation (zoom, pan, windowing), measurements, and 3D reconstruction for deeper analysis, which is not possible with traditional film. This increases confidence in making accurate diagnoses.
Third, substantial cost savings. Eliminating the use of film, processing chemicals, and physical storage of film archive warehouses can result in significant operational cost savings in the long term. For example, the cost of procuring and maintaining radiology film can reach tens of millions of rupiah per year for a medium-sized hospital. With PACS, these costs can be redirected to technology investments or other service improvements. Fourth, compliance with regulations and data security. Modern PACS is designed with strong security features, such as data encryption and role-based access control, ensuring patient data privacy in accordance with regulations such as PMK No. 82 of 2013 concerning Hospital Health Information Systems. This also facilitates easier auditing and reporting.
Finally, PACS supports better collaboration between departments. Specialist doctors from various disciplines can view the same images simultaneously, even from different locations, facilitating case discussions and multidisciplinary decision-making. This not only improves the quality of patient care but also strengthens the medical team as a whole. Thus, PACS is not merely an image storage system, but an essential foundation for a modern and integrated digital medical imaging ecosystem, capable of improving the performance of healthcare facilities holistically.
Implementing PACS and its integration with HIS requires careful planning and meticulous execution. The first stage is PACS Infrastructure Setup. This begins with the procurement of adequate server hardware, such as a Dell PowerEdge R650 with at least 128GB RAM and a 10TB RAID 6 storage configuration that can accommodate image data for the next 5 years. The selection of PACS software is also crucial; popular open-source options such as dcm4chee (version 5.x) or Orthanc (version 1.12.x) offer flexibility, while commercial solutions from vendors such as Carestream or GE Healthcare provide enterprise support. DICOM network configuration involves assigning unique AE Titles (Application Entity Titles) for each modality and PACS server, as well as setting standard DICOM communication ports (for example, port 104 for DICOM C-STORE, C-FIND, C-MOVE and port 11112 for Worklist). Ensure stable network connectivity and sufficient bandwidth for transferring large image files.
Once PACS is up, the focus shifts to Integration with HIS. This integration is key to creating a seamless workflow. HIS acts as the source of truth for patient data and examination orders. Integration middleware is often used to bridge communication between HIS and PACS. Popular choices for middleware include HAPI FHIR (version 6.8.x) for FHIR implementation or building a custom integration layer using frameworks such as Laravel 11.x (PHP) or Node.js 20 LTS. The HIS database, generally using PostgreSQL 16, will store administrative and clinical data, while PACS will store DICOM images and metadata.
The data exchange standards used in this integration are HL7 (Health Level Seven) v2.5.1 and FHIR R4. HL7 v2.5.1 is generally used for the exchange of ADT (Admission, Discharge, Transfer) messages for patient data, ORM (Order Management) for radiology examination orders, and ORU (Observation Result) for radiology report results. Meanwhile, FHIR R4 offers a more modern RESTful API-based approach for exchanging resources such as Patient, Encounter, and DiagnosticReport. The general integration workflow is as follows:
This integration ensures that patient data, orders, and diagnostic results flow automatically and accurately between the administrative and imaging systems, eliminating duplicate data entry and reducing the potential for manual errors. It is important to perform careful data mapping between the two systems and conduct extensive testing at each stage of integration.
This section will present concrete code examples to illustrate the integration between HIS and PACS using the HL7 standard, which is a common protocol in healthcare data exchange.
When a doctor in HIS creates a radiology examination order, HIS needs to send the order details to PACS so they are available in the modality's DICOM Worklist. The following is an example of PHP code that simulates sending an HL7 ORM O01 message over TCP/IP with MLLP framing. Assume you have a PACS server listening for ORM messages on port 11112.
<?php
// Function to send HL7 messages via TCP/IP with MLLP framing
function sendHl7Message($host, $port, $message) {
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if ($socket === false) {
throw new Exception("socket_create() failed: " . socket_strerror(socket_last_error()));
}
$result = socket_connect($socket, $host, $port);
if ($result === false) {
throw new Exception("socket_connect() failed: " . socket_strerror(socket_last_error($socket)));
}
// MLLP Framing: <VT> message <FS> <CR>
$mllpMessage = chr(0x0B) . $message . chr(0x1C) . chr(0x0D);
socket_write($socket, $mllpMessage, strlen($mllpMessage));
// Read ACK from PACS
$response = socket_read($socket, 2048);
socket_close($socket);
// Remove MLLP framing from the response
if (strlen($response) >= 3 && ord($response[0]) == 0x0B && ord($response[strlen($response)-2]) == 0x1C && ord($response[strlen($response)-1]) == 0x0D) {
return substr($response, 1, strlen($response) - 3);
}
return $response;
}
// Build HL7 ORM^O01 Message for CT Scan Abdomen Order
$dateTime = date("YmdHis");
$message = <<<HL7
MSH|^~\&|SIMRS_APP|RS_KAMI|PACS_SERVER|RADIOLOGI|$dateTime||ORM^O01|MSG{$dateTime}|P|2.5.1
PID|||12345678^^^SIMRS^MRN||SUJONO^BAMBANG^DR||19750510|M|||JL. MERDEKA NO. 10^^JAKARTA^DKI^10110^IDN||^PRN|||||||1234567890
PV1||I|UGD^IGD|||||||||||||||||ADM{$dateTime}
ORC|NW|ORD987654321^SIMRS|ACC123456789^PACS||IP|||||{$dateTime}|{$_SERVER['REMOTE_USER'] ?? 'SYSTEM_USER'}^dr.
OBR|1|ORD987654321^SIMRS|ACC123456789^PACS|CTABD^CT Scan Abdomen^L9999|||{$dateTime}|||||||||{$dateTime}|||||||||||F
HL7;
try {
// Replace '127.0.0.1' and 11112 with your PACS Worklist Listener IP and port
$response = sendHl7Message('127.0.0.1', 11112, $message);
echo "HL7 ORM Successfully Sent. Response: " . $response . PHP_EOL;
} catch (Exception $e) {
echo "Error sending HL7: " . $e->getMessage() . PHP_EOL;
}
?>Code Explanation 1: This PHP code defines the sendHl7Message function, which is responsible for establishing a TCP/IP connection to the PACS server, framing the HL7 message with the MLLP (Minimal Lower Layer Protocol) protocol, sending it, and waiting for an ACK reply. The HL7 ORM O01 message that is built contains the MSH (Message Header), PID (Patient Identification), PV1 (Patient Visit), ORC (Order Control), and OBR (Observation Request) segments. These segments carry information such as patient ID, name, date of birth, gender, address, visit number, order ID, accession number, and examination type (CT Scan Abdomen). The $dateTime variable ensures an accurate timestamp. If the sending is successful, the PACS is expected to reply with an ACK message indicating receipt of the order.
After the radiologist reads the images and creates a report in PACS, PACS will send the report results back to SIMRS as an HL7 ORU R01 message. SIMRS needs to have a listener ready to receive and process this message. The following is an example of a Node.js listener using the net module and assuming the use of the hl7-parser library (npm install hl7-parser).
// server.js (SIMRS HL7 Listener)
const net = require('net');
const hl7 = require('hl7-parser'); // Make sure you have installed: npm install hl7-parser
const PORT = 11113; // SIMRS HL7 listener port
const HOST = '127.0.0.1';
const server = net.createServer((socket) => {
console.log('Client connected:', socket.remoteAddress, socket.remotePort);
socket.on('data', (data) => {
// MLLP Framing: <VT> message <FS> <CR>
// VT = 0x0B, FS = 0x1C, CR = 0x0D
if (data.length < 3 || data[0] !== 0x0B || data[data.length - 2] !== 0x1C || data[data.length - 1] !== 0x0D) {
console.error('Invalid MLLP frame received.');
const nackMessage = `MSH|^~\&|SIMRS_APP|RS_KAMI|PACS_SERVER|RADIOLOGI|${new Date().toISOString().slice(0, 19).replace(/[-:]/g, '')}||ACK^R01|NACK001|P|2.5.1\rMSA|AE|MSG${new Date().toISOString().slice(0, 19).replace(/[-:]/g, '')}|Invalid MLLP frame`;
socket.write(Buffer.from(String.fromCharCode(0x0B) + nackMessage + String.fromCharCode(0x1C) + String.fromCharCode(0x0D)));
return;
}
const hl7Message = data.toString('utf8', 1, data.length - 2); // Extract the HL7 message
console.log('Receiving HL7 message:', hl7Message);
try {
const parsedMessage = hl7.parse(hl7Message);
// Extract important data from the ORU message
const patientMrn = parsedMessage.get('PID.3.1');
const accessionNumber = parsedMessage.get('OBR.3.1'); // Accession Number
const reportText = parsedMessage.get('OBX.5.1');
const reportUrlMatch = reportText ? reportText.match(/http[s]?:\/\/[^\s]+/i) : null;
const reportUrl = reportUrlMatch ? reportUrlMatch[0] : null;
console.log(`Processing ORU for MRN: ${patientMrn}, Accession Number: ${accessionNumber}, Report URL: ${reportUrl}`);
// --- SIMRS Logic: Update database, notify doctors, etc. ---
// Example: update the "diagnostic_reports" table in PostgreSQL 16
// const { Client } = require('pg');
// const client = new Client({ connectionString: 'postgresql://user:password@host:port/database' });
// await client.connect();
// await client.query('INSERT INTO diagnostic_reports (mrn, accession_number, report_text, report_url, received_at) VALUES ($1, $2, $3, $4, NOW())', [patientMrn, accessionNumber, reportText, reportUrl]);
// await client.end();
// ---------------------------------------------------------
// Send ACK back to PACS
const ackMessage = `MSH|^~\&|SIMRS_APP|RS_KAMI|PACS_SERVER|RADIOLOGI|${new Date().toISOString().slice(0, 19).replace(/[-:]/g, '')}||ACK^R01|ACK001|P|2.5.1\rMSA|AA|MSG${new Date().toISOString().slice(0, 19).replace(/[-:]/g, '')}`;
socket.write(Buffer.from(String.fromCharCode(0x0B) + ackMessage + String.fromCharCode(0x1C) + String.fromCharCode(0x0D)));
} catch (error) {
console.error('Error while parsing HL7 message:', error);
// Send NACK if there is an error
const nackMessage = `MSH|^~\&|SIMRS_APP|RS_KAMI|PACS_SERVER|RADIOLOGI|${new Date().toISOString().slice(0, 19).replace(/[-:]/g, '')}||ACK^R01|NACK001|P|2.5.1\rMSA|AE|MSG${new Date().toISOString().slice(0, 19).replace(/[-:]/g, '')}|Error processing message: ${error.message}`;
socket.write(Buffer.from(String.fromCharCode(0x0B) + nackMessage + String.fromCharCode(0x1C) + String.fromCharCode(0x0D)));
}
});
socket.on('end', () => {
console.log('Client disconnected.');
});
socket.on('error', (err) => {
console.error('Socket error:', err);
});
});
server.listen(PORT, HOST, () => {
console.log(`SIMRS HL7 Listener running at ${HOST}:${PORT}`);
console.log('Waiting for HL7 ORU messages from PACS...');
});Code Explanation 2: This Node.js code creates a TCP server that acts as an HL7 listener for SIMRS. This server listens for incoming connections from PACS on port 11113. Whenever data is received, it checks the MLLP framing, then extracts the HL7 message. With the help of the hl7-parser library, the HL7 ORU R01 message is parsed to obtain important information such as the patient's MRN (Patient Medical Record Number), Accession Number, diagnostic report text, and the URL to the image in PACS. After the data is extracted, SIMRS can perform relevant actions, such as updating the database (for example PostgreSQL 16), triggering notifications to the ordering physician, or displaying the report in the user interface. After processing, SIMRS will send an ACK (Acknowledgment) reply back to PACS to confirm receipt of the message. Error handling is also included, where a NACK (Negative Acknowledgment) will be sent if there is a problem in parsing or processing the message.
Complex system integrations such as PACS and SIMRS will never be free from potential data issues and errors. Therefore, a robust handling strategy is crucial. Let's look at a realistic payload example and how to handle potential errors.
The following is an example of an HL7 ORU R01 message sent by PACS to SIMRS, containing the results of an Abdominal CT Scan diagnostic report. This message includes patient, order, and observation result information, including a URL to access the image in the PACS viewer.
MSH|^~\&|PACS_SERVER|RADIOLOGI|SIMRS_APP|RS_KAMI|20231027100000||ORU^R01|MSG00001|P|2.5.1
PID|||12345678^^^SIMRS^MRN||DOE^JOHN^A||19800101|M|||123 Main St^^Anytown^NY^12345^US||^PRN|||||||1234567890
PV1||I|WARD^BED101|||||||||||||||||ADM20231026
ORC|RE|ORD987654321^SIMRS|ACC123456789^PACS||CM|||||20231027100000|Nugroho Setiawan^dr.
OBR|1|ORD987654321^SIMRS|ACC123456789^PACS|CTABD^CT Scan Abdomen^L9999|||20231027103000|||||||20231027110000|||||||||||F
OBX|1|TX|CTABD^CT Scan Abdomen^L9999|1|Hasil pemeriksaan CT Scan abdomen menunjukkan tidak ada kelainan signifikan. Hepar, lien, pankreas, dan ginjal dalam batas normal. Tidak ditemukan massa atau cairan bebas. Kesimpulan: Tidak ada kelainan. Lihat gambar di: http://pacs.rskita.com/viewer?studyId=1234567890||||||FOne common error that can occur is an invalid or malformed HL7 message. For example, PACS might send an ORM message to SIMRS, but a segment is missing or the format is wrong. SIMRS will respond with a NACK (Negative Acknowledgment) that contains an error code.
ACK|AR|200^Segment ID missing in ORM messageThis is the NACK reply from SIMRS to PACS, indicating that the ORM message received from PACS is invalid because a segment ID is missing. `AR` (Application Reject) indicates that the receiving application cannot process the message due to a content issue. The code `200` and the text `Segment ID missing in ORM message` provide specific details about the error.
By implementing these strategies, hospitals can build more robust integrations, reduce downtime, and ensure the smooth flow of diagnostic data workflows.
The implementation of a Picture Archiving and Communication System (PACS) and its seamless integration with a Hospital Management Information System (SIMRS) is a strategic investment that not only improves operational efficiency but also significantly enhances the quality of diagnostic services and patient data security. By following this guide, from understanding basic concepts, implementation stages, use of HL7/FHIR standards, concrete code examples, to the application of best practices and effective error handling, healthcare facilities can realize a comprehensive digital transformation in the radiology department. The success of this integration will result in faster workflows, more accurate diagnoses, reduced operational costs, and better compliance with regulations. If your hospital or clinic needs further consultation or assistance with PACS implementation and seamless SIMRS integration, our team at Nugroho Setiawan is ready to help. With deep experience in SIMRS, BPJS/SatuSehat/FHIR integration, and system development, we can design the right solution for your specific needs. Contact us today for an initial discussion and realize the digital transformation of your radiology services.
Related solutions by PT Pilar Inovasi Informatika (Pilar Inovasi IT products): SIMRS (Hospital Information System) Clinic Management System SatuSehat Integration. Need a free consultation?
Belum ada komentar. Jadilah yang pertama!