-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtext_search.lkml
33 lines (33 loc) · 1.75 KB
/
text_search.lkml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
dimension: search_string {
type: string
sql:
{% assign full_string = "" %}
{% if prompt_reason_for_study._parameter_value <> "'NO_SEARCH_CRITERIA_SPECIFIED'" %}
{% assign full_string = prompt_reason_for_study._parameter_value | remove: "'" | append: " within reason_for_study" %}
{% endif %}
{% if prompt_clinical_info._parameter_value <> "'NO_SEARCH_CRITERIA_SPECIFIED'" %}
{% if full_string <> '' %}
{% assign full_string = full_string | append: " AND " %}
{% endif %}
{% assign full_string = full_string | append: prompt_clinical_info._parameter_value | remove: "'" | append: " within clinical_info" %}
{% endif %}
{% if prompt_study_comments._parameter_value <> "'NO_SEARCH_CRITERIA_SPECIFIED'" %}
{% if full_string <> '' %}
{% assign full_string = full_string | append: " AND " %}
{% endif %}
{% assign full_string = full_string | append: prompt_study_comments._parameter_value | remove: "'" | append: " within study_comment" %}
{% endif %}
{% if prompt_report_text._parameter_value <> "'NO_SEARCH_CRITERIA_SPECIFIED'" %}
{% if full_string <> '' %}
{% assign full_string = full_string | append: " AND " %}
{% endif %}
{% assign full_string = full_string | append: prompt_report_text._parameter_value | remove: "'" | append: " within report_text" %}
{% endif %}
{% if prompt_any._parameter_value <> "'NO_SEARCH_CRITERIA_SPECIFIED'" %}
{% if full_string <> '' %}
{% assign full_string = full_string | append: " AND " %}
{% endif %}
{% assign full_string = full_string | append: prompt_any._parameter_value | remove: "'" %}
{% endif %}
'{{ full_string }}'
;;