notes-create-new-user-practitioner
Notes on Creating a User Automatically from Registration Page
Server Code: auth/google.ts worker/subscription.ts
Testing/Developing Subscription Webhooks Bots
- sample endpoint testing: https://pipedream.com/sources/dc_qQuDzQG
- Use Pipedream endpoint to validate subscription is transmitting -https://www.medplum.com/docs/subscriptions/publish-and-subscribe
Previous Notes
- Configure
ClientApplicationfor auth of Bot - Create New Practitioner- used in "Bot - Create New Practitioner..."" code to authenticate for initial user creation
- Create in Project: Super Admin (Very Important!)
- Name: ClientApplication - Create New Practitioner-[env]
- ProjectMembership: can use default membership created with ClientApplication - change to Admin
- Configure
Botfor "New Practitioner" creation routine- Create in Project: PathCloud-[envrionment]
- Name: Bot - Create New Practitioner_[environment]
- Runtime Version: vmcontext
- ProjectMembership - can use default membership in PathCloud-[env] - change to Admin
- Copy Bot code from /apps/bots/src/create-practitioner-subs-user/botcode.ts
- Modify
client_idandclient_secretconstants with values from "ClientApplication - Bot - Auth_PathCloud-[env]" - Click "Save" and "Deploy" in Bot Editor
- Configure
Subscriptionfor User/Practitioner/Project creation routine- Create in Project: PathCloud-[environment]
- Users will be created with ProjectId supplied in .env; The Subscription must be in the same project.
- Reason: Create New Practitioner Bot - [environment]
- Criteria: User
- Add "extension" to restrict subscriptions to only "CREATE" messages (if not copying json from bot folder)