Launch PopApp¶
Open the PopApp with patient context.
Integration Flow¶
- User opens a patient in your system
- If patient doesn't exist in Unomed yet, your backend creates the patient via API (see Send Patient Data)
- Your frontend loads the PopApp iframe with our Patient UUID as parameter and the requested module
- If user is not authenticated in PopApp, the iframe redirects to Unomed login
- User sees PopApp with the patient pre-selected
Authentication¶
- API calls: Your backend uses OAuth tokens to sync data (see Authentication)
- iframe: The PopApp handles its own authentication. If the user is not logged in, they will be prompted to log in within the iframe.
URL Format¶
The app uses hash-based routing. The URL format is:
With patient context:
Without patient (organization only):
Embed as iframe¶
The PopApp must be integrated as an iframe in your application.
<iframe
id="unomed-popapp"
src="https://app.dev.unomed.ch/#/patient-directory/ORG_UUID/PATIENT_UUID"
width="100%"
height="800"
frameborder="0"
allow="camera; microphone"
></iframe>
Dynamic Loading¶
function loadPopApp(organizationId, patientId) {
const baseUrl = 'https://app.dev.unomed.ch/';
let url;
if (patientId) {
url = `${baseUrl}#/patient-directory/${organizationId}/${patientId}`;
} else {
url = `${baseUrl}#/patient-directory/${organizationId}`;
}
document.getElementById('unomed-popapp').src = url;
}
// Usage
loadPopApp('org-uuid-here', 'patient-uuid-here');