From e6f5842150eec0aac82266cf857ff92a2e330800 Mon Sep 17 00:00:00 2001 From: Prajwol Shrestha Date: Wed, 2 Aug 2023 22:50:22 +0545 Subject: [PATCH 1/2] Documentation update for the newly added uniquePhone validation --- content/en/apps/reference/app-settings/_index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/en/apps/reference/app-settings/_index.md b/content/en/apps/reference/app-settings/_index.md index 062295f30..2f7b46d77 100644 --- a/content/en/apps/reference/app-settings/_index.md +++ b/content/en/apps/reference/app-settings/_index.md @@ -223,6 +223,7 @@ matches "mary", "Mary", "john", "John", "JOhN", etc. Not "maryjohn" | Function | Description | |----|----| | `unique(*fields)` | Returns `true` if no existing valid report has the same value for all of the listed fields. Fields are compared to those at the top level and within `fields` for every report doc. To include the form type use `'form'` as one of the fields. Eg `unique('form', 'patient_id')` checks that this form was never submitted for this patient. | +|`uniquePhone(phone_number field)`| Returns `true` if contact with the phone number already exists.| | `uniqueWithin(*fields, time_period)` | Same as `unique` but the last argument is the time period in which to search. Eg `uniqueWithin('form', 'patient_id', '1 week')` checks that the same form wasn't submitted for this patient in the past week. | | `exists(form_id, field)` | Returns `true` if a report matches the `form_id` and value for `field`. This is useful to check that a patient was registered for a service before reporting about it. Eg `exists('REG', 'patient_id')` checks that a `REG` form was already submitted for a patient. As of 2.12 most uses of this function are obsolete because checking for a valid `patient_id` is done automatically by the `accept_patient_report` transition using `registration_not_found` in the `messages.event_type`. | | `isISOWeek(weekFieldName[, yearFieldName])` | Returns `true` if the current report has a week value that is less or equal to the number of ISO weeks of the current year or the year value of the same report. The first parameter is the field name for the week and the second parameter is the field name for the year: `isISOWeek('week', 'year')`. If the second parameter is not specified, then the current year is used: `isISOWeek('week')`. | From 39f8558167ab18fcb4976eb16e9c72cf12deb887 Mon Sep 17 00:00:00 2001 From: Prajwol Shrestha Date: Thu, 3 Aug 2023 21:47:50 +0545 Subject: [PATCH 2/2] Update release tag suggestion Co-authored-by: Gareth Bowen --- content/en/apps/reference/app-settings/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/apps/reference/app-settings/_index.md b/content/en/apps/reference/app-settings/_index.md index 2f7b46d77..ad36a7ccc 100644 --- a/content/en/apps/reference/app-settings/_index.md +++ b/content/en/apps/reference/app-settings/_index.md @@ -223,7 +223,7 @@ matches "mary", "Mary", "john", "John", "JOhN", etc. Not "maryjohn" | Function | Description | |----|----| | `unique(*fields)` | Returns `true` if no existing valid report has the same value for all of the listed fields. Fields are compared to those at the top level and within `fields` for every report doc. To include the form type use `'form'` as one of the fields. Eg `unique('form', 'patient_id')` checks that this form was never submitted for this patient. | -|`uniquePhone(phone_number field)`| Returns `true` if contact with the phone number already exists.| +| `uniquePhone(field)` | Returns `true` if contact with the phone number already exists. _Added in 4.3.0_ | | `uniqueWithin(*fields, time_period)` | Same as `unique` but the last argument is the time period in which to search. Eg `uniqueWithin('form', 'patient_id', '1 week')` checks that the same form wasn't submitted for this patient in the past week. | | `exists(form_id, field)` | Returns `true` if a report matches the `form_id` and value for `field`. This is useful to check that a patient was registered for a service before reporting about it. Eg `exists('REG', 'patient_id')` checks that a `REG` form was already submitted for a patient. As of 2.12 most uses of this function are obsolete because checking for a valid `patient_id` is done automatically by the `accept_patient_report` transition using `registration_not_found` in the `messages.event_type`. | | `isISOWeek(weekFieldName[, yearFieldName])` | Returns `true` if the current report has a week value that is less or equal to the number of ISO weeks of the current year or the year value of the same report. The first parameter is the field name for the week and the second parameter is the field name for the year: `isISOWeek('week', 'year')`. If the second parameter is not specified, then the current year is used: `isISOWeek('week')`. |