Title: RE: [Hardhats-members] UPDATE^DIE

I did notice the problem with DIC(0) and it is set in my code.  I am only trying to load a few fields at this time to keep it as simple as possible.  I have attached the code I am running and some output from the execution, including variables and their values.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lloyd Milligan
Sent: Tuesday, June 21, 2005 8:04 PM
To: hardhats-members@lists.sourceforge.net
Subject: Re: [Hardhats-members] UPDATE^DIE

 

Evidently mine is a minority opinion, but I think it is OK, even commendable, to use UPDATE^DIE to pre-load File 200.  In fact, ^XUSERBLK "Grant Access by Profile" constructs an FDA and calls UPDATE^DIE, so what can be wrong with that?

 

I know of a bug in one of the File 200 cross-references at LAYGO^XUA4A7, where it assumed that DIC(0) exists--That one is easily circumvented by setting DIC(0) in your code.  Possibly similar problems exist in other indexes, but I doubt this has relevance to the error you observed.

 

To troubleshoot I would suggest constructing a minimal FDA and then calling UPDATE^DIE to create a single entry.  You don't show the value of key variables at the point of error, or the code used to construct the FDA or IENS.  Therefore, it is difficult to make a constructive suggestion.

 

Lloyd

 

 

----- Original Message -----

Sent: Tuesday, June 21, 2005 5:10 PM

Subject: RE: [Hardhats-members] UPDATE^DIE

 

I am very new at this so I'm not sure what you mean by building the entries incrementally.  Do you mean inserting the data straight into the globals?  I was hoping to use UPDATE^DIE since it does all of the indexing...(at least that's what the documentation says).

Anyway, can you provide me with a starting point and maybe a short summary of what would be involved.

What I am trying to do is populate file 200 with data from our Doctor Master file.  Since I work for a large university with several hospitals, we have a few thousand doctors that would need to be entered.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Greg Woodhouse

Sent: Tuesday, June 21, 2005 4:03 PM
To: hardhats-members@lists.sourceforge.net
Subject: Re: [Hardhats-members] UPDATE^DIE

There are a few files like 2 and 200 that have so much logic built into
the DD (try looking at a standard listing) that doing bulk updates like
this is all but a lost cause. You can try tracking it down, but most
likely you'll have to build your entries incrementally, following the
logic in the Registration module, or something similar.

(Editorial aside: I don't think things have to be that way, they just
are.)

--- "Theriot, Derek" <[EMAIL PROTECTED]> wrote:

> I am trying to populate the NEW PERSON file by reading a text file I
> received from an existing application.  I have written a routine that
> will
> read the file and create the FDA array.  However when it gets to the
> UPDATE^DIE call, I get the following message:
>

>
> . S DIEFNIEN[EMAIL PROTECTED]@($TR(P,"+?"))
>
>    ^
>
> <UNDEFINED>ADDCONV+5^DIEF1
>

>
> I am only trying to load a few fields for now just to try to get it
> working.
> I think I have the required fields covered (NAME, SERVICE/SECTION).
> Is
> there something I'm missing?  Does anyone have a better suggestion
> for
> accomplishing this?
>

>
> Thanks.
>

>

>
>

 

"The most profound technologies are those that disappear."
--Mark Weiser

====
Greg Woodhouse
[EMAIL PROTECTED]
[EMAIL PROTECTED]





-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

VISTA>D ^TESTDOCTORFILE
 
 . S [EMAIL PROTECTED]@($TR(P,"+?"))
   ^
<UNDEFINED>ADDCONV+5^DIEF1
VISTA 41d3>W
 
