Setting up multiple test patient accounts
# support
b
We are looking to set up multiple test patients with sample data. We have loaded in Patient resources and linked clinical/financial resources. Is it possible in the admin app to define the username and password? Or must we "invite patient" from the Project? The challenge with the latter part is that we have to have a working email for each patient. We attempted to use the format: patient+@flexpa.com This was received into a single inbox, but after setting up a password, Medplum responds with "User not found" (see image).
r
Let me see if I follow. You invited a patient to the project, and received the invite email but are getting not found when you try to log in? Do you see the patient in your Project Admin settings? https:///admin/patients
d
We've since discovered that immediately after setting a password as a patient, there is a link to "Sign in". However this link navigates to a "user" sign in page. Hence signing in with patient creds threw that "User not found error". Signing in on the "patient" sign in page works just fine. So I believe that the issue was a misleading UX after setting a new password as a patient. Hope that helps
r
Ah yes - I see what you mean. Sorry, that's a bit of a rough edge. Patients will not be able to log into admin app - but they should be able to log into your patient facing app where you specify the ProjectID as part of sign in. You'll want to not send patients an invite email but instead send them a custom welcome email. User guide: https://www.medplum.com/docs/auth/user-management-guide Custom email: https://www.medplum.com/docs/auth/custom-welcome-emails
p
@dylman123 and @reshma - We solved the same requirement by first creating a patient within Medplum and then calling this end-point https://www.medplum.com/docs/api/project-admin/invite. This end point allowed us to specify the password + skip sending emails. That did work & we were able to login using patient credentials that were specified in invite API call.
o
I am facing with similar case. User not found ( lack of ProjectID). What is the best practices to specify projectID to the client App?
r
Your signin form should include a Project ID to ensure that the user goes to the right app - example below https://github.com/medplum/foomedical/blob/main/src/pages/SignInPage.tsx Also, patients will not be allowed to log into Medplum app by design.
o
Got it. Thanks @reshma .
Hello @reshma . After running some tests I got a strange outcome: I am inviting a practitioner from the medplum app and first time. email sends with ask to provide the password , but when I remove the practitioner and resend the invite it sends login email (there is no password setup like it was first time). Is it correct behavior and how to "reinvite" the user ?
r
Deleting the Practitioner won't be sufficient to remove the identity. You'll need to remove the ProjectMembership as well. Then you should be able to reinvite.
479 Views