Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openemr fix telehealth signup locale #6413

Conversation

adunsulag
Copy link
Sponsor Member

Fixed up the verbiage and some problems with the telehealth live payment signup process. It was popping up an alert box with the paypal subscriber id and expected the patient to copy and remember that value for signup. This is most likely what was causing the multiple signup problems that users of the module were dealing with.

Broke the signup into three steps and provide progress status to the users as they signup. Better instructions on how to move to the next step are included in each process.

Added a check for the locale settings which should be setup to avoid
clinic problems.

Added instructions that the user needs to log out and log back in after
saving the telehealth settings.
Include instructions and the subscription id for the user to use when
they signup for the credentials.

Add a copy button and switch the alert of the subscription id to
actually show up in a success message info box.  Before the change the
user had limited understanding on how to proceed to the next steps in
the configuration system.
To make the signup process easier for users, we break the signup into
three steps with instructions.  We also add saving the paypal
subscription id so we can check if the paypal process has already
completed and been signed up.

We show progress to the user as they signup.
Fixed the paypal key coming back from Sherwin to be the right key value.
Fixed the conditions on the subscription id.
Comment on lines +16 to +23
use Comlink\OpenEMR\Modules\TeleHealthModule\Bootstrap;
use Comlink\OpenEMR\Modules\TeleHealthModule\TelehealthGlobalConfig;

$kernel = $GLOBALS['kernel'];
$bootstrap = new Bootstrap($kernel->getEventDispatcher(), $kernel);
$globalConfig = $bootstrap->getGlobalConfig();
$subscriptionId = $globalConfig->getGlobalSetting(TelehealthGlobalConfig::COMLINK_TELEHEALTH_PAYMENT_SUBSCRIPTION_ID) ?? '';
$isCoreConfigured = $globalConfig->isTelehealthCoreSettingsConfigured() === true;
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice.

Comment on lines +454 to +455
// timezone is not set in the $GLOBALS array oddly, not sure why, check against the database
$record = QueryUtils::fetchRecords("SELECT gl_name, gl_index, gl_value FROM globals WHERE gl_name=?", [self::LOCALE_TIMEZONE]);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I've seen this and meant to track it down.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know where it's occurring, just thought that might have been intentional. Didn't want to change anything in the globals though so close to the wire here so I just check against globals.

Comment on lines 41 to 47
$items[TelehealthGlobalConfig::COMLINK_VIDEO_REGISTRATION_API] = $credentials['registrationUri'];
$items[TelehealthGlobalConfig::COMLINK_VIDEO_TELEHEALTH_API] = $credentials['videoApiUri'];
$items[TelehealthGlobalConfig::COMLINK_VIDEO_API_USER_ID] = $credentials['ctsiOrgUid'];
$items[TelehealthGlobalConfig::COMLINK_VIDEO_API_USER_PASSWORD] = $cryptoGen->encryptStandard(trim($credentials['ctsiOrgPwd']));
$items[TelehealthGlobalConfig::COMLINK_VIDEO_TELEHEALTH_CMS_ID] = $credentials['ctsiOrgId'];
$items[TelehealthGlobalConfig::COMLINK_TELEHEALTH_PAYMENT_SUBSCRIPTION_ID] = $credentials['paypal_subscription_id'] ?? null;
// Save to globals table.
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend these default to empty string if undefined so exception won't get thrown by sequel engine for writing null values to this table.
Or put a null key/value check in foreach.
Sorry I missed that in my commits.

I'm testing this on my test jig for pass through of new array key from server.
Will let ya know

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@adunsulag
Copy link
Sponsor Member Author

@sjpadgett if this is working well, we can bring this in and I'll submit a PR for 7.0.1

@sjpadgett
Copy link
Sponsor Member

My change to sign up application was just one line to the src/Action/Credentials/RequestCredentialAction.php on Sherwins git project. I also fix autocomplete to be off in credentials twig.
The change:

if ($this->data['credentials']) {
            $args = json_decode($newCredentials, true);
            self::saveCustomerCredentials(
                $this->repository,
                $this->customerValidator,
                $this->logerFactory
            );
            // So module can reference as needed.
            $args['ctsiVBData']['paypal_subscription_id'] = $this->data['paypal_subscription_id'];
            return $this->twig->render($response, 'displaycredentials.twig', $args);
        }

So with this PR and bypassing the paypal api request in my test jig it works.
I say @juggernautsei needs to update and test this in v7.0.1 we'll be releasing.

Go ahead and bring in if you're ready

@adunsulag adunsulag merged commit aee650a into openemr:master Apr 26, 2023
22 checks passed
Copy link
Sponsor Member

@sjpadgett sjpadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job especially I like the copy/paste you added.

adunsulag added a commit to DiscoverAndChange/openemr that referenced this pull request Apr 26, 2023
* Add save and locale telehealth check instructions

Added a check for the locale settings which should be setup to avoid
clinic problems.

Added instructions that the user needs to log out and log back in after
saving the telehealth settings.

* Fix psr problems.

* Fix telehealth subscription signup.

Include instructions and the subscription id for the user to use when
they signup for the credentials.

Add a copy button and switch the alert of the subscription id to
actually show up in a success message info box.  Before the change the
user had limited understanding on how to proceed to the next steps in
the configuration system.

* Improve signup verbiage, add subscription id

To make the signup process easier for users, we break the signup into
three steps with instructions.  We also add saving the paypal
subscription id so we can check if the paypal process has already
completed and been signed up.

We show progress to the user as they signup.

* Fix if conditions, paypal key

Fixed the paypal key coming back from Sherwin to be the right key value.
Fixed the conditions on the subscription id.

* Include the free verbiage in the description.

* Updated telehealth plan for 14 day free trial.

* Defaulting values to avoid sql error.
@bradymiller
Copy link
Sponsor Member

2DV(1)

bradymiller pushed a commit that referenced this pull request Apr 26, 2023
* Add save and locale telehealth check instructions

Added a check for the locale settings which should be setup to avoid
clinic problems.

Added instructions that the user needs to log out and log back in after
saving the telehealth settings.

* Fix psr problems.

* Fix telehealth subscription signup.

Include instructions and the subscription id for the user to use when
they signup for the credentials.

Add a copy button and switch the alert of the subscription id to
actually show up in a success message info box.  Before the change the
user had limited understanding on how to proceed to the next steps in
the configuration system.

* Improve signup verbiage, add subscription id

To make the signup process easier for users, we break the signup into
three steps with instructions.  We also add saving the paypal
subscription id so we can check if the paypal process has already
completed and been signed up.

We show progress to the user as they signup.

* Fix if conditions, paypal key

Fixed the paypal key coming back from Sherwin to be the right key value.
Fixed the conditions on the subscription id.

* Include the free verbiage in the description.

* Updated telehealth plan for 14 day free trial.

* Defaulting values to avoid sql error.
@adunsulag adunsulag deleted the openemr-fix-telehealth-signup-locale branch April 5, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants