Jump to content

Separate multi-line records in a table visually


mdlivels

Recommended Posts

I’m using a mutli-line data set with a table and simply would like to add a separator between records (I’m listing patients for a particular provider) but can’t figure it out. Is there something simple I’m missing?

 

Here’s the code I’m currently using, but this has borders all around, and I’d like some indicator when records change (patient). FP 10.0.03, PC, Producer w/6 concurrent licenses. I cannot show data as it is protected health information.

 

 

 

var table = new FPTable();

table.AddColumns(7000,8000,8000,6000,6000,6000,30000);

var header = table.AddRow();

header.Type = 'Header';

header.Cells[0].Font = 'Open Sans Condensed';

header.CopyCells(0,1,2,3,4,5,6);

header.SetContents ("MEMBER NO.", "LAST NAME", "FIRST NAME", "GENDER", "DOB", "ICD10", "ICD10 CODE DESCRIPTION");

 

var data = FusionPro.GetMultiLineRecords();

for (var rec = 1; rec <= data.recordCount; rec++)

{

function ExField(str) { return TaggedTextFromRaw(data.GetFieldValue(rec, str)); }

var content = ["MEMBER_NBR","LAST_NAME","FIRST_NAME","GENDER", "DOB", "SUSPECT_CODE_ICD10","ICD10_CODE_DESCRIPTION"].map(ExField);

var row = table.AddRow();

row.SetContents.apply(row, content);

}

return table.MakeTags();

Link to comment
Share on other sites

I cannot show data as it is protected health information.

Could you provide some dummy data? It's hard to modify your rule and test the results with no data at all. And if this really is a multi-line record job, it's hard to know how the data is being handled without seeing the FusionPro template, especially the criteria specified for starting a new record in the Define Data Source dialog.

I’m using a mutli-line data set with a table and simply would like to add a separator between records (I’m listing patients for a particular provider) but can’t figure it out. Is there something simple I’m missing?

I'm not sure I understand. Technically, you wouldn't put a separator between records, as the entire table is generated from a single record, and goes into its own output record, even if that record comes from a multi-line record in your data.

 

Do you mean you want to put a separator between each line?

 

Or do you mean that, within the multi-line record data, there are some lines which are grouped into sub-records? (Again, this is where having some data would make it easier to help.) And if so, what is it that determines where a sub-record is that should be separated?

 

Assuming the latter, and that you want to separate a new sub-record when the "MEMBER_NBR" field changes, I think you can do something like this:

var table = new FPTable();
table.AddColumns(7000,8000,8000,6000,6000,6000,30000);
var header = table.AddRow();
header.Type = 'Header';
header.Cells[0].Font = 'Open Sans Condensed';
header.CopyCells(0,1,2,3,4,5,6);
header.SetContents ("MEMBER NO.", "LAST NAME", "FIRST NAME", "GENDER", "DOB", "ICD10", "ICD10 CODE DESCRIPTION");

var data = FusionPro.GetMultiLineRecords();
var lastRecordMemberNbr = "";
for (var rec = 1; rec <= data.recordCount; rec++)
{
 function ExField(str) { return TaggedTextFromRaw(data.GetFieldValue(rec, str)); }
 var thisRecordMemberNbr = ExField("MEMBER_NBR");
 var content = ["MEMBER_NBR","LAST_NAME","FIRST_NAME","GENDER", "DOB", "SUSPECT_CODE_ICD10","ICD10_CODE_DESCRIPTION"].map(ExField);
 var row = table.AddRow();
 row.SetContents.apply(row, content);
 if (thisRecordMemberNbr != lastRecordMemberNbr)
 {
   for(var c = 0; c < table.Columns.length; c++)
     row.Cells[c].SetBorders("Thin", "Bottom");
 }
 lastRecordMemberNbr = thisRecordMemberNbr;
}
return table.MakeTags();

But I'm just kind of typing this blind. I can't actually test that it works without the data and the criteria for a new record.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...