Page Index Toggle Pages: [1] 2 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Refresch appropriate Data from ascii  to a Form (Read 4417 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Refresch appropriate Data from ascii  to a Form
Jun 23rd, 2005 at 11:59am
Print Post Print Post  
Hallo evrybody!

I habe subform with many Items (medical-anlysis Items ).
we get from analyser online the appropriate results.
The results are numbers, Item-Keys und Order number
as Standard ascii with comma delimeter.

I must have some help to integrate the results in the subform and I would be grateful for any tips or tricks.

Thanks
Dr. Belhareth
from Germany
« Last Edit: Jun 23rd, 2005 at 7:47pm by Amor »  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Refresch appropriate Data from ascii  to a For
Reply #1 - Jun 23rd, 2005 at 1:26pm
Print Post Print Post  
Have you checked Sesame User Guide, pages 175, 303-310?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #2 - Jun 24th, 2005 at 4:10pm
Print Post Print Post  
Hello Bob,

I suppose The Copy and the Import Kapitel in the user guide is valable only between 2 Sesame  Databases.

Is this possible  with  a external ascii-file?

Thanks
Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Refresch appropriate Data from ascii  to a For
Reply #3 - Jun 24th, 2005 at 4:46pm
Print Post Print Post  
Quote:
Is this possible  with  a external ascii-file?

Thanks
Dr. Belhareth


Take a look at the Text File I/O functions and commands starting on page 42 of the new programming guide.

Using commands like  FileReadln() will allow you to easily take data from the ascii file and manipulate it with Sbasic to use in your Sesame application.

Best of luck

P.S. Also check out @insert() command
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Refresch appropriate Data from ascii  to a For
Reply #4 - Jun 25th, 2005 at 12:02am
Print Post Print Post  
Quote:
help to integrate the results in the subform
Maybe you could explain differently what you want to do.

Some possible scenarios:
A.  Do you want a new record in a subform for each line?

B.  Would having the entire contents in one multiline field be acceptable.?

C.  Do you want a separate field for every value in the file, or can some data be combined? 

D.  Do you want one field on the subform containing all the values of one line in the file?
-------------------------------------

Can you explain the relationship/purpose of the parent form and the sub form and the ascii file.....

For example the Parent may be a Sales Order, the sub form may be the Line Items on the Sales Order, and the Ascii may be a file containing line items from multiple Sales Orders, or limited to a single Sales Order, etc.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #5 - Jun 25th, 2005 at 11:01am
Print Post Print Post  
Hi Bob,

I try to explain my scenarios:
A. The records in the subform have not to be created.
     they are alrerady saved but resultat field is empty                      because later the analyser will send the data as ascci file

B. The entire contents in one multiline filed is acceptable
    but  not necessary :
hier a typical example of the ascii file for multiple anaysis Order:

CustNr  Code  Item   Resultat
1233;Gil;Glucose;          1.21
1233;Ure;Urea,               1,33
1233;GGT;Gamm-GT;   2,73
1233;Bil;Biluribin;           1,31
1234;Gil;Glucose;          0.90
1234;Ure;Urea,              1.09
1234;GGT;Gamm-GT;  1.35
1234;Bil;Biluribin;          1.12
..
this Items exist already in the Subform AnaylasisItems but without the resultat of analysis!

C.  No I want to import, par example the analyser result       witch in ascii file for the Item Glucose the value 1.21, 
in Resultat field (in the already populated Subform) and for the same CustNr 1233.

D.  The Subform is as Table with the ordered Items.
The parent form and the subform and the ascii file
have a strong relationship with CustNr  and the Item Code

Thank you very much
Dr. Belhareth    Roll Eyes
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Refresch appropriate Data from ascii  to a For
Reply #6 - Jun 25th, 2005 at 3:42pm
Print Post Print Post  
Is there a possibility that a patient will get more then one diagnostic evaluation for the same test over a period of time with the same custnr?
Say more then 1 Glucose test?

Where is the diagnostic equipment getting patient data to export with results (entered by a technician?)

A method that has worked well for me is when the procedure is scheduled a child record is created in the subform whith all the data except the results. When this record is created the system assigns a unique number to it (we call this an event number) This number is used as the key to pick up the results from the output file from diagnostic equipment and then post the result to the specific event.

For simplicity in getting the information to diagnostic equipment we print out a sheet with the patient information including custnr and specific event procedure number including all enter keys all in bar code with human readable sub text and then just plug a bar code gun into diagnostic equipment and enter all the accurate data very quickly by just shooting line by line.

Just some things for you to think about.
Smiley
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #7 - Jul 11th, 2005 at 11:03am
Print Post Print Post  
Hi Bob,

I have  absolutly the same Conception for this Project and you undersand exactly what i am looking for.

To your questions:
1) A Patient will get more then one diagnostic evaluation for the same test over a period of Time with the same Custnr. (PatientNr)

2) I have commercial Program with bidirectional capabilty to send to the Analyser via Bar code and get back automatically the data to the Database.
But I have other Analyser manually used  and would like to connect them with my Data in Sesame. I have no Experience to do that, but i want to use the ascii file that i get back from the Analyser.
So the patient data are enterd by a technician.

3) Your method is exactly what i have done and i still want to realise it.
But how kan i post the Result from a Ascii file in the subform?
I thank i mus have a new output file to import the ascii file from the diagnostic equipment an then post the result to the specific event ?. 

