[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation |
Date: |
Wed, 21 Jan 2015 23:15:29 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Jan 21, 2015 at 07:37:10PM +0000, Jim Busser wrote:
> Can I be pointed to where, in the code, the minimum requirements for
> "matching" an incoming HL7 message to an existing (possibly needing to be
> re-associated) patient is specified? Is it in
>
>
> https://gitorious.org/gnumed/gnumed/source/463a65a968976cb7aeb741ea9b6148f96823f4bf:gnumed/gnumed/client/business/gmHL7.py
def __find_patient(PID=None):
name = PID[PID_name]
pat_lname = name[PID_lastname]
pat_fname = name[PID_firstname]
pat_mname = None
if len(name) > 2:
pat_mname = name[PID_middlename]
_log.debug('patient data from PID segment: first=%s (middle=%s)
last=%s', pat_fname, pat_mname, pat_lname)
dto = gmPerson.cDTO_person()
dto.firstnames = pat_fname
dto.lastnames = pat_lname
dto.gender = HL7_GENDERS[PID[PID_gender][0]]
dob = time.strptime(PID[PID_dob][0], '%Y%m%d')
dto.dob = pyDT.datetime(dob.tm_year, dob.tm_mon, dob.tm_mday, tzinfo =
gmDateTime.gmCurrentLocalTimezone)
idents = dto.get_candidate_identities()
if len(idents) == 0:
_log.warning('no match candidate, not auto-importing')
_log.debug(dto)
return []
if len(idents) > 1:
_log.warning('more than one match candidate, not
auto-importing')
_log.debug(dto)
return idents
return [gmPerson.cPatient(idents[0].ID)]
Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Busser, Jim, 2015/01/21
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation,
Karsten Hilbert <=
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Busser, Jim, 2015/01/21
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Busser, Jim, 2015/01/21
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Busser, Jim, 2015/01/21
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Karsten Hilbert, 2015/01/21
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Busser, Jim, 2015/01/21
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Karsten Hilbert, 2015/01/22
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Busser, Jim, 2015/01/21
- Re: [Gnumed-devel] GNUmed HL7 import, Karsten Hilbert, 2015/01/25
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Karsten Hilbert, 2015/01/25
- Re: [Gnumed-devel] GNUmed HL7 import - patient association or creation, Karsten Hilbert, 2015/01/22