Is it possible to connect self-hosted Medplum App ...
# support
u
Hello Medplum team! I'm planning to test integrating the Medplum interface (self-hosted) with a public HAPI FHIR API (e.g., https://hapi.fhir.org/baseR4) before deploying to my own server. My goal is to use only the medplum-app Docker container and connect it to the HAPI FHIR API to display resources, such as all patients available in the API. Is this possible? Can the medplum-app work standalone without the medplum-server and connect directly to a public FHIR API? If so, are there specific environment variables or configurations needed to make this work? Thank you for your guidance!
r
Hello there! You can potentially try this, but we haven't tested it. Is there a reason medplum-server won't work for you?
u
Thank you for your response! I'm working on a project with my team, and we're exploring whether the Medplum dashboard (medplum-app) can connect directly to a public HAPI FHIR server (e.g., https://hapi.fhir.org/baseR4) to display resources like patients (we are using the HAPI FHIR public server for initital testing). The reason for initially avoiding the medplum-server is that my team wants to prevent data duplication and prefers to use our existing server infrastructure for FHIR data storage. I tried running the medplum-app Docker container standalone to connect to the public HAPI FHIR API, but I encountered the following error: GET http://localhost:8103/auth/me net::ERR_CONNECTION_REFUSED client.ts:3348 GET http://localhost:8103/auth/me net::ERR_CONNECTION_REFUSED client.ts:902 TypeError: Failed to fetch at OA.fetchWithRetry (client.ts:3348:38) at async OA.request (client.ts:3261:22) This suggests the medplum-app is trying to connect to a local medplum-server for authentication, which isn't running in my setup. Is it possible to configure the medplum-app to work standalone and authenticate directly with a public FHIR API? If so, what environment variables or settings (e.g., for authentication or FHIR base URL) are needed? If the standalone approach isn’t feasible, and if it’s possible to achieve my goal of displaying all patients data from the public HAPI FHIR server (e.g., https://hapi.fhir.org/baseR4) in the Medplum dashboard by running the medplum-server, could you please explain how to set this up? Specifically, what configurations or environment variables would be required to connect the medplum-server to the HAPI FHIR server and ensure the dashboard displays the patient resources, if this is supported? Thank you for your guidance!
f
Hey @ツS1Dβ™‘πŸ‡¨ πŸ‡¦ πŸ‡Ή πŸ‡Ή πŸ‡± πŸ‡ͺ πŸ‡Ύ πŸ‡¦ , sorry about this. How are you specifying the MEDPLUM_BASE_URL environment variable?
u
I'm specifying MEDPLUM_BASE_URL: 'http://localhost:3000' in my setup.
f
Ok, gotcha. that environment variable should point to your FHIR server. It doesn't actually determine where the app will run. Regardless, we have an open issue with loading environment variables. You can track the status of it I filed an issue for this [here](https://github.com/medplum/medplum/issues/6567)
That being said, your medplum-app will not work as expected when running it with a different FHIR server. There are Medplum specific resources that you will need in order to log in to the app.
You might find it helpful to look at the medplum-app source code [here](https://github.com/medplum/medplum/tree/main/packages/app) or our react component library [here](https://storybook.medplum.com/?path=/docs/medplum-introduction--docs) for some references on how you could build what you are looking for
u
Hi, thanks a lot for the information and for filing the issue,that’s really helpful. I won’t be able to work on this over the weekend, but I’ll take a closer look on Monday and share my feedback then. Really appreciate your support and have a great weekend!
f
Yea, no worries! If you do decide that you want to use the Medplum App and also want to avoid data duplication, I am happy to help show you how you could migrate your FHIR data (some [docs](https://www.medplum.com/docs/migration) here). It would be very easy to go from FHIR server -> FHIR server
155 Views