Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

Expand
titleClick here to view examples...

Example 1: Age as of today 

Note

Note: If the "date of birth" value is blank for the participant, the query results would be blank.

Example 2: Age at collection

Note

Note:

  1. This expression only works for "parent (New)" specimens.

  2. If the "date of birth" value is blank for the participant, the query results would be blank.

Temporal Expression: "years_between( Specimen.extensions.SpecimenCollectionEvent.time, Participant.dateOfBirth) any"

Example 3: Age at collection

Note

Note:

  1. This expression works for specimens at any level (New, Derived, and Aliquot).

  2. If the "date of birth" value is blank for the participant, the query results would be blank.

Temporal Expression: "years_between( Specimen.spmnCollRecvDetails.collTime, Participant.dateOfBirth) any"

Example 4: Time difference between frozen and received time

Image RemovedImage Added

Example 5: Tissue specimens collected in the last 2 months

Example 6: Calculating the sample amount

Example 7: Count of specimens collected per month

Example 8: Count of specimens collected after a particular date

Example 9: Age in years (rounded off)

Example 10: Number of participants enrolled and parent samples entered per week.

Result view:

Note

Note: Select the count of participant and primary specimen in 'Aggregates' column to view the count in the result view.

Example 11: Finding percent from 2 numbers in custom form

In the above example, number1 and number2 are two numeric fields defined in a form attached at 'Registration Forms' level. There is no % function in temporal queries, but the formula to find percent can directly used to calculate the same. 

Example 12: Calculating the initial cell value from the volume processed and initial concentration, where the volume processed and initial concentration are specimen custom fields.

In the above expression,

  1. aj_specimen_form is the variable name of the custom form.

  2. initial_processing_volume and initial_cell_volume are the variable names of the volume processed and initial concentration custom fields.

Example 13: Average of 2 custom fields.

In the above expression,

  1. 'skin_cancer_registration_custom_field_form' is the variable name of the form name.

  2. ‘number_field_1' and 'number_field_2’ are variable names of the custom fields.

  3. The CP (e.g. 'Skin Cancer Study') must be selected, for custom forms and fields.

...

Expand
titleClick here to view expressions

Expression

Description

Date Range

date_range(Specimen.createdOn, last_cal_qtr, 2)

Specimens created in last 2 calendar quarters

1st July 2016 00:00 to 31st December 2016 23:59

date_range(Specimen.createdOn, last_qtr, 2)

Specimens created in last 2 quarters

1st September 2016 00:00 to 28th February 2017 23:59

date_range(Specimen.createdOn, last_cal_month, 3)

Specimens created in last 3 calendar months

1st December 2016 00:00 to 28th February 2017 23:59

date_range(Specimen.createdOn, last_month, 3)

Specimens created in last 3 months

15th December 2016 00:00 to 14th March 2017 23:59

date_range(Participant.regDate, today)

Participants registered today

15th March 2017 00:00 to 15th March 2017 23:59

date_range(Participant.regDate, yesterday)

Participants registered yesterday

14th March 2017 00:00 to 14th March 2017 23:59

date_range(Participant.regDate, last_days, 10)

Participants registered in last 10 days

5th March 2017 00:00 to 14th March 2017 23:59

date_range(Participant.regDate, current_week)

Participants registered this weekin current week that is from ‘Sunday to Saturday'. If a query is run in the middle of the week, it will give results from 'Sunday to the current day’.

12th March 2017 00:00 to 18th March 2017 23:59

date_range(Participant.regDate, last_week, 2)

Participants registered in last 2 weeks

26th February 2017 00:00 to 11th March 2017 23:59

...