Patient Snippets

/*This provides the patient search form for selecting a patient
  This is the preferred method of selecting a patient.*/

/*
<PARAMETERS>

<PATIENT
  FUNCTION="SELECT_PATIENT"
>
</PATIENT>

</PARAMETERS>
*/

...
where (pat_id = :Patient)
...
/*This provides a dropdown box of patient names.
  This method is useful when a restricted list of patients is required.
  Method also allows the report to run for either a single patient
  or all patients.*/

/*
<PARAMETERS>

<PATIENT
  STATEMENT="select full_name
                  , pat_id
             from patient
             union
             select cast('<All Patients>' as VarChar(40)) full_name
                  , cast(-1 as integer) pat_id
             from rdb$database"
  DEFAULT="<All Patients>"
>
</PATIENT>

</PARAMETERS>
*/

...
where (pat_id = :Patient
  or Cast(-1 as integer) = :Patient)
...