Project to Make my Life Easier

Reply

Join Date: Apr 2008
Posts: 15
Reputation: bvrclvr1 is an unknown quantity at this point 
Solved Threads: 0
bvrclvr1 bvrclvr1 is offline Offline
Newbie Poster

Project to Make my Life Easier

 
0
  #1
Oct 10th, 2008
Hi All,

I'm extremely new to Python and would like to create a program to help automate some of the things I do at work. I need to take information from an IDX shell and create a word document with it. Does this sound possible? Would anyone be interested in switching to E-mail and helping me figure this out? I'd have to start from scratch, but I learn fast.

Any help would be appreciate.

Thanks,
Ryan
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 1,536
Reputation: Ene Uran has a spectacular aura about Ene Uran has a spectacular aura about 
Solved Threads: 170
Ene Uran's Avatar
Ene Uran Ene Uran is offline Offline
Posting Virtuoso

Re: Project to Make my Life Easier

 
0
  #2
Oct 10th, 2008
Why not do it on the forum so all of us can learn?
drink her pretty
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 901
Reputation: Gribouillis is a jewel in the rough Gribouillis is a jewel in the rough Gribouillis is a jewel in the rough 
Solved Threads: 213
Gribouillis's Avatar
Gribouillis Gribouillis is offline Offline
Posting Shark

Re: Project to Make my Life Easier

 
0
  #3
Oct 10th, 2008
It's a good idea, for example I don't know what an IDX shell is
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 15
Reputation: bvrclvr1 is an unknown quantity at this point 
Solved Threads: 0
bvrclvr1 bvrclvr1 is offline Offline
Newbie Poster

Re: Project to Make my Life Easier

 
0
  #4
Oct 10th, 2008
I'd be more than happy to do it here, I just want to make sure it is easy for someone to help me.

IDX (aka Reflections) is a telnet application we use to access a db of patient names, demographics, appointment history, and schedules.

I work in a medical records department where we print information from the shell, then manually create labels for the charts and other specific paperwork. I would like very much to streamline as much of this process as possible and figure the labels would be a good start to get to know the python language, then try to tackle other parts of the process.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 15
Reputation: bvrclvr1 is an unknown quantity at this point 
Solved Threads: 0
bvrclvr1 bvrclvr1 is offline Offline
Newbie Poster

Re: Project to Make my Life Easier

 
0
  #5
Oct 10th, 2008
Also, IDX supports Visual Basic Macros. I don't know if these can be initiated from outside the shell or if I will have to create and run macros from inside IDX and maybe print lists to files, then use Python to move data around? Sorry to be such a noob, but I really don't know what I'm doing.
Last edited by bvrclvr1; Oct 10th, 2008 at 6:22 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 901
Reputation: Gribouillis is a jewel in the rough Gribouillis is a jewel in the rough Gribouillis is a jewel in the rough 
Solved Threads: 213
Gribouillis's Avatar
Gribouillis Gribouillis is offline Offline
Posting Shark

Re: Project to Make my Life Easier

 
0
  #6
Oct 10th, 2008
I suppose that the information which you print could easily be sent to a file instead of the printer ? I think it would be a good idea to show us an exemple of this printed information and also of the information that you create manually from this.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 15
Reputation: bvrclvr1 is an unknown quantity at this point 
Solved Threads: 0
bvrclvr1 bvrclvr1 is offline Offline
Newbie Poster

Re: Project to Make my Life Easier

 
0
  #7
Oct 22nd, 2008
Hello Again,

Sorry it took so long to get back, I had to discuss the options for printing to a file with our I.T. Department. I finally managed to find a way to generate a text document with the information I need.

I have attached a shortened version of the schedule file I can create. The columns will always look like they do in the attached file as far as spacing. I had to replace any identifying information due to Health Information Protection, but the format of the report has not changed at all.

I also attached a template for printing labels with the patients' information. I filled in one of the labels to show how the information is to be organized - the name, which is capitalized on the schedule will need to appear the way it does on the labels, with only the first letter capitalized.

This is a start to the project - eventually I'd like to be able to populate the Name and Date of Birth fields on other forms that we use.

Thanks again for helping out,
Ryan
Attached Files
File Type: txt Schedule.txt (1.7 KB, 8 views)
File Type: doc patients labels.doc (34.0 KB, 6 views)
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 15
Reputation: bvrclvr1 is an unknown quantity at this point 
Solved Threads: 0
bvrclvr1 bvrclvr1 is offline Offline
Newbie Poster

Re: Project to Make my Life Easier

 
0
  #8
Oct 23rd, 2008
Hello?

Can anyone help me use Python to extract information from the text file attached to my last post and enter it into the word template that is also attached?

I would really appreciate the help.
Last edited by bvrclvr1; Oct 23rd, 2008 at 12:45 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,046
Reputation: jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough 
Solved Threads: 263
Sponsor
jlm699's Avatar
jlm699 jlm699 is offline Offline
Knows where his Towel is

Re: Project to Make my Life Easier

 
0
  #9
Oct 23rd, 2008
Let's do this one step at a time. The text file is kind of ugly, but here's a quick example of extracting info.

  1. >>> f = open('Schedule.txt')
  2. >>> r = f.readlines()
  3. >>> f.close()
  4. >>>
  5. >>> data_found = 0
  6. >>> for each_line in r:
  7. ... if not data_found:
  8. ... if each_line.strip()[:4] == 'Time':
  9. ... data_found = 1
  10. ... my_data = {}
  11. ... for each_entry in [ i.strip() for i in each_line.split(' ') if i ]:
  12. ... my_data[each_entry] = ''
  13. ... else:
  14. ... if each_line[:3] != ' ' and each_line.strip():
  15. ... print [ i.strip() for i in each_line.strip().split(' ') if i ]
  16. ...
  17. ['08:30AM', 'DOE, JANE', '3######', '##/##/####', '4MDC', '###-###-####', 'FES', '40', 'XXXX MD,XXXXXX', 'PNL', 'MFG', '3XXXXXXX']
  18. ['08:30AM', 'DOE, JANE', '3######', '##/##/####', '5UNI', '###-###-####', 'FES', '40', 'XXXX MD,XXXXXX', 'PNL', 'MFG', '3XXXXXXX']
  19. ['09:20AM', 'DOE, JANE', '3######', '##/##/####', '5UNI', '###-###-####', 'IGS', '40', 'XXXX MD,XXXXXX', 'PNL', 'MFG', '3XXXXXXX']
  20. ['09:20AM', 'DOE, JANE', '3######', '##/##/####', '5PPO', '###-###-####', 'IGS', '40', 'XXXX MD,XXXXXX', 'PNL', 'MFG', '3XXXXXXX']
  21. ['10:10AM', 'DOE, JANE', '3######', '##/##/####', '4OMH', '###-###-####', 'UFU', '40', 'XXXX MD,XXXXXX', 'PNL', 'MFG', '3XXXXXXX']
  22. ['10:10AM', 'DOE, JANE', '3######', '##/##/####', '4MPE', '###-###-####', 'AMN', '40', 'XXXX MD,XXXXXX', 'PNL', 'MFG', '3XXXXXXX']
  23. >>> my_data
  24. {'Hm/Wk Phone': '', 'Appt#': '', 'Loc': '', 'DOB': '', 'Provider': '', 'Patient Name': '', 'Dept': '', 'MRN': '', 'FSC1': '', 'Time': '', 'Dur': '', 'Typ': ''}
  25. >>>
Now we'll need to put some thought into how we want to handle this. We could set up a list and for each patient record, fill in my_data structure, and then deep copy it into that master list of records. After the extraction stage is done we'll need to think about what data we want to put into the word template.

The final step is actually filling in the word template which may prove to be much more difficult. I've never worked with MS Word COM objects (which I'm assuming we'll need here), so hopefully somebody else on the forum has some insights.
1. Use Code Tags.
2. Homework? Show Effort.
3. Keep discussions on the forum: no PMs
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 15
Reputation: bvrclvr1 is an unknown quantity at this point 
Solved Threads: 0
bvrclvr1 bvrclvr1 is offline Offline
Newbie Poster

Re: Project to Make my Life Easier

 
0
  #10
Oct 23rd, 2008
Thanks but I think you may have to walk me through that a little. It looks like you're opening the text file, extracting the data, and closing the file. Then are you assigning each string item to a variable? I'm not at all familiar with Python and am only vaguely familiar with C++.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC