Jump to content

Is there a way to create a report when there are no line items (child records)?


This topic is 5904 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Hi folks. I print letters which are medical reports about patients. Usually I need to send a copy to other related practitioners - GP, etc.

I've set that up on a letter table - each letter has an ID, and then I create child records, one for each 'copy recipient'. Then I create a printed report, with the text of the letter appearing in the leading subsummary (sorted by letter ID), and the 'body' appearing at the bottom of the page (one or more lines of contacts under the heading "Copies to"). I print one copy for each 'copy to' plus one copy for the actual addressee.

That's coming out fine - but the problem is when I get a letter that doesn't have any 'copies to'. That is, the letter is just to the main addressee. In that case I haven't got anyone in the "copies to", so no child records are created, so I can't create the report and print the letter. I'm stuck!

Any advice on how to handle this? I thought of setting up a script to determine if the 'copies to' field was empty, and if so setting up a 'dummy' child record with that 'contact' having just empty spaces, and then deleting that copy later. It would result in a blank line under 'copies to' at the bottom of the letter, but at least I'd be able to print it.

Any comments or advice very much appreciated.

Edited by Guest
Made title a bit clearer.
Posted

That's coming out fine - but the problem is when I get a letter that doesn't have any 'copies to'. That is, the letter is just to the main addressee. In that case I haven't got anyone in the "copies to", so no child records are created, so I can't create the report and print the letter. I'm stuck!

I do not quite get this, why is extra records required here - isn't it a many to many relation?

--sd

Posted

I do not quite get this, why is extra records required here - isn't it a many to many relation?

--sd

I don't think so. One letter goes to several recipients. One recipient is the addressee, the rest are to interested parties that are concerned with that patient's care. They are treated differently - the addressee has their name and address up the top, with a "Dear Dr Bob", the people receiving copies have their names listed in small print at the bottom, under a heading "Copies to". The main addressee doesn't have their name appear in the "Copies to". It's a fairly standard medical letter format.

So - getting the addressee's address and name and Dear Dr Bob is all easy - that data resides in the Letter table and higher related tables. The trick is how to get the "Copies to" information down the bottom of the letter.

I had considered having a portal at the bottom of the page, but that's going to be wasting space - mostly there are one or two "copies to" recipients, but occasionally 4, and I'd probably have to make the portal have 5 rows just in case. So it would eat up a lot of space at the bottom.

Sounds like a perfect situation for a report, I thought. So each letter has child records, one for each "copy to". Sort by letter ID, and it comes out well.

But then I had to do a letter that had no "copies to" - it's just to Dr Bob. Suddenly it's like wanting to print an invoice with no line items selected - I can't see how to do it. The printing scripts are all about finding the associated child records and sorting by Letter ID, but there are no associated child records when the letter is going to just one person.

Does that make it clearer?

Posted

On reflection, I think I might understand your Many to Many comment now.

Yes, it's many to many. One letter can have many "copies to", one contact can have many letters copied to them. So "Copies to" is a line item join table - it is of instances of a letter being copied to a contact.

In fact, each patient has many contacts, and each contact might have many patients. For instance, a single doctor may see several dozen of my patients. So in actual fact there is a join table between patient and contact (the Contact Relationship - with a note of the relationship nature, such as GP, personal, etc).

To be very precise, the "Copies To" table is a join table between the Letter table and the Contact Relationship table.

I hope that makes it clearer.

Posted

Hi folks. I print letters which are medical reports about patients. Usually I need to send a copy to other related practitioners - GP, etc.

I've set that up on a letter table - each letter has an ID, and then I create child records, one for each 'copy recipient'. Then I create a printed report, with the text of the letter appearing in the leading subsummary (sorted by letter ID), and the 'body' appearing at the bottom of the page (one or more lines of contacts under the heading "Copies to"). I print one copy for each 'copy to' plus one copy for the actual addressee.

That's coming out fine - but the problem is when I get a letter that doesn't have any 'copies to'. That is, the letter is just to the main addressee. In that case I haven't got anyone in the "copies to", so no child records are created, so I can't create the report and print the letter. I'm stuck!

Any advice on how to handle this? I thought of setting up a script to determine if the 'copies to' field was empty, and if so setting up a 'dummy' child record with that 'contact' having just empty spaces, and then deleting that copy later. It would result in a blank line under 'copies to' at the bottom of the letter, but at least I'd be able to print it.

