54.1.6 Detail Report: Input Form: Master Query: General Query
General Query or Date Time Stamp Query
If you click on either radio button the appropriate form will display. You will also be warned that you will lose settings in other areas of this form.
This area is the same as seen in other parts of STATIC. We refer you to the Query section of this manual in order to compose your Query: Query Store: Input Form on page 429
Function of the Master Query page
Using a Master Query reduces the workload for your Report by establishing Sets of records that may be used many times by a later Slave Query.
Any Set of records that will be used multiple times on the Report should be evaluated here.
The Master Query area is evaluated once right at the start of Report execution. This means any Sets established here will be available to all other Slave Queries on the Report.
You do not necessarily need to define anything in the Master Query area - in this case all Queries must be performed by the Slave Queries. This may be appropriate if there is no common Set of Records required by the Slave Queries.
Just to emphasize, the most important Query is the Slave Query - it is in the Slave Query that the actual record selection that will be used to generate output is established.
We try to make STATIC elements reusable within the database. However, any Query defined here will be saved exclusively for use within the Report. It will not be available in the Query Store area. If you want to make your Query available for use in other Reports or Queries then you can of course export the Master Query into a document and then Import it into another Query area. Or, alternatively, you can load a Query from the Query Store area into the Master Query area of the Report.
Sharing of Queries between Reports
Queries contain Sets and Place Holders. Sharing of Queries between and within Reports could cause problems, if a Set or Place Holder happens to have the same name as one already defined in the Report. In order to avoid this, the Report area has a sophisticated tracking system that automatically renumbers any Sets or Place Holder so that they do not clash.
The Query command is the ONLY command in the Master and Slave Query area for which you can define a Place Holder. This allows you to create a Query that could look like this:
QUERY [HospitalRecord] AND [HospitalRecord]Adm_Date >= <Adm_Date_1>
Notice the Placeholder <Adm_Date_1> at the end of the line.
All placeholders are bracketed by the < and > sign. Use the Set to be Place Holder Button and Clear Place Holder Button to control the Setting and Clearing of the Place Holder.
At execution time the placeholder is replaced by an actual value derived from the Place Holder page. If you have a Query as defined above then the Place Holder page may be as follows:
When the report executes, the <Adm_Date_1> will be replaced by 01/07/1997. See Detail Report: Input Form: Place Holders page on page 359 for more details.
We have not given you the option of setting Place Holders for the Query By Formula command. It was deemed too problematic. There is less control over the precise contents of a formula. This would lead to frustrating errors which would be very difficult to track down.
Note: You must know a little about the organization of data in STATIC to make effective use of this Report. You must understand the following concepts:
Master Table - The table for which you are trying to create a selection.
Current selection - This is the selection of records created for the Master Table by the Query.
Related Tables - These are Tables that your Master Table has a relation to.
In STATIC the relations you need to remember are as below:
A Table to the left of another Table is termed the ONE Table the table to the right is called the MANY Table.
Thus a single HospitalRecord Table (ONE TABLE) record has many ICURecord Table (MANY Table) records related to it. And a single ICURecord Table (ONE Table) record has many Location Table (MANY Table) records related to it.
Note that the BedState and many other Tables have no relation to any other table.
|