Skip to content

Commit

Permalink
Merge branch 'master' into remember-registration-details
Browse files Browse the repository at this point in the history
  • Loading branch information
martinburchell committed Apr 9, 2024
2 parents 0090716 + 2f352f9 commit 4fc2ed6
Show file tree
Hide file tree
Showing 11 changed files with 480 additions and 292 deletions.
9 changes: 9 additions & 0 deletions .github/scripts/report_missing_client_translations.sh
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

# Run from .github/workflows/report-missing-client-translations.yml

set -euxo pipefail

PYTHON=${HOME}/venv/bin/python
${PYTHON} ${GITHUB_WORKSPACE}/tablet_qt/tools/build_client_translations.py all
${PYTHON} ${GITHUB_WORKSPACE}/tablet_qt/tools/build_client_translations.py missing
46 changes: 46 additions & 0 deletions .github/workflows/report-missing-client-translations.yml
@@ -0,0 +1,46 @@
---
# yamllint disable rule:line-length
name: Report missing client translations
# yamllint disable-line rule:truthy
on:
push:
paths:
- .github/scripts/python_setup.sh
- .github/scripts/report_missing_client_translations.sh
- .github/workflows/report-missing-client-translations.yml
- 'tablet_qt/**.cpp'
- 'tablet_qt/**.h'
- tablet_qt/tools/build_client_translations.py
- tablet_qt/translations/*.ts

env:
# Keep in sync with tablet_qt/qt_version.txt. We check this further down.
QT_VERSION: 6.5.3
jobs:
report-missing-client-translations:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Qt version check
run: |
set -euxo pipefail
test "${{ env.QT_VERSION }}" == "$(cat ${GITHUB_WORKSPACE}/tablet_qt/qt_version.txt)"
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: "==3.1.*"
version: ${{ env.QT_VERSION }}
host: linux
target: desktop
arch: gcc_64
archives: "qtbase qtdeclarative qttools qttranslations icu"
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Report missing client translations
run: |
set -euxo pipefail
ls ${Qt6_DIR}/lib
${GITHUB_WORKSPACE}/.github/scripts/python_setup.sh
${GITHUB_WORKSPACE}/.github/scripts/report_missing_client_translations.sh
7 changes: 7 additions & 0 deletions docs/source/changelog.rst
Expand Up @@ -3884,6 +3884,13 @@ Current C++/SQLite client, Python/SQLAlchemy server
- Additional optional LGPL licensing for some Qt height-for-width layout code
to make it suitable for inclusion in libraries elsewhere.

- Fix bug where the upload icon would remain visible if the activity log were enabled and
the upload failed.
https://github.com/ucam-department-of-psychiatry/camcops/issues/341

- Make it easier to turn on error logging in the event of a network operation failure.
https://github.com/ucam-department-of-psychiatry/camcops/issues/336

- The Patient Registration Dialog now displays the server URL and access key for
the previous registration, if available. This should reduce the amount of data
entry needed following a network or registration failure.
Expand Down
3 changes: 2 additions & 1 deletion docs/source/developer/_build_client_translations_help.txt
Expand Up @@ -41,7 +41,8 @@ Operations:

POSITIONAL ARGUMENTS:
operation Operation to perform; possibilities are ['po2ts',
'update', 'ts2po', 'release', 'poedit', 'all']
'update', 'missing', 'ts2po', 'release', 'poedit',
'all']

OPTIONS:
-h, --help show this help message and exit
Expand Down
75 changes: 75 additions & 0 deletions docs/source/tasks/eq5d5l.rst
Expand Up @@ -35,6 +35,7 @@ patient is asked to rate their health on a scale of 0 to 100.
EQ-5D-5L evolved from EQ-5D-3L, as the five level classifier provided greater
discriminative ability and more power to detect differences between groups.


History and guide
~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -64,11 +65,13 @@ More on scoring:

- https://en.wikipedia.org/wiki/EQ-5D#Valuation_process


Source
~~~~~~

See https://euroqol.org/support/how-to-obtain-eq-5d/.


Intellectual property rights
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -90,3 +93,75 @@ As per https://euroqol.org/support/how-to-obtain-eq-5d/ (accessed 2018-10-25):
As a result, the EQ-5D-5L scale itself is **not** included in CamCOPS, though
its content may be added if you have the necessary permissions and scale, as
above.

Update, 28 Mar 2022 (email to a subscriber, footnotes added for hyperlinks and
Internet Archive versions used for URLs):

.. code-block:: none
EuroQol | 28 Mar 2022 View online [1]
Dear [XXX],
As indicated in our email from early January this year, the EuroQol Research
Foundation is pleased to announce that from 6 April 2022, the current
offering of three digital formats of EQ-5D (Smartphone/PDA, Tablet, and
Laptop/Desktop) will be replaced by one new digital format that can be used
on any digital device. From this date onwards, you can request the new
digital formats of EQ-5D via the online registration form. Requested EQ-5D
versions will be delivered via the new EuroQol Customer Portal.
With the introduction of the new digital EQ-5D format, an updated version of
the User License Policy will come into effect as of 6 April 2022 – see here
[2].
* For commercial customers, a new license fee structure is introduced for
the new digital EQ-5D format.
* For non-commercial customers interested in collecting data digitally on an
unsupported platform, the Fast Track – Digital registration route is
introduced; see here [3] for more information.
As part of the introduction of the new digital format, we are rolling out a
library of EQ-5D Representations, which consists of EuroQol Office–approved
EQ-5D screenshots of the new digital EQ-5D versions. The library consists of
EQ-5D-3L, EQ-5D-5L, and EQ-5D-Y Representations of all available languages.
Representations from this library will be made available to registered
customers for all requested EQ-5D versions and languages via our EuroQol
Customer Portal, together with the requested EQ-5D labels and EuroQol’s
Digital Representation Design Guidelines.
The EuroQol Office–approved Representations will enable customers and
vendors to check that their digital implementation of EQ-5D conforms to
EuroQol’s Digital Representation Design Guidelines. Moreover, as we are
providing these Representations for all available languages, customers can
also verify the correct placement of all EQ-5D labels. This means that from
6 April 2022, customers will be solely responsible for checking the
correctness of all digital EQ-5D implementations. Screenshot review by the
EuroQol Office team will no longer be mandatory. However, as a service, the
Office team will continue to do screenshot reviews on request.
Lastly, the EuroQol Research Foundation will continue with making EQ-5D
available free for non-commercial use, after registration. As screenshot
review is no longer required, a screenshot review fee will no longer be
charged to non-commercial customers who collect data on unsupported digital
platforms (i.e. on platforms other than REDCap, LimeSurvey, Qualtrics, or
Castor EDC); see here [3] for more information.
For more information and FAQs, please see here [3].
If you have any questions, please contact the EuroQol Office at
digitaldatacollection@euroqol.org.
Best wishes,
Bernhard Slaap. PhD
Executive Director
EuroQol Research Foundation
[1] https://mailchi.mp/euroqol/switch-to-a-universal-digital-format-14921174 or
https://web.archive.org/web/20240328124540/https://mailchi.mp/euroqol/switch-to-a-universal-digital-format-14921174

[2] https://web.archive.org/web/20220809230231/https://euroqol.org/wp-content/uploads/2022/03/EQ-5D-User-License-Policy-06APR2022.pdf

[3] https://web.archive.org/web/20220517170036/https://euroqol.org/support/digital-data-collection/
2 changes: 1 addition & 1 deletion server/setup.py
Expand Up @@ -103,7 +103,7 @@
"pdfkit==1.0.0", # wkhtmltopdf interface, for PDF generation from HTML
"phonenumbers==8.12.30", # phone number parsing, storing and validating
"pycap==1.1.1", # REDCap integration
"Pillow==10.2.0", # used by a dependency; pin for security warnings
"Pillow==10.3.0", # used by a dependency; pin for security warnings
"Pygments==2.15.0", # Syntax highlighting for introspection/DDL
"pyexcel-ods3==0.6.0", # ODS spreadsheet export
"pyexcel-xlsx==0.6.0", # XLSX spreadsheet export
Expand Down
74 changes: 55 additions & 19 deletions tablet_qt/core/camcopsapp.cpp
Expand Up @@ -521,12 +521,8 @@ void CamcopsApp::patientRegistrationFailed(
break;
}

uifunc::alert(
QString("%1\n\n%2").arg(base_message, additional_message),
tr("Error")
);

recreateMainMenu();
maybeRetryNetworkOperation(base_message, additional_message,
NetworkOperation::RegisterPatient);
}


Expand Down Expand Up @@ -556,7 +552,8 @@ void CamcopsApp::updateTaskSchedulesFailed(
handleNetworkFailure(
error_code,
error_string,
tr("There was a problem updating your task schedules.")
tr("There was a problem updating your task schedules."),
NetworkOperation::UpdateTaskSchedules
);
}

Expand All @@ -582,7 +579,8 @@ void CamcopsApp::uploadFailed(const NetworkManager::ErrorCode error_code,
handleNetworkFailure(
error_code,
error_string,
tr("There was a problem sending your completed tasks to the server.")
tr("There was a problem sending your completed tasks to the server."),
NetworkOperation::Upload
);
}

Expand Down Expand Up @@ -636,7 +634,8 @@ void CamcopsApp::retryUpload()

void CamcopsApp::handleNetworkFailure(const NetworkManager::ErrorCode error_code,
const QString& error_string,
const QString& base_message)
const QString& base_message,
CamcopsApp::NetworkOperation operation)
{
QString additional_message = "";

Expand Down Expand Up @@ -664,14 +663,51 @@ void CamcopsApp::handleNetworkFailure(const NetworkManager::ErrorCode error_code
break;
}

uifunc::alert(
maybeRetryNetworkOperation(base_message, additional_message, operation);
}


void CamcopsApp::maybeRetryNetworkOperation(const QString base_message,
const QString additional_message,
CamcopsApp::NetworkOperation operation)
{
const bool try_again_with_log = uifunc::confirm(
QString("%1\n\n%2").arg(base_message, additional_message),
tr("Error")
tr("Error"),
tr("Try again with error log"),
TextConst::cancel()
);

recreateMainMenu();
if (!try_again_with_log) {
recreateMainMenu();

return;
}

enableNetworkLogging();

switch (operation) {
case NetworkOperation::RegisterPatient:
registerPatientWithServer();
break;

case NetworkOperation::UpdateTaskSchedules:
// it doesn't matter if we pass alert_unfinished_tasks as True or False
// here. We wouldn't be here if there were unfinished tasks.
updateTaskSchedules();
break;

case NetworkOperation::Upload:
upload();
break;

default:
// Shouldn't get here
break;
}
}


TaskSchedulePtrList CamcopsApp::getTaskSchedules()
{
TaskSchedulePtrList task_schedules;
Expand Down Expand Up @@ -3215,14 +3251,14 @@ void CamcopsApp::upload()
return;
}

const bool single_user_mode = isSingleUserMode();
const bool logging_network = isLoggingNetwork();
reconnectNetManager(
single_user_mode ? &CamcopsApp::uploadFailed : nullptr,
single_user_mode ? &CamcopsApp::uploadFinished : nullptr);
// ... no failure handlers required in clinician mode -- the NetworkManager
// will not be in silent mode, so will report the error to the user
// directly. (And similarly, we didn't/don't need a "finished" callback in
// clinician mode.)
logging_network ? nullptr : &CamcopsApp::uploadFailed,
logging_network ? nullptr : &CamcopsApp::uploadFinished);
// ... no failure handlers required when displaying the network log --
// the NetworkManager will not be in silent mode, so will report the error
// to the user directly. (And similarly, we didn't/don't need a "finished"
// callback in with the logbox enabled.)

showNetworkGuiGuard(tr("Uploading..."));
networkManager()->upload(method);
Expand Down
13 changes: 12 additions & 1 deletion tablet_qt/core/camcopsapp.h
Expand Up @@ -237,9 +237,20 @@ class CamcopsApp : public QApplication
// For single user mode, register patient if not already done so
void maybeRegisterPatient();

enum class NetworkOperation {
RegisterPatient,
UpdateTaskSchedules,
Upload
};

void handleNetworkFailure(const NetworkManager::ErrorCode error_code,
const QString& error_string,
const QString& base_message);
const QString& base_message,
CamcopsApp::NetworkOperation operation);

void maybeRetryNetworkOperation(const QString base_message,
const QString additional_message,
CamcopsApp::NetworkOperation operation);

bool userConfirmedRetryPassword() const;
bool userConfirmedDeleteDatabases() const;
Expand Down

0 comments on commit 4fc2ed6

Please sign in to comment.