X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id BCE079FA293 for ; Fri, 12 May 2006 14:50:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 14798-05 for ; Fri, 12 May 2006 14:50:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id B112C9F946D for ; Fri, 12 May 2006 14:50:40 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Fri, 12 May 2006 17:50:38 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 12 May 2006 12:50:37 -0500 Subject: Re: Copy HL7 record/file into PostgreSQL Table From: Scott Marlowe To: "Kenneth B. Hill" Cc: pgsql-admin@postgresql.org In-Reply-To: <7D1BD819-CD34-4760-8C7A-89F944A4D589@scottshill.com> References: <1147453260.9755.116.camel@state.g2switchworks.com> <7D1BD819-CD34-4760-8C7A-89F944A4D589@scottshill.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1147456237.9755.121.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Fri, 12 May 2006 12:50:37 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/160 X-Sequence-Number: 21692 WOW, that's some huge document, kinda meandering and not sure where it wants to go. :) I've written importers for such stuff in the past. Looks like a week long job there. a couple of points. Looks like an HL7 file is kind of a broad format. I'd shoot for whatever subset gets you what you need. Looks like there are there a lot of dependent tables you'll need to make it work. Am I right? Di you just need to parse this thing into pieces and toss it into a generic table, or are you gonna have a lot of other processing to make it work? On Fri, 2006-05-12 at 12:27, Kenneth B. Hill wrote: > An HL7 file is a tagged file used to transfer electronic health > records. The file looks like: > > MSH|^~\&|EPIC|EPICADT|SMS|SMSADT|199912271408|CHARRIS|ADT^A04|1817457| > EVN|A04|199912271408|||CHARRIS > PID||0493575^^^2^ID 1|454721||DOE^JOHN^^^^|DOE^JOHN^^^^|19480203|M| > NK1||CONROY^MARI^^^^|SPO||(216)731-4359||EC||||||||||||||||||||||||||| > PV1||O|168 ~219~C~PMA^^^^^^^^^||||277^ALLEN FADZL^BONNIE^^^^|||||||||| > > You can download a PDF for details here: > > http://www.hl7.org/Special/IG/final.pdf > > -Ken > > On May 12, 2006, at 10:01 AM, Scott Marlowe wrote: > > > On Fri, 2006-05-12 at 11:41, Kenneth B. Hill wrote: > >> I'm looking for a way to get an HL7 file into a table. My current > >> thinking is I need to parse the HL7 file to a flat-file and use the > >> copy command. I would appreciate some guidance on doing this. > >> Thank you. > > > > I'd love to help out. > > > > Just one thing... What's an HL7 file? >