Skip to content

Launch PopApp

Open the PopApp with patient context.

Integration Flow

  1. User opens a patient in your system
  2. If patient doesn't exist in Unomed yet, your backend creates the patient via API (see Send Patient Data)
  3. Your frontend loads the PopApp iframe with our Patient UUID as parameter and the requested module
  4. If user is not authenticated in PopApp, the iframe redirects to Unomed login
  5. 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:

https://app.dev.unomed.ch/#/patient-directory/{ORGANIZATION_UUID}/{PATIENT_UUID}

Without patient (organization only):

https://app.dev.unomed.ch/#/patient-directory/{ORGANIZATION_UUID}

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');