How can I import HL7 to get blood results and analyze it for a patient report?

I am developing a medical application using C # and ASP.NET in which I need to create a module for patient blood analysis. In this module I need to import HL7 messages and then analyze them to get the patient’s blood test results and extract the normal values ​​for this blood test. I have some libraries from NHAPI, but I don’t know how to use them. Can someone advise how I can run this module?

My current requirements are:

  • Bloodresults
  • This will eventually be imported from HL7.
  • Initially cut and paste
  • Results are analyzed and processed to show current results and highlight trends and abnormal values.
  • Stored in the result table
+3
source share
3 answers

To send an HL7 request to a laboratory, you must send the file to the laboratory, so you must first create the file.

String fileName = "testOrder.txt" StreamWriter sr = new StreamWriter(fileName) 

Now add the lines one by one, the first line should be MSH (message header tag), which looks like this: MSH | ^ ~ \ & amp; | HDL | LCA | Lis | TEST9999 | 199807311532 || ORU ^ R01 | 3629 | P | 2.2

so your line of code will look like this:

 sr.WriteLine("MSH|^~\&|" + _YOURAPPLICATIONNAME + "|" + _YOURHOSPITAL + "|" + _RECEIVINGAPPLICATIONNAME + "|" + _RECEIVINGLAB + "|" + _DATETIME + "||ORU^R01|" + _IDOFORDERINYOURDATABASE + "|P|2.2"); 

Then you need to add the PID line to your file, for example: PID | 2 | 2161348462 | 20809880170 | 1614614 | 20809880170 ^ TESTPAT || 19760924 | M ||| ^^^^ 00000-0000 ||||||| 86427531 ^^^ 03 | SSN # HERE

therefore, you must tell your stream entry to write the line above in the file, but obviously also change the values ​​in this line, as you did for the MSH segment, the PID specifications can be found at http://www.corepointhealth.com/resource-center / hl7-resources / hl7-pid-segment

After that, you need to add the lines ORC and OBR to the file as: ORC | Nw | 8642753100012 ^ LIS | 20809880170 ^ HDL |||||| 19980727000000 ||| HAVILAND OBR | 1 | 8642753100012 ^ LIS | 20809880170 ^ LCS | 008342 ^ TOP RESPIRATORY CULTURE ^ L ||| 19980727175800 |||||| SS # 634748641 CH14885 SRC: THROA SRC: Foam | 19980727000000 |||||| 20809880170 || 19980730041800 || BN | F

Replace the desired values ​​in these lines. This will make your test request file complete. If the doctor gave further comments, you can add another line of the NTE tag, for example: NTE | 1 | L | MORAXELLA (BRANHAMELLA) CATARRHALIS

When your file is full, now you can send it to the laboratory, the important thing in your file is ORU ^ R01 in the MSH tag, which tells the laboratory that this is a test request. Later, the laboratory will send you an HL7 file with the same MSH, PID, ORC and OBR tags, as well as OBX tags that will have the test results. In the MSH tag, you sent the order ID of your database, so when the laboratory sends it back, you can check what order this file came for.

You can read the file line by line by dividing the line of each line against "|" and extract the necessary data and put it in the database.

I hope this would give you a better idea of ​​what and how you should do.

+5
source

I hope you have advanced a bit in your HL7 parser.

The first stop you can visit is the HL7 website . It contains tools and resources and other links that may help you.

I found the following link very useful when trying to figure out what information should be extracted from v2.x message:

http://amisha.pragmaticdata.com/~gunther/oldhtml/tables.html

If you look at the top of this web page for the previous link, you will also notice that you have options for choosing Messages, Segments, or Composites. Each page will give you very useful, but general information.

In addition, I did a few Google searches and found the following website that will show examples of v2 and v3 messages:

http://www.ringholm.de/docs/04300_en.htm

If you are going to work with v3, you will most likely want to try to find an xml schema that you can use in Visual Studio to generate some classes that are directly attached to the xml you need to send / receive, this will make development a lot easier . I searched on Google and found this site, which includes schemes that you can use to create classes for a large group of posts that you may or may not need:

http://schemas.liquid-technologies.com/HL7/hl7_24_xsd/

I cannot give you detailed information about what messages you need, because I never wrote an HL7 application that dealt with the type of patient information you are looking for, but you must follow these guidelines of the standards:

The MSH segment speaks of delimiters that separate key pieces of information (delimiters are common for applications, but are not always the same, so knowing the order in which delimiters are sent to this message segment will subsequently save you a headache). It also includes the message number, the name of the messaging system, and may include the connection information necessary to communicate with another HL7 system. It also gives you a message type, which is very important if you plan to store data in a database. The message type tells you whether to add, update, or delete data.

The PID segment gives you information about the patient, this helps you uniquely identify the information that you need to store.

All segments are listed in more detail in the previous link amisha.pragmaticdata.com

I hope this information helps. I have given a lot, and if you have specific questions, I would like to try to answer them.

Sincerely.

+3
source

I work in the IT department for a clinical laboratory - maybe I can help. Most labs report results using the HL7 ORU ^ R01 record in HL7 version 2.x, and most EMRs send electronic orders (HL7 ORM ^ O01) in 2.x format. The parser that you create must be configured to handle the resulting messages with line separators v2.x (if you intend to read, write, and report patient results). Here is an example of what you need to pull from a file:

An HL7 file usually contains only one attachment (a laboratory message for patient contact) per file β€” this is only one set of patient results. Each file contains HL7 segments (each segment is usually separated by CR / LF in the file) and is denoted by three-letter mnemonics. Each field of the segment is separated by the pipe separator "|" character, and if the field has sub-segments, then they are separated by a carriage delimiter "^"

  • For patient information, you will look at the PID segment (Patient Identifier): PID segment 5 (PID.5) will have Lastname ^ Firstname ^ Middle The initial PID segment 7 (PID.7) will have the patient Date of birth (usually in the format YYYYMMDD ) PID segment 8 (PID.8) will have a section of the PID segment (M or F) of the patient (PID.11) will have the address of the patient: Add1 ^ Add2 ^ City ^ State ^ Zip

    To get the results you need to analyze the OBR and OBX segments. OBR is what the doctor ordered in the OBX laboratory. corresponding results for this order (sometimes one to one, sometimes one for many). You should focus on OBX segments: the OBX 2 segment (OBX.2) will indicate which type of result for this test, usually labeled "NM" (numeric), "TX" (text) or "ST" (string) - hold of course not all laboratory test results are strictly digital - far from It. The OBX 3 segment (OBX.3) will have a laboratory identifier for test - it can be an internal code and description or it can be LOINC (see www.loinc.org), which is a universal standard number system for laboratory tests - it depends on the laboratory. OBX segment 5 (OBX.5) will have the value OB OBS (result) OBX 6 (OBX.6) Units for the test segment OBX 7 (OBX.7) will have a reference range for segment 8 tst OBX (OBX.8) will have an anomalous flag indicator. It is the responsibility (not your parser) to send a β€œflag” if the result has been marked this test is abnormal. Standard: NULL or β€œN” for Normal, β€œH” for abnormal maximum, β€œHH” for critical maximum, β€œL” for abnormal low, and β€œLL” for critical minimum

+2
source

Source: https://habr.com/ru/post/916729/


All Articles