Unit 10Record Check Footnote 1

Selecting records based on the record having two different values in a multiple

The record check (RC) footnote is a useful tool which allows you to add another filter to the selection process of a report. It is evaluated before a record prints and if the expression entered at this footnote is true (returns a value), the record is included on a report. If the expression is false (returns nil), then the record is suppressed from the report. This is very useful when you need to suppress records based on criteria which cannot be designed into the regular selection process.

Example 1:SCH.APPT – Print patient appointments only when the patient has had two or more NO SHOW appointments for the selected date range.

Report Setup

General Page:

The report is set up using the detail segment of main. It also has an index file, date.time.x, for selection purposes.

Sort/Select Page:

The report is set up with a KEY header and trailer on the mri.urn field. This will group the appointments selected by the patient (person), not the patient visit.

The report is selecting on the ‘date’ field which is the reason for the index file choice on the General Page.

Picture Page:

The HK1 region has the patient’s.name field and the patient’s.unit.number. The D region contains the fields specific to the detail segment such as the appointment date, status, and account number.

Example Report Output (without Record Check). Prints all NO SHOW appointments for the selected date range:

The Z.count field is computed and printed on the TK1 region, therefore a line check CANNOT be used on the previous HK1 and D region to condition those regions to print based on the TK1 line values. The solution to suppressing the patients where there is only one NO SHOW visit is to use the Record Check.

The General Page of the report can remain the same.

Sort/Select page using the Record Check solution:

Add xx.sort as the primary sort field to the Sort section of the report. This will move the mri.urn sort field to the second sort field, changing the picture to use an HK2 and TK2 region.

Picture Page: The actual picture will remain the same. The xx.sort field must be created on the Picture page using the following attributes:

This computed field will create a temp array with a total count for how many NO SHOW appointments the patient has had in the selected date range. The subscript of the temp array will be the mri.urn field. Once the temp array is populated, so that this field does not affect the sort order output, both the true statement and the false statement of this computed field return a 1. Therefore, this field isn’t used to “sort” data, it is just added to the sorts as that is the logical place in the report code to populate the temp array.

Here is an example of what the /NOSHOW temp array would store:

/NOSHOW[“M1122”]= 2
/NOSHOW[“M1452”]= 5
/NOSHOW[“M1542”]= 1
/NOSHOW[“M1165”]= 3
/NOSHOW[“M1345”]= 2
/NOSHOW[“M1754”]= 1

Footnotes: Add the RC (Record Check Footnote)

RC /NOSHOW[@mri.urn]>1

By adding the above code to the Footnotes tab of the report, this will only print records where the /NOSHOW temp array is greater than 1. Therefore, this is the part of the report where you are conditioning the data to print.

Report Output with Record Check:


Example 2: BAR.PAT selecting patients that have multiple procedure codes.

Account number: V0000000001 Name: Roberts, Bob

Procedures: 1002

84176

30601050

399283

30500020

1011124

We have often received requests to select records based on two different values from a multiple. In the example above, we want to select patients who have procedures 30601050

and 30500020. This may appear to be an easy task from looking at the above data, but each of these procedures is within a different transaction. When a report selects records, it processes each transaction individually. We want to only select the transactions if the patient has both of these procedures.

Methods of selecting records:

  • Standard select conditions evaluate each value individually
  • Using the LI operator or EQ operator with an OR select relationship will select records which have one or the other value as well as those which have both.

If we were to use an LI operator and enter both of these procedures, the report would select the records we want, but also include records which only have one of these procedures. The same result would occur if we were to set up two select fields using the EQ operator and apply an OR (!) select relationship between them. The goal is to eliminate those records which only have one of these values. This is easily accomplished through the use of arrays and the RC (Record Check) footnote.

To select those records which have both values, we create two arrays during the selection process and use the RC footnote to check if the record has a value in both arrays prior to printing. This provides us with the ability to filter out additional records prior to printing. The following example provides you with the steps to accomplish this goal.

1. Choose the proper detail segment to provide you access to the data

You must determine which segments stores the values you want to check. In our example, we want to check the transaction procedures so we need to select the detail segment where the transactions are stored. This allows the report to loop through this data structure and provides you with the ability to reference the data fields within this segment.

2. Set up a computed sort field to build your arrays

Create a computed select field to set up two arrays based on the records having one or the other procedure. We use a computed field which will be evaluated during selection to load values into the arrays. This provides us with the ability to store a list of records which have the procedures we want to include.

The computed select field accomplishes the following tasks:

  • The computed sort field sets up two arrays, one for each procedure.
  • The computed field always returns a value of 1 so all records are sorted the same.
  • The arrays are subscripted by account to store the accounts which have each of the procedures.

3. Add xx.sort as the primary sort of your report

The computed sort field is really a "mock" sort field because it is designed to sort all records with a 1. This field always returns a value of 1 as its output and therefore sorts each transaction processed the same. However, it is building two slash arrays named /PROC1 and /PROC2. Each array is built based on satisfying one of the two procedures. We store the account as the subscript for each array because if a patient has procedure 30601050, then the account urn is stored in the /PROC1 array. If the patient has procedure 30500020, then the account urn is stored in /PROC2 array. Once the records are selected, we may have two arrays appear as follows:

/PROC1[2186]
/PROC1[2315]
/PROC1[2455]
/PROC1[2659]

/PROC2[1842]
/PROC2[2186]
/PROC2[2256]
/PROC2[2338]
/PROC2[2455]
/PROC2[2565]

Notice that only account urn's 2186 and 2455 exist in both arrays. These are the records we want to select on the report.

4. Reference your arrays in the record check footnote

We use the Record Check footnote to provide a final filter prior to printing the records. The RC footnote works similar to a line check, but has one distinct difference. A line check suppresses a record from printing, but the record is still included in report totals. A record check suppresses the record from the report and acts as another select condition.

  • Changing the sort to use a temporary file (adding xx.sort) makes the report select and sort all records before printing.
  • The record check footnote will evaluate each record prior to printing. If the record passes the record check, it is included on the report.
  • All charge transactions for the account will be included if the account passes the RC.

A record which fails the record check is not included in the report totals. The record check footnote above states that the account must exist within both arrays. Since we used the account urn as the subscript and we selected all transactions, we still have access to print all of the transactions for the accounts which pass the record check.

If the patient had both of the procedures, the code above will return a 1 to the record check since the value of /PROC1[account] and the value of /PROC2[account] will be 1. If the patient only had one of these procedures or none of these procedures, then the value of the record check will be nil since they will not have a value in one or more of the arrays.

Workshop - Part C

Access the report you created this morning.

Assignment

Add a RC footnote to the report to only print patients that had more than one visit in the date range you are running the report for.

Notes:

  1. The field mri.urn stores the patient’s internal medical record number and can be used to check if the patient has more than one visit.
  2. As in the example we went through together in class, you will need to use a sort field to check if the patient had more than one visit.

MEDITECH

Level Two - NPR Report Writer Workshop