Any comments or advice very much appreciated.

Why aren't ALL letters going to copiesTo; with the original recipient being the first copyTo and any others added as necessary.

Posted

Why aren't ALL letters going to copiesTo; with the original recipient being the first copyTo and any others added as necessary.

It would make it easier - but that's not how medical (and other?) correspondence gets handled. Plus it's redundant and a waste of the space taken up by that line. It would look kind of silly having the addressee listed up the top AND the bottom.

I really want to stick to standard medical correspondence format, so that means the Copies To indicates only the people who get a 'copy' of the letter, not the 'original'. I feel sure I will be able to do it with Filemaker - but I can't quite see how right now.

Just to be clear, since this might only be standard format in Australia and it might be different elsewhere, a letter might look like this:

Dr Bob,

Bobtown.

24th December 2008.

Dear Dr Bob,

re: Mr Joe Bloggs (dob 21/07/1931)

Mr Bloggs has two heads. He is otherwise well.

I have asked him to see you for further investigation, with a view to removal of one or the other head (but not both).

Yours sincerely,

Dr Me.

Copies to:

Dr Kate, Katetown.

Dr Sam, Samville.

Mrs Joan Bluebottle, Goonland.

In my current solution, everything up to and including "Copies To" is in the leading subsummary part, and the body part is a single line with the name & address of the person getting a copy (rather than the original). That is, it's a line item.

Posted

I think you could easily print the letter from a layout of the Letters table, with the Cc recipients being listed in a portal or in a calculation field using the List() function.

BTW, printing issues aside, on a structural level your example has FOUR recipients, divided into two types: there's one To recipient and three Cc recipients. Your current method wouldn't allow you to have more than one To recipient, for example.

Posted

BTW, printing issues aside, on a structural level your example has FOUR recipients, divided into two types: there's one To recipient and three Cc recipients. Your current method wouldn't allow you to have more than one To recipient, for example.

Exactly. As I explained above, there is ALWAYS one and only one To recipient, and anywhere between 0 and 5 Cc recipients. The example I gave had 3 Cc recipients, but that was an example only. I have it working fine with 1-5 Cc recipients, but it fails when there are 0 Cc recipients.

I think you could easily print the letter from a layout of the Letters table, with the Cc recipients being listed in a portal or in a calculation field using the List() function.

Hmm - I'm not keen on a portal, unless it can be made to collapse, for the reasons I'd already explained above - ie, big waste of space.

However, using the List function is something new to me (being a beginner, I haven't got a good handle on what's available). From a cursory look at it, it looks like it might work. (?)

The "Copies To" are listed as multiple Contact Relationship ID numbers in a single field (they are chosen by a checkbox, so they are return delimited). I'm not really sure, but it looks like I might perhaps be able to create a layout from the Letters Table and get rid of the Copies To line items table, as you suggest, since (crucially) I think that field could be made to collapse out the white space. I'll have a fiddle with it. Thanks!

Posted

I'm not keen on a portal, unless it can be made to collapse, for the reasons I'd already explained above - ie, big waste of space.

While Comment probably was thinking of replacing the ¶ (pilcrow) with a comma and a space via a Substitute( - should you be aware of the existence of alternatives to present portalized stuff:

http://fmcollective.com/2007/08/29/pseudoportals-with-alternating-fill/

...but read the cautioning!!!

--sd

Posted

Comment probably was thinking of replacing the ¶ (pilcrow) with a comma and a space via a Substitute(

No, that wouldn't fit the prescribed format of a separate line for each Cc. I don't see why a simple portal set to slide up couldn't be used here.

I'm not really sure, but it looks like I might perhaps be able to create a layout from the Letters Table and get rid of the Copies To line items table

The decision whether such table is needed or not should be based on considerations which have nothing to do with the problems of printing. If, for example, you need to record the individual recipients' responses - you need the join table.

Posted

You say "exactly" as if you agree and understand, but then you disagree and go off in your original direction. You can get the results you want with the method proposed by (now) two people.

Posted

I don't see why a simple portal set to slide up couldn't be used here.

Well, there's the key, I think. I was working under the misapprehension that a portal couldn't be set to collapse the white space (Reduce Enclosing Part). No idea where I got that idea from. I've had a play with it, and the portal seems to collapse the unused space nicely, so I think that's problem solved.

Thanks for your help, everyone! :

This topic is 5904 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.