Leave a comment at the end of this page or email contact@krishagni.com
Calculated fields (Temporal Queries)
Often one needs to perform queries based on calculated fields of dates or number fields.
Examples:
Difference between collection time and date of birth (age at collection)
Difference between collection time and received time (warm ischemia time)
Difference between frozen time and received time
All specimens collected "today", "last week" or "last month"
This page describes the way to do it and different options available. For video training session, please refer to Wiki page Temporal Query (Video)
Creating a new temporal query
Info: Attribute names, functions, and operators are auto-completed once you start to type in the temporal expression window.
Demonstration of a Temporal Query:
Temporal functions
Examples of temporal queries
Parameterized Temporal Filter
Temporal filters can be parameterized so that users can enter a range to dynamically filter the results. Below operators can be used in the temporal expression to make it parameterized:
Exists: to specify existence condition like age exists
Any: to specify don't care condition like age any
Date Range Temporal Filters Illustration
Assuming the present date as 15th March 2017
Calculated URLs
From v10.2 onwards, it is possible to configure URLs using temporal expression.
For the test server URL of participant overview page 'https://test.openspecimen.org/#/cp-view/6636/participants/176857/detail/overview', you need to configure the temporal expression as 'concat("https://test.openspecimen.org/#/cp-view/ " ,CollectionProtocol.id, "/participants/" ,Participant.id , "/detail/overview") != " "
For visit overview page URL https://test.openspecimen.org/#/cp-view/6636/participants/176857/visits/detail/overview?visitId=130492 you need to configure the temporal expression as concat("https://test.openspecimen.org/#/cp-view/" ,CollectionProtocol.id, "/participants/" ,Participant.id, "/visits/detail/overview?visitId=", SpecimenCollectionGroup.id) != " "
Below is the list of fields that are available to be used in the query
Field | Syntax |
Collection Protocol Identifier | CollectionProtocol.id |
Participant Registration Identifier | participant.id |
Participant Identifier | Participant.participantId |
Visit Identifier | SpecimenCollectionGroup.id |
Specimen Identifier | Specimen.id |
Leave a comment at the end of this page or email contact@krishagni.com