This is great! How are current clients handling cu...
# general
v
This is great! How are current clients handling custom schema requirements? For basic stuff I can see extensions working. Are current clients adding tables to the medplum db?
r
Thank you! Right now, clients are mostly sticking to the FHIR specification, and adding extensions as necessary. We view our DB schemas as an implementation detail to power the API based workflows, but not something directly exposed to client applications
We recently released "bring your own RDS", which allows medplum to share resources with an existing RDS installation
v
Ok, let’s say I had some AI features that required very specific db schemas. What’s the “medplum” way of handling that? In other words, what’s the best way to handle data that won’t conform to fhir?
r
Most often, customers customers will use a separate data warehouse for training / testing AI models. We describe this briefly in our analytics docs. https://www.medplum.com/docs/analytics#machine-learning--predictive-modeling In their pipelines, they often flatten the FHIR data and use the Bulk export API
At inference time, I think it would depend on the kinds of data fields you need. Is there any kind of example you can share? Feel free to DM me if you prefer 🙂
v
Sorry... Pivoting back to the multi-tenant concept... I've setup a self hosted medplum in aws and I've been messing around with the super admin... Is there a way to list all projects? If I wanted to use my own IDP It would be associated to a clientapplication which is associated to a single project... What would be the best way to handle creating new projects when someone logs in with my IDP?
r
Yup https://$baseurl/Project on the medplum app will show all the projects
Ask people to register
https://www.medplum.com/docs/tutorials/register - just point them to your $baseUrl/register and they will create a new project
v
What does registering and creating a new project look like in the context of a 3rd party IDP?
Would it be better to utilize compartments for this use case?
r
Really depends on your use case. If you have partnerships or referral patterns - compartments + access policies might be a good idea https://www.medplum.com/docs/auth/access-control#healthcare-partnerships
If you want strict isolation - Projects are the way to go
v
Thanks for all your help so far, sorry to keep bombarding you with questions... I want to utilize an IDP that supports multiple tenants (frontegg.com). With medplum it seems that external auth is only associated to a single project... It seems like I may need to setup my auth provider hooks to create the project and user, but at that point how would I authenticate the user in medplum?
r
We do support global external auth at a domain level. For example everyone at the medplum.com domain must use Okta - that's a common Enterprise configuration. This is across all projects. Is that what you want to do?
v
correct... The flow would be... redirect to external idp, authorize -> return to medplum -> create user and project if they don't exist.
I'd be utilizing frontegg for the idp
r
Got it. This is might be the documentation that you want to look at https://www.medplum.com/docs/auth/custom-welcome-emails - and I'm assuming here that end users are on some kind of custom app like "alansapp.com" which is distinct from your self-hosted medplum app - am I right?
v
Thanks. I’m not sure how this would work for an existing user and project though. (Again using frontegg)
r
Here's a sample repo, at a high level: 1) Configure frontegg along lines of https://github.com/medplum/medplum-client-external-idp-demo#setup 2) Setup your Medplum account and client app in a project 3) Attempt "Login" https://github.com/medplum/medplum-client-external-idp-demo/blob/main/src/main.ts#L69
v
This goes back to only being at the client level (single project). Frontegg returns a tenant for each user. I imagine that I couldn’t create a new project from the client of another project, right?
r
If the client had super admin credentials you could ... though it seems unconventional
is there a reason you want each user to have their own project?
v
Just the initial user for each company
r
Ahh, I see - so you are looking for "Register" via external auth
That at present is unsupported
v
Could I use a super admin api token to create the resources via a hook of sorts from the frontegg side?
r
in theory yes - but it does not have a lot of mileage or testing for that use case
I'd recommend - for security purposes making two client applications
one with a very low scoped privileges that is for putting into frontegg and another with super admin privileges attached to the bot that does the logic
v
Oooohhh… I like that idea
I’ll give it a shot
r
Stripe bot has relevant webhook related pattern for reference https://github.com/medplum/medplum-demo-bots/tree/main/src/examples/stripe-bots
v
Awesome thank you
I keep getting a forbidden error when running the bot lambda even though its a SuperAdmin
while trying to create a project resource
r
sorry about that - likely that bot is too sandboxed to be able to do that. This is possible from API - as customers do clone projects as part of their CI/CD for example.
Sending you a DM
180 Views