%X="XMTO("
%Y="^%ZTSK(ZTSK,.3,ZT1,"
C=" "
COMP("FAMILY")="ABATZIS"
COMP("GIVEN")="MICHAEL"
COMP("MIDDLE")=""
COMP("SUFFIX")=""
D0="42"
DI01(1)=""
DIALLVAL=1
DIC(0)=""
DICAFILE=200
DICLERR=""
DICTRL="SC"
DIDA="+2"
DIEFADAR="XUIEN"
DIEFAR="FDA"
DIEFDAS="+2,"
DIEFF=200
DIEFFLAG=""
DIEFFREF="^VA(200)"
DIEFIEN="+2,"
DIEFLEV=0
DIEFOUT="MSG"
DIEFTMP="^TMP("DIEF",3420.01)"
DIEFTREF="^VA(200)"
DIEN="XUIEN"
DIENEW="39,"
DIENP=","
DIENTRY="?+1,"
DIF=""
DIFAIL=0
DIFDA="XUFDA"
DIFDAO="XUFDA"
DIFILE=20
DIFLAGS="K"
DIFLD=.01
DIFM=1
DIIENS="42,"
DIKACT=""
DIKCLOG="S"
DIKCOD="I '$G(XUNOSIGT),X(1)=200,X(2)=.01 N COMP,DIERR,MSG,SIG,XUNOSIGT S 
XUNOSIGT=1,COMP("FAMILY")=X(4),COMP("GIVEN")=X(5),COMP("MI
DDLE")=X(6),COMP("SUFFIX")=X(7),FDA(200,X(3),20.2)=$$NAMEFMT^XLFNAME(.COMP,"G") 
D FILE^DIE("","FDA","MSG")"
DIKCON=""
DIKCT="C"
DIKCX1=""
DIKCX1(1)=""
DIKCX1(2)=""
DIKCX1(3)=""
DIKCX1(4)=""
DIKCX1(5)=""
DIKCX1(6)=""
DIKCX1(7)=""
DIKCX2="200"
DIKCX2(1)="200"
DIKCX2(2)=".01"
DIKCX2(3)="39,"
DIKCX2(4)="ABATZIS"
DIKCX2(5)="MICHAEL"
DIKCX2(6)=""
DIKCX2(7)=""
DIKCX2(8)=""
DIKLOCK=1
DIKLOG="S"
DIKON="O^"
DIKRFIL=200
DIKTMP="^TMP("DIEF",3420,"R")"
DIKVAL=""
DILOG="S"
DIMSGA="XUMSG"
DINEXT=""
DINULL=0
DINUM=0
DIOK=1
DION="O"
DIOP="+"
DIOPER="A"
DIOUT=1
DIOUT1=""
DIQUIET=1
DIREC="39,"
DIROOT="^VA(200)"
DIRULE="^TMP("DICA",3420.01)"
DISEQ="2"
DISYS=18
DIVALUE="ABATZIS,MICHAEL"
DIXR="5"
DIXREF=""
DOREPL=0
DT=3050622
DTIME="3600"
DUZ=9
DUZ("0")="@"
DUZ("1")=""
DUZ("2")="67"
DUZ("AG")="V"
DUZ("BUF")=1
DUZ("LANG")=""
Doctor("DOCNAME")="ABATZIS,MICHAEL "
Doctor("DOCNUM")="15151"
Doctor("Initial")="MA"
DoctorFile="C:\CacheSys\Mgr\Vista\Doctor.txt"
FDA(200,"+2,",".01")="ABATZIS,MICHAEL "
FDA(200,"+2,","1")="MA"
FDA(200,"+2,","29")="IRM"
FDA(200,"+2,","747.1")="MEDICINE"
FDA(200,"39,","20.2")="MICHAEL ABATZIS"
FIRSTNAME="MICHAEL"
FileObj=<OBJECT REFERENCE>[EMAIL PROTECTED]
I=1
IO="|TRM|:|3420"
IO("0")="|TRM|:|3420"
IO("1","|TRM|:|3420")=""
IO("ERROR")=""
IO("HOME")="5^|TRM|:|3420"
IO("ZIO")="TRM:"
IOBS="$C(8)"
IOF="#,$C(27,91,50,74,27,91,72)"
IOM=80
ION="CONSOLE"
IOS=5
IOSL="24"
IOST="C-VT100"
IOST(0)=9
IOT="VTRM"
IOXY="W $C(27,91)_((DY+1))_$C(59)_((DX+1))_$C(72)"
LASTNAME="ABATZIS"
MIDDLENAME=""
P="+2"
RecFound=0
TextLine="15151,ABATZIS MICHAEL,EMER,O,,,,RES000"
TextStream=<OBJECT REFERENCE>[EMAIL PROTECTED]
U="^"
X="200"
X(1)="200"
X(2)=".01"
X(3)="39,"
X(4)="ABATZIS"
X(5)="MICHAEL"
X(6)=""
X(7)=""
X(8)=""
X1=""
X1(1)=""
X1(2)=""
X1(3)=""
X1(4)=""
X1(5)=""
X1(6)=""
X1(7)=""
X2="200"
X2(1)="200"
X2(2)=".01"
X2(3)="39,"
X2(4)="ABATZIS"
X2(5)="MICHAEL"
X2(6)=""
X2(7)=""
X2(8)=""
XLFNC="ABATZIS,MICHAEL"
XLFNC("FAMILY")="ABATZIS"
XLFNC("GIVEN")="MICHAEL"
XLFNC("MIDDLE")=""
XLFNC("SUFFIX")=""
XMDUN="MANAGER,SYSTEM"
XMDUZ=9
XMV("ASK BSKT")=1
XMV("DUZ NAME")="MANAGER,SYSTEM"
XMV("MSG DEF")="I"
XMV("NAME")="MANAGER,SYSTEM"
XMV("NETNAME")="[EMAIL PROTECTED]"
XMV("NEW OPT")="R"
XMV("NEW ORDER")=1
XMV("NOSEND")=0
XMV("ORDER")=1
XMV("PREVU")=0
XMV("RDR ASK")="Y"
XMV("RDR DEF")="C"
XMV("SHOW DUZ")=0
XMV("SHOW INST")=0
XMV("SHOW TITL")=0
XMV("VERSION")="VA MailMan 8.0"
XPARSYS="18;DIC(4.2,"
XQXFLG="^^XUP"
XUFDA(20,"?+1,",".02")=.01
XUFDA(20,"?+1,",".03")="39,"
XUFDA(20,"?+1,","1")="ABATZIS"
XUFDA(20,"?+1,","2")="MICHAEL"
XUFDA(20,"?+1,","3")=""
XUFDA(20,"?+1,","5")=""
XUFIL=200
XUFLD=.01
XUIEN(1)=42
XUIEN(1,0)="+"
XUIENS="39,"
XUNAME="ABATZIS,MICHAEL"
XUNAME("FAMILY")="ABATZIS"
XUNAME("GIVEN")="MICHAEL"
XUNAME("MIDDLE")=""
XUNAME("SUFFIX")=""
XUNOSIGT=1
XUNOTRIG=1
XUPTR=10.1
XUPVAL=""
XUREC="39"
VISTA 41d3>
 N DoctorFile
 S DoctorFile="C:\CacheSys\Mgr\Vista\Doctor.txt"
 ;
 ;Check to make sure the file exists
 I '##class(%File).Exists(DoctorFile) Q
 ;
 ;Check to make sure the file is not already open
 N FileObj
 S FileObj=##class(%File).%New(DoctorFile)
 ;
 ;Process the file line by line
 N TextStream,TextLine,I
 S TextStream=##class(%FileCharacterStream).%New()
 S TextStream.Filename=DoctorFile
 S I=1
 WHILE 'TextStream.AtEnd {
         ;Read the next line of text in the file
         S TextLine=TextStream.ReadLine()
         I I=1 G NextRow

         ;Parse the line of text
         N Doctor,U S U=","
         S Doctor("DOCNUM")=$P(TextLine,U,1)
         S Doctor("DOCNAME")=$P(TextLine,U,2)

         ;The name needs to be formatted to "LAST,FIRST MIDDLE"
         N LASTNAME
         S LASTNAME=$P(Doctor("DOCNAME")," ",1)
         S FIRSTNAME=$P(Doctor("DOCNAME")," ",2)
         S MIDDLENAME=$P(Doctor("DOCNAME")," ",3)
         S Doctor("DOCNAME")=LASTNAME_","_FIRSTNAME_" "_MIDDLENAME

         Set Doctor("Initial")=$E(FIRSTNAME,1)_$E(LASTNAME,1)

         ;See if the entry already exists in file 200
         New RecFound
         Do FIND^DIC(200,"","@","X",Doctor("DOCNAME"),"1","","","","","")
         Set RecFound=+$PIECE($GET(^TMP("DILIST",$J,0)),"^")
 
         ;Read next row if the entry already existed
         If RecFound>"0" GoTo NextRow

         ;If we got here, the entry did not exist.  Add it.
         New FDA
         Set FDA(200,"+"_I_",",.01)=Doctor("DOCNAME")
         Set FDA(200,"+"_I_",",1)=Doctor("Initial")
         Set FDA(200,"+"_I_",",29)="IRM"

         S DIC(0)=""
         D UPDATE^DIE("E","FDA","IENSMSG","ERRMSG")
NextRow
         S I=I+1
 }
 Q

Reply via email to