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

Provider creation in staff-ui 3.5.0 version #1

Open
srilakshmiece opened this issue Jul 25, 2018 · 13 comments
Open

Provider creation in staff-ui 3.5.0 version #1

srilakshmiece opened this issue Jul 25, 2018 · 13 comments

Comments

@srilakshmiece
Copy link

Hi,

I am working on creating the provider in admin/staff-ui, by default it is creating in patient only.I enabled the multiple roles like parent,provider etc..,but whenever i tried to send the verification email by default it is going to c2s-ui only.
In ums code the functionality is implemented for sending the email to c2s-ui only.
There is any option to activate the provider without sending the email? if yes,how to do that (or) else how to send the email to provider.

Thanks in advance,
Sri

@shruti-rao
Copy link
Contributor

@srilakshmiece You can only create Patient users from the Admin/Staff-ui. You can create Provider Users by following this documentation.
https://github.com/bhits/ums#creating-a-provider-user

@srilakshmiece
Copy link
Author

Hi Raghav,

Thank you for your information.It is ok to create the provider by running the script file, but my requirement is to create the provider in staff-ui (without running the script file).Can you please suggest me how to do this.

Thanks in advance,
Sri

@burcakulug
Copy link
Contributor

burcakulug commented Jul 26, 2018

Hi @srilakshmiece ,

The script can be used as a reference to see the spec of the RESTful API to create a provider user. You would need to implement the UI changes in staff-ui and expose the call to ums via staff-ui-api, so you can call it from the staff-ui. The staff-ui-api should already be exposed by edge-server with default configuration. Basically, the flow should be like staff-ui [browser] -> edge-server -> staff-ui-api -> ums.

Thanks.

@srilakshmiece
Copy link
Author

Hi burcakulug,

Thank you for your explanation.I saw the code flow of ums, They already implemented the provider creation in ums two ways.
1.Sending the email verification (but we need to redirect the email to provider-ui).
2.without sending email.
The problem is, without sending the email, the provider is created. But activation and verification is not successed. Can u please suggest me how to activate the provider without sending the email.

@burcakulug
Copy link
Contributor

burcakulug commented Aug 6, 2018

@srilakshmiece,
As you may have seen in the code, the user creation in UMS is a three step process: 1) create user profile, 2) generate verification code and email token and send email, 3) user activation. The second step sends the email to the user and in the third step from the UI the user would activate his/her account. It would probably be easiest not to change this three step flow for backend, but you can make it look a single step from the UI. Perhaps you can skip generating/sending the email which I believe we already have a configuration support for it for the provider role (https://github.com/bhits/ums/blob/master/ums/src/main/resources/application.yml#L96). Here uncomment lines 96 and 97. Once you can get the UMS generate email token and verification code, you can use the existing activation API and invoke it same way.

Again, you can see the script as a reference:

  1. https://github.com/bhits/ums/blob/master/scripts/create_activate_provider_user.sh#L60
  2. https://github.com/bhits/ums/blob/master/scripts/create_activate_provider_user.sh#L69
  3. https://github.com/bhits/ums/blob/master/scripts/create_activate_provider_user.sh#L113

@srilakshmiece
Copy link
Author

Hi burcakulug,

I already tried that process(uncomment lines 96 and 97).I get the UMS generate email token and verification code but how to use the existing activation API ?

@shruti-rao
Copy link
Contributor

@srilakshmiece
Once you have the email token and verification code, you should be able to follow the script and call this particular API

@Nithisha-D
Copy link

Hello all,

I created one patient in staff-ui,the verification email will going to c2s-ui, it is ok.
But when ever i tried to create another user like provider the verification email is not going to provider-ui.
can you please tellme How to redirect the email from c2s-ui to provider-ui. Where i need to change the code.

Thanks in advance,
Nithisha

@srilakshmiece
Copy link
Author

@shruti-rao
My requirement is create the provider in staff-ui, not script file.
I uncomment lines 96 and 97 in application.yml file in ums and created one provider. provider is created and i got verification code & email-token,but the user is not activated.
Please find that below attachments and suggest me how to activate the provider.

ums-db

provider

Thanks in advance,
Sri

@burcakulug
Copy link
Contributor

@srilakshmiece ,
In ums, there is a RESTful endpoint POST: /users/activation which takes a JSON like this: https://github.com/bhits/ums/blob/master/ums/src/main/java/gov/samhsa/c2s/ums/service/dto/UserActivationRequestDto.java

When this API is called, it should activate the user and register username/password that is passed. Perhaps you can implement additionally calling this API from Staff UI when a user with provider role is created.

@burcakulug
Copy link
Contributor

burcakulug commented Aug 7, 2018

@Nithisha-D,
Unfortunately, it seems like the activation UI components were never migrated to the provider-ui. You can try to migrate the existing components/modules from c2s-ui to provider-ui. You would also need to do backend changes when sending the email to appropriate UI based on the user's role.

As an alternative option how @srilakshmiece is trying to do, you can try to implement changes to register users with provider roles automatically activated without going through another workflow for the new user if that works for you.

@Nithisha-D
Copy link

@burcakulug,
Thank you for your reply burcakulug. It is one way of create the provider to run the script-file or
without sending the email. If i want to create different users like staff,system support etc.. the
verification email is defaultly going to c2s-ui. I think it is not correct way to sending the email to c2s-ui
every time.So,definitely we need to redirect the email (or) any other option is there??

Thanks in advance,
Nithisha

@burcakulug
Copy link
Contributor

@Nithisha-D
For the roles that you want them to go through verification, you need some UI workflow for them to enter verification code, email token (embedded in the link), username, password and birthday. This workflow would be common for all roles and I think the Angular components/modules related to this workflow are only available in the c2s-ui currently. If you don't want to copy this code/logic around much, one option could be let all roles requiring verification to create accounts to go to c2s-ui and then you can redirect them back to their actual UI upon verification/activation.

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

No branches or pull requests

4 participants