Mark L Posted February 24, 2005 Posted February 24, 2005 (edited) This forum has so many brilliant minds (I say this in all earnestness) - I'm looking for ideas on how to best handle the following: Part of the application I'm developing requires users to enter results for dozens of medical tests from paper print offs. Regionally, each lab provides these results in a different order ' so I've decided that using a portal is the way to offer the user control over which sort of the entry records. I have other postings on that topic ' and think I've overcome the sort issues. ALSO users need to (on rare occasions) add their own tests to the list (in my example, they may add two new tests to the existing 53) - so hard coding the tests isn't really an option for that reason too. Here's my next challenge: I'm not sure how I'm going to 'automatically' populate the portal with the dozens of 'blank' records for data entry. I put 'blank' in quotes ' because they are not really blank ' quite the opposite ' they will have all the information except the actual test result value that needs to be entered. Here's an example of a few 'blank' records: Sort Order Test Name *Test Result* Test Units ------------ ------------- --------------- ------------- 1 XYZ Test _____ mg/dl 2 QQ3 Test _____ k/cumm 3 ABC Test ______ ratio (50 records later:) 53 SQP Test _______ mg/dl Once the user fills in the test results (and some results may be left blank) ' I'll need to write out the records with the patient's ID & and the date. So I'm looking for suggestions on how to have a fixed number - 53 (using the example above) 'pre-populate' the portal. Secondarily ' if anyone has suggestions on how to best write the records out ' including the situation where the user aborts the input effort and the portal records shouldn't be saved/committed ' I'd truly appreciate it. My gut seems to say have a script that picks up the PatientID and Lab Date (business rule is there can only be one set of tests related to one Lab Date - so it can be a key) Copies the "blank" records from a database where the 53 "blank" records are stored, pend the Patient ID and Lab Date to them, then open up the Test Entry Layout, which has the portal to the freshly written out records. When test entry is complete, save the records. One worry is how would someone be able to come back and edit records - and another is "false commitments" (someone entered the data for the wrong patient - needs to delete the old and re-write under a different patient.) Any insight people have into this would be greatly appreciated. Sincerely, Mark Edited January 13, 2007 by Guest clean up
RalphL Posted February 24, 2005 Posted February 24, 2005 Take a look at this. I just posted it this morning and is simillar to your wants. http://www.fmforums.com/threads/showflat...true#Post148852
bruceR Posted February 25, 2005 Posted February 25, 2005 You don't need to prepopulate the portal and you don't need a script. What you need is an X relation to the "template" records then a second relation to the actual test results. See attached. TestResults.zip
Mark L Posted February 25, 2005 Author Posted February 25, 2005 BruceR- Wow - this seems great - I've downloaded it and have been studying it. I'm sure I'll have a couple questions for you shortly! Thanks, Mark
Mark L Posted February 25, 2005 Author Posted February 25, 2005 BruceR- I've spent some time studying this now - and I'm amazed by the relative simplity and power of what you've done! I tip my hat to you. Sorry to bother you with relative trivia: One question: A blank record seems to be surfacing somehow - it's even in the example you posted. Any idea on how that gets created? I also noticed one got created when I was playing around with your example - and had added a Patient record "directly" into the Patient file rather than via the instructions on your layout. (I'm going to be away from my PC for the next day or so - but I'm looking forward to sinking my teeth back into your solution as soon as I next hit the keyboard.) Sincerely, Mark
Mark L Posted February 25, 2005 Author Posted February 25, 2005 RalphL- You should take a look at the work BruceR has done - check out his attachment in this post - it may be applicable to your situation. -Mark
RalphL Posted February 25, 2005 Posted February 25, 2005 Like Bruce, I was answering a question when I posted that file. Bruce's solution is almost identical to mine. We use different tables for the interface. I have one less TO in the TOG. Each have some advantages.
bruceR Posted February 26, 2005 Posted February 26, 2005 There are no blank records created when I run it. You aren't specifiying which table gets the blank records. You DO have to commit the patient record first before entering result entries. Also note that in the TestResults layout, I was using the wrong relationship to show patients. This isn't a polished or complete solution - just a very quick demonstration of the basic technique. Note that you could change the X relation to a different relation based on a global, so for instance you would show only test items for Type A or Type B or whatever.
Mark L Posted March 1, 2005 Author Posted March 1, 2005 BruceR- (I checking things out - I couldn't confirm where the blank record got created - it must have been from me playing around with things.) I really have been able to use your basic design as a model and incorporated it into my solution. I added an additional field to match records by (it's now PatientID AND LabDate) - and I added an additional field in the TestItems file called SortOrder. SortOrder is used in the portal to allow the user to choose the order of the TestResult records seen in the portal (As part of the initial Portal definition - I designate that SortOrder for sorting.) This probably is another "newbie" type question - but here goes: Any suggestions on how best to control the ability to protect a field from being edited in the portal? In fact I'll break it into two related issues: 1) I don't want someone to be able to edit a given field that appears in the portal - but of course, I do want it editable in it's "native" maintenance screen. 2) I'd love to be able to toggle on/off the access to my SortOrder field in the portal - to prevent someone from changing it inadvertently. Any and all thoughts are greatly appreciated. Thank you one and all
-Queue- Posted March 1, 2005 Posted March 1, 2005 You can disable access to a field in a portal and it will not effect the field's formatting in another layout.
Mark L Posted March 1, 2005 Author Posted March 1, 2005 -Queue- You can disable access to a field in a portal and it will not effect the field's formatting in another layout. I apologize for a completely ignorant follow-up question: Where do I configure this function? Thanks, Mark
-Queue- Posted March 1, 2005 Posted March 1, 2005 Right-click on any field and select Field Behavior. You can enable or disable a field's access in Browse and Find Modes.
Mark L Posted March 1, 2005 Author Posted March 1, 2005 Thanks -Queue- - I found myself on this screen many times before - but stupidly didn't pay much attention to it - somehow the word "Browse" didn't click as the area where data entry takes place - pretty stupid, I know. Shows my brain isn't fully FMP-ized yet. Anyway, thanks to you, I've already made corrections to my layout. Follow-up question: Do you know of a way to toggle this functionality on and off via a script? Thanks again, Mark
-Queue- Posted March 1, 2005 Posted March 1, 2005 You can set a number field, call it Lock, with a zero or 1, disable access to the field, and format it as a button attached to a script that checks the value of Lock and goes to the field if it's 1 or halts the script if it's zero. You can also define such permissions in the Accounts & Privileges section.
Mark L Posted March 2, 2005 Author Posted March 2, 2005 Thanks -Queue- for you speedy response. OK - so for my simple mind I'll repeat back my understanding - and then point out the only thing I still don't quite grasp: 1) Create a field called Lock - Number as its Type - default value of "0". 2) Change the field I call "Sort" so no one can edit it - via "Field Behavior" in Layout mode. 3) Make Lock field into a button that calls a script. 4) The script checks the value of Lock field ("0" for no access or "1" for edit access) and "goes to the field" - this is where I lose you. I'm not sure what you mean by this. This is the point where I need to allow access to my field called "Sort" if the Lock field is a "1" - no? Sorry to be so long winded, but I'm just trying to understand. Much Thanks, Mark
-Queue- Posted March 2, 2005 Posted March 2, 2005 3) Make Sort, not Lock, a button attached to a script that checks If [not Lock] Go to Field [sort] End If You can add an Else if you want to show a message or something similar if the field is locked. Change Lock via script or on a Developer Only layout, etc. Set Field [Lock; Lock <> 1] which will toggle Lock between zero and 1.
Mark L Posted March 2, 2005 Author Posted March 2, 2005 -Queue- Worked like a charm! Thanks especially for teaching me how to toggle a field "on/off" Sincerely, Mark
mr_vodka Posted January 18, 2007 Posted January 18, 2007 I noticed the link by Ralph was broken so here is the updated link.
Recommended Posts
This topic is 6519 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now