RIS system on a HISThe exchange of information between a hospital information system and RIS Radiology Information System is achieved through the use of sockets, where you first create the data structure that will interpret the RIS system and then make the connection with the concept of customer server.

This document is divided into two (2) parts, the first part explains the preparation of the data and the second shows an example of handling sockets.

The data preparation of a RIS System

This document describes the steps followed to develop the interface through HL7 standards.

The Hospital has a system in place that allows the recording of their patients in an application, which works on a database noncommercial RIS system of an American company.

RIS System requirements.

The RIS system needs to receive a string with the following format, for better understanding we will divide into 4 registers, these are:

  • First record. Your content is:
    • MSH|^~\&|HIS|HNOMBREHOSPITAL|RIS|HSAHO|20110114133738||ADT^A01|1|P|2.3.1
    • Wherein:
      • MSH is the identification of the record.

Note. The pipes | are field separators

      • Field 1. ^~\& special characters.
      • Field 2. HIS the application identifier.
      • Field 3. HNEURO emitting source.
      • Field 4. RIS receiving source.
      • Field 5. HSAHO emitting source / server name
      • Field 6. 20110221113123 Date and time of the system.
      • Field 7 empty.
      • Field 8. ADT^A01 message type and event code.
      • Field 9. 1 message sequence number.
      • Field 10. P ID as processing P as production.
      • Field 11. 2.3.1 HL7 version number.
  • Second register.
    • Its content is EVN||20110114133738
    • Wherein:
      • EVN is the identification of the second record.
      • Field 1 empty.
      • Field 2. 20110114133738 the system date format YYYYMMDDHHMMSS.
  • Third register.
    • Its content is:
      • PID which is the registry identification.
      • Fields 1 y 2 are empty.
      • Field 3. E133736^^^HNOMBREHOSPITAL is the identification of the patient plus the assigning authority.
      • Field 4 is empty.
      • Field 5. Martinez Juarez^Ernesto is the last name, mother's maiden name and names separated by ^.
      • Field 6 is empty.
      • Field 7. 19510909 patient's birth date format AAAAMMDD.
      • Field 8. It is the patient's sex, M male, F female. y U unknown.
      • Field 9. 2 is the socio-economic level.
      • Field 10 is the note that the medical records.
      • Field 11. Av. Ejercito Nacional No. 547, Col. Irrigacion^Miguel Hidalgo^Ciudad de Mexico^Disitrito Federal^04620^Mexico is the Patient address composed of:
        • Address (.Av. Ejercito Nacional No. 547, Col. Irrigacion)
        • Commune (Miguel Hidalgo).
        • City (Ciudad de Mexico).
        • Region code (Distrito Federal).
        • Zip Code (04620)
        • Country (Mexico).
      • Field 12 is empty.
      • Field 13. Home Phone ^^^^^^5512345678.
      • Field 14. Email and cellphone ^^^This email address is being protected from spambots. You need JavaScript enabled to view it.^^^0445512345678.
      • Field 15 is empty.
      • Field 16. Marital status (attached to the catalog in force).
      • Fields 17 y 18 are empty.
      • Field 19. CURP and RFC MAJE5I0909MDFASDFE^MAJE510909PES.
  • Fourth register.
    • Its content is PV1||O|||||||||||||||||14012011133738
    • Wherein:
      • PV1 is the registration ID.
      • Field 1. is empty.
      • Field 2. Origin of patient:
        • P hospitalization.
        • R intensive.
        • E emergency room
        • I outpatient.
        • O ambulatory.
        • S without registration.
      • Fields from 3 to 18 are empty.
      • Field 19. Number of visits 14012011133738.

This information will be sent to the IP address and port defined by the supplier where resides RIS and will receive an answer like this one:

  • MSH|^~\&|RIS|HNEURO|HIS|HSAHO|||ACK^|1|P|2.3.1  MSA|AA|1|OK 

SiHos System requirements

The application features a screen containing the following fields:

RIS System

From this information and based on the structure of the third register to be generated, the field contents would be:

  • PID which is the registry identification.
  • Fields 1 y 2 are empty.
  • Field 3. 132055^^^HNOMBREHOSPITAL is the identification of the patient plus the assigning authority.
  • Field 4 are empty.
  • Field 5. Escobar Torres^Adrian is the last name concatenated with the mother's maiden name, THE SYMBOL ^ and names.
  • Field 6 is empty.
  • Field 7. 19750204 patient's birth date format AAAAMMDD.
  • Field 8. M male.
  • Field 9. left empty, it is socioeconomic level.
  • Field 10 contain the reason for the search, in this instance will be empty.
  • Field 12 is empty.
  • Field 13. Home phone is empty.
  • Field 14. Email y cellphone are empty
  • Field 15 is empty.
  • Field 16. Marital status C for married (a), D for divorced (a), S for single (a), V for widower (a), U for cohabitation y P for separate (a).
  • Fields 17 y 18 are empty.
  • Field 19. CURP and RFC  ^EOTA750204.

Conceptual design development.

Diagram RIS System

SIHOS. Information system is currently operating in the Institute and which are recorded patient data, especially in the PATIENT table.

DATA VIEW. It is a Java application and postgresql database version 8.2 using a Data View to extract socioeconomic data from each SiHos patient and generates the two tables in a local database called interfacehl7, the first table called tbdatos where patient leaves data attached to the HL7 standard provided by RIS team and a second table called results where answers sended by the RIS are saved, and a text file called rcvdata.hl7 that must be placed in the c: \ interface.

INTERFACE RIS. It is the program that extracts data from the tbdatos table and from the text file rcvdata.hl7 and sends it to the IP address and port appointed by RIS staff and waits for the response (ack) of RIS, which is stored in the results table.

RIS. Is the information system that manages patient data to be served in Imaging.

Steps to create the interface

El Data View.

    1. It generates a parameter file that contains:
      1. Sending application  value HIS
      2. Sending facility value HNOMBREHOSPITAL
      3. Receiving application value RIS
      4. Receiving facility / server name value HSAHO
      5. Country value México

The values can be modified and can not be empty.

  1. It generates a screen where you enter the file number of patients to be treated in imaging.
  2. The tables and fields for information are:
    • Table Patient, fields:
      • PAC_ID contains the patient key.
      • PAC_NOM contains the name.
      • PAC_APE_PAT contains the last name.
      • PAC_APE_MAT contains the maternal surname.
      • PAC_FEC_NAC contain birthdate.
      • PAC_SEXO contains the key gender.
      • PAC_RFC contains the RFC.
      • PAC_CURP contains the CURP.
      • PAC_TELN1 contains the phone number.
      • PAC_TELN2 contains cell phone.
      • PAC_EDO_CIVIL contains key status.
      • PAC_MOT_CONSULTA contains the doctor's note who attended the patient.
      • EDO_CVE contains the key to the state, must obtain the description of the entity from this data.
      • DEMU_CVE municipality contains the key and the key of the entity gets the name of the municipality.
      • LOC_CVE contains the key to the city, with it, the municipality and the entity gets the name of the municipality.
      • PAC_TIPOPS contains the patient type key.
    • Table state, fields:
      • edo_cve is the key.
      • edo_nom contains the name of the federal entity.
    • Table of the village, fields:
      • edo_cve is the key.
      • demu_cve is the key.
      • demu_nom contains the description of the municipality or delegation.
    • Table locality, fields:
      • edo_cve is the key.
      • demu_cve is the key.
      • loc_cve is the key.
      • loc_nom contains the name of the town. 


For the record PID:

  1. All text data such as address, patient name, notes must be uppercase, only letters and Ñ should be replaced by Ns.
  2. The paternal and maternal surnames should be concatenated to united and separated by a space.
  3. For patients without Docket No., should be captured in the SiHos system, identification as S followed by a sequential number starting at 1, it should not be repeated, an example would be S000001 and PAC_TIPOPS field should capture a S.
  4. The socioeconomic level is empty.
  5. If a particular telephone number field does not exist remains empty.
  6. If the patient has two surnames and names the format would be AP. LAST_NAME AP MOTHER'S_MAIDEN_NAME^NAMES.
  7. If no date of birth leave the field empty.
  8. If some data is missing in the patient's home address are left empty ^.
  9. If there is no mail the format is |^^^^^^no. celular|.
  10. If there is no Cellphone, but the email exist, the format is |^^^mail|.
  11. If there are no mail and the phone number field is empty.
  12. If CURP doesn't exist, and RFC exist, the format is |^RFC|.
  13. If RFC doesn't exist, and CURP exist, the format is |CURP|.

For the record PVI:

  1. Place the server date, format YYYYMMDDHHMMSS.

The graphical interface with the RIS


The second part is a program that uses the concept of socket to send and receive data between the two applicationstheir development is in Python. The transmit data is taken from rcvdata.hl7 and the RIS response is stored in the results table

Technical data of the components.

The Data View is developed in GeneXus version 8.0, upgrade 9.0 and need for operation:

  • Database postgresql versión 8.2.
  • Java 1_4_2_08
  • Apache tomcat 5.5

The RIS interface is developed with Python and the requires the installation of setup_RISv11.5.exe which is integrated in the documentation CD.

The IP address and access credentials are:

  • SIHOS:
    • Credentials for the database are :
      • USER administrador
      • PASSWORD sistemas
    • Las claves Credentials for postgres are:
      • USER postgres
      • PASSWORD sdah05
    • Las claves The credentials to register another server via pgadmin are:
      • NAME saho
      • Ip
      • USER postgres
      • PASSWORD sdah05
  • Data View
    • Database credentials are:
      • USER postgres
      • PASSWORD postgres
      • Localhost
      • Port 5432
  • RIS
    • IP
    • Port 5003


  • IP addresses, ports and passwords are fictitious data.
  • The format presented may change depending on the brand and features RIS team.

 We invite you to read the second part, Sockets: Communication protocols TCP and UDP.

comments powered by Disqus