gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] HL7 OBX result messages that involve multiple lines e


From: lkcl
Subject: Re: [Gnumed-devel] HL7 OBX result messages that involve multiple lines esp Microbiology
Date: Sun, 8 Aug 2010 13:52:25 -0700 (PDT)



Jim Busser wrote:
> 
> OBX contains a field
> 
>       004 Observation Sub ID
> 
> Which is used to enumerate multiple OBX records when they
> 
> 1) pertain to the same LOINC code, for example when there are  
> multiple pathologists' comments:
> 
> ORC|RE||03000032-PATHC-0|||||||||12345^DR_SURN^DR_FIRST^
> OBR|5||03000032-PATHC-0|PATHC^Pathologist
> Comments|R|20030827091101|20070827091101|||||||20070827091101|| 
> 12345^DR_SURN^DR_FIRST^||||||20070901105929|||F||^^^^^R| 
> 87878^DOE^JANE~12345^DR_SURN^DR_FIRST^
> OBX|1|TX|X10011^Pathologist Comments|1|Result 1||||||F|||20070901105402
> OBX|2|TX|X10011^Pathologist Comments|2|Result 2||||||F|||20070901105402
> OBX|3|TX|X10011^Pathologist Comments|3|Result 3||||||F|||20070901105402
> 
> 
> 2) describe Microbiology results that describe sites, potentially  
> multiple organisms, and their antibiotic susceptibilities (see also  
> HL7 V2.3 Section 7.4.5):
> 
> Here is one format and example in which reported first are all the  
> Culture results; the Observation Sub-ID contains the id of the  
> culture (i.e. 1, 2, 3 etc); after this, the Organism is reported,  
> followed by all the antibiotics, in the order of the culture result:
> 
> OBR|1||02-123456-URC-0^bcb|URC^URINE CULTURE^L||200011081429|
> 200011081429|||||||200011081429||TTTT2^TEST^BLAIR^^^^^L|||||| 
> 200011300944|MICRO|LAB_ORG
> |F||^^^200011081429|||||||204
> OBX|1|FT|19803-6^SITE^L||Urine|||N|||F|||200011081430|EDM|204
> OBX|2|FT|6463-4^Culture^L|1|Light growth of: Klebsiella sp.|||N|||F||| 
> 200011081434
> OBX|3|FT|28-1^Ampicillin^L|1|R|||N|||F|||200011081434
> OBX|4|FT|149-5^Cephalexin^L|1|R|||N|||F|||200011081434
> OBX|5|FT|267-5^Gentamicin^L|1|S|||N|||F|||200011081434
> OBX|6|FT|7057-3^TMP/SMX^L|1|S|||N|||F|||200011081434
> OBX|7|FT|363-2^Nitrofurantoin^L|1|S|||N|||F|||200011081434
> OBX|8|FT|6463-4^Culture^L|2|Light growth of: Staphylococcus aureus||| 
> N|||F|||200011081434
> OBX|9|FT|6932-8^Penicillin^L|2|R|||N|||F|||200011081434
> OBX|10|FT|197-4^Cloxacillin^L|2|R|||N|||F|||200011081434
> OBX|11|FT|233-7^Erythromycin^L|2|S|||N|||F|||200011081434
> OBX|12|FT|7057-3^TMP/SMX^L|2|S|||N|||F|||200011081434
> OBX|13|FT|193-3^Clindamycin^L|2|R|||N|||F|||200011081434
> OBX|14|FT|524-9^Vancomycin^L|2|R|||N|||F|||200011081434
> OBX|15|FT|Ms.OX2^Cloxacillin^L|2|R|||N|||F|||200011081434
> OBX|16|FT|28-1^Ampicillin^L|2|S|||N|||F|||200011081434
> OBX|17|FT|149-5^Cephalexin^L|2|S|||N|||F|||200011081434
> OBX|18|FT|20-8^Amoxicillin/clavulanate^L|2|S|||N|||F|||200011081434
> 
> 
> Do we see some value or need (or none) to the OBX sequence counter  
> (above, OBX|1 through OBX|18) and similarly any need to store the  
> 'Observation SubID" which in this case associates the individual  
> species (Klebsiella sp versus Staphylococcus aureus) with their  
> specific antibiotic profile?
> 
> 

going through with a search "gnumed HL7" i found this post, and it is
relevant because i had assumed that the words "primary key" in the HL7 spec
that i found actually meant "primary key".

what we have here is an example - two - where in the business/gmHL7.py
clin.test_results importer as it stands, data will be overwritten.  greaaat!

this is however easily fixed as follows:

diff --git a/gnumed/gnumed/client/business/gmHL7.py
b/gnumed/gnumed/client/business/gmHL7.py
index b791922..0cd6af1 100644
--- a/gnumed/gnumed/client/business/gmHL7.py
+++ b/gnumed/gnumed/client/business/gmHL7.py
@@ -525,6 +525,11 @@ where pk_identity in (
             unit = ob.units or '' # yes, units can be empty...
             abbrev = ob.observation_identifier[0]
             name = ob.observation_identifier[1]
+            if ob.observation_sub_id:
+                # sub-id must be part of the key, somehow, otherwise data
with
+                # the same test type (multiple samples) will be
overwritten!
+                name += " (%s)" % ob.observation_sub_id
+
             ttype = gmPathLab.create_measurement_type(test_org_pk,
                                                       abbrev, unit, name)

i figured that it would be preferable to overload the name rather than the
numerical-representation, tacking the sub-id onto the end of the text.

it would be preferable however to have measurement type take a "sub-id". 
or, for there to be a separate table of sub-ids.  or, better, for
clin.test_results to have an additional field (text, just in case - you
never know if someone will put non-numeric data into OBX 004 observation
sub-id...) call it... test_type_sub_id.

l.

-- 
View this message in context: 
http://old.nabble.com/HL7-OBX-result-messages-that-involve-multiple-lines-esp-Microbiology-tp15402507p29382685.html
Sent from the GnuMed - Dev mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]