﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
10	Bug in the Fileman import data code (DDMP)...	Sam Habiel		"Here's the situation:

I am trying to import a (rather large) drug file into Vista from a
csv. Every single time I import, however, the fields seem to get
scrambled so that data don't file because the wrong data types get
filed into fields. For example (file name edited, file isn't called
""Drugs"").

Record #1 Rejected:
  The value 'No DEA Class Code assigned' for field MED ROUTE ID in
file DRUGS is not valid.
Record #2 Rejected:
  The value '41101' for field MED REF GEN DRUG NAME CD in file DRUGS
is not valid.
Record #3 Rejected:
  The value '00281024' for field MED REF GEN DRUG NAME CD in file
DRUGS is not valid.

Using the GT.M native debugger, and then Serenji, I was able to
pinpoint down the problem:
In PARSE+15^DDMP, there is this line:

S DDMPIN=$P(DDMPIN,DDMPTVAL,2)

The intent of this line is to chop DDMPTVAL from the beginning of
DDMPIN. It works almost all of the time, with one exception: when
DDMPTVAL occurs twice in succession.

GTM> w DDMPIN
""Erythromycin (Bulk) Powder"",""Erythromycin (Bulk)
Powder"",""0"",00035,00077827,00093978,"""","""",""Misc"",""Misc.(Non-Drug;
Combo Route)"",""Powd"",""Powder"","""",""Powder

GTM> w DDMPTVAL
""Erythromycin (Bulk) Powder""

GTM> W $P(DDMPIN,DDMPTVAL,2)
,
(instead of the expected ,""Erythromycin (Bulk)
Powder"",""0"",00035,00077827,00093978,"""","""",""Misc"",""Misc.(Non-Drug;
Combo Route)"",""Powd"",""Powder"","""",""Powder)

That's why my fields were getting scrambled. The routine thinks that
my csv input has ended and moves on to the next part.

Sam
PS: I am using the latest and greatest MSC FileMan 22.1036

Bugfix:
Change the above mentioned line to this:
... S DDMPIN=$E(DDMPIN,$L(DDMPTVAL)+1,$L(DDMPIN))

I verified that it works with the import that crashed."	defect	new	major		WorldVistA EHR				