Thank you very much again.
Dr.  Belhareth
Germany
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Refresch appropriate Data from ascii  to a For
Reply #8 - Jul 11th, 2005 at 3:02pm
Print Post Print Post  
If I understand your question correctly, you have an ASCII output file from your diagnostic equipment and you would like to update/post that data into the your Sesame application into the correct record and subrecord.

As long as the ASCII output file from your diagnostic equipment contains the unique record key that was created when the patient was scheduled and then passed to the Diagnostic device all you need to do is Post to the database in the application that contains that unique record.

There are probably many, many ways to do this and hopefully some of the Gurus like Ray, Bob Hansen, Carl or others will chime in on the best method.

One method I used that worked for me albeit a little clunky was to have a temporary holding database within my application that I used to import the ASCII files into each day and then I ran a mass update from my records database using lookups and posting the results from the temporary database into the correct record. I then removed all the records from the temp database until the next day when new ASCII data was available.

This Technique was used prior to many of the newer commands that the recent version of Sesame offers so I am sure it can be greatly improved.


  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #9 - Jul 11th, 2005 at 6:34pm
Print Post Print Post  
Hello Dr. Belhareth,

One way you could do this is with a mass update from the parent form. I built a sample application that has a parent named "NewForm" and a subform named "NewForm0". On the Parent Form there is one element named "CustNum". It holds the unique key for each record. The subform has three elements, "Pat_ID", "Metal Type" and "Result". "Metal Type" would be comparable to either your code or item element.

The code for the mass update is below.

Code
Select All
** PROGRAMMING SECTION: [ GLOBAL CODE ] [] **
Stat gsFile as String

gsFile = @Insert("ToImport.txt")


** PROGRAMMING SECTION: [CustNum] [Mass Update] **
Var vData as String
Var vRecData as String
Var vItem as String
Var vCnt as Int
Var vLoop as Int
Var vRecCnt as Int
Var vRecLoop as Int
Var vQuit as Int
Var vResult as Double

SetStringArraySeparator(@Newline())
//Get all Data in the File for this Customer
vData = @SearchStringArray(gsFile, @Str(CustNum) + "..")
//Remove the data for this customer from the file as it is no longer needed.
gsFile = @DifferenceStringArray(gsFile, vData)

vCnt = @CountStringArray(vData)
vLoop = 1
vRecCnt= @FormResultSetTotal("NewForm0")
vRecLoop = 1
vQuit = 0

//Loop through the data from the text file
While vLoop <= vCnt
{
	vRecData = @AccessStringArray(vData, vLoop)
	RestoreStringArraySeparator()
	//Parse apart
	vItem = @AccessStringArray(vRecData, 2)
	vResult = @AccessStringArray(vRecData, 3)

	//Loop through the subform looking for the record that matches
	While ((vRecLoop <= vRecCnt) And (vQuit = 0))
	{
		If @FormFieldValue("NewForm0", "Metal Type", vRecLoop) = vItem Then
		{
			//Record found. Lets put the result in the subform.
			FormFieldValue("NewForm0", "Result", vRecLoop, vResult)
			If @ToMoney(@FormFieldValue("NewForm0", "Result", vRecLoop)) <> vResult Then
			{
				Writeln("Failed to set the result Element on record " + vRecLoop)
			}
			vQuit = 1
		}
		vRecLoop = vRecLoop + 1
	}
	vRecLoop = 1
	vQuit = 0
	SetStringArraySeparator(@Newline())
	vLoop = vLoop + 1
} 



The file that was imported looks like this
Code
Select All
1;Silver;1234
1;Plat;123.4
1;Iron;12.34
2;Tita;1
2;Alum;2
2;Plat;3
2;Silver;4
2;Gold;5
2;Ore;6
2;Iron;7
3;Silver;1
3;Iron;2
3;Tungsten;3
3;Alloy;4
3;Aluminum;5 



If you would like to see the application that shows how to accomplish this, just send me an e-mail at support@lantica.com and I will be happy to send it your way along with the file for it to import.

As I was typing this it also occured to me that you don't have to be on the parent form at all. You could use a variation of the code above to do a mass update on the subform database itself.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Refresch appropriate Data from ascii  to a For
Reply #10 - Jul 11th, 2005 at 6:55pm
Print Post Print Post  
Ray,

Wow! now that is a quick and clean solution, Amazing!

This may be a really stupid question but why did you use @Newline() for the string array seperator?

SetStringArraySeparator(@Newline())
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #11 - Jul 11th, 2005 at 7:05pm
Print Post Print Post  
Hello Robert,

I used @Newline() because in the file that is brought in the pieces of data are separated by Carriage returns. This allowed me to operate on that text file as if it was one big string array. Makes searching for and retrieving the appropriate sections easier.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #12 - Jul 13th, 2005 at 4:43pm
Print Post Print Post  
Hello Ray!

Thank you very much for the demonstration.
I do not get any errors when i run the massupdate but it does not change anything!
i have the 3 Files in Folder C:\sesame\data\

Thanks for your help.
Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Refresch appropriate Data from ascii  to a For
Reply #13 - Jul 13th, 2005 at 4:52pm
Print Post Print Post  
Hello Dr. Belhareth,

If you are referring to the three files that I sent you, ToImport.txt needs to be in C:\Sesame in order for it to work.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Refresch appropriate Data from ascii  to a For
Reply #14 - Jul 13th, 2005 at 8:37pm
Print Post Print Post  
Hello Ray,

The massupdate does not work in  C:\Sesame   too!


Dr. Belhareth
« Last Edit: Jul 15th, 2005 at 10:53am by Amor »  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send Topic Send Topic Print Print