Skip to main content

Patient Information Applet

Overview

The Patient Information Applet is an applet designed to display important patient information without navigation.

The applet automatically handles data retrieval and formatting depending on dynamic configuration and inputs.

Display

The applet renders a mona-card containing:

  • Patient name
  • Date of birth (formatted including age)
  • Case ID
  • Height / Weight / BMI grouped values
  • Operation / Service Request Reason

Input Parameters

InputTypeRequiredDescription
encounterIdstringNoThe unique identifier of the encounter. If provided, this takes precedence over the service request's encounter reference.
serviceRequestIdstringNoThe unique identifier of the service request. Used to retrieve associated encounter.
configPatientInformationConfigYesConfiguration object for customizing code mappings and data display options. See configuration section below.
Required Input

This applet requires either an encounterId or a serviceRequestId to function.

  • If encounterId is provided → it is used directly
  • If not, the Encounter is resolved indirectly via the serviceRequest.encounter.reference
  • If neither is provided → no data can be loaded

Make sure at least one of these inputs is always passed.

encounterId

Type: string (optional)

Unique identifier for an encounter. If provided the associated patient and its observations are loaded.

encounterId: "encounter-id-123"

serviceRequestId

Type: string (optional)

Unique identifier for a service request. Used to load and resolve the associated ServiceRequest. Mostly used as fallback to determine the encounter if no encounterId is passed.

serviceRequestId: "service-request-id-123"

config

Type: PatientInformationConfig (required)

interface PatientInformationConfig {
heightCodes: string[];
weightCodes: string[];
bmiCodes: string[];
}

The PatientInformationConfig specifies which observation codes should be used to identify and filter height, weight, and BMI measurements from the loaded observations. This allows the applet to adapt to different healthcare systems that use varying or custom coding standards.

config: {
bmiCodes: [ "39156-5" ],
heightCodes: ["8302-2"],
weightCodes: ["29463-7"]
}

Behavior

Encounter Resolution Strategy

The applet determines which Encounter to display using a two-step priority mechanism:

  • If an explicit encounterId input is provided → use it.
  • Otherwise, resolve the encounter from the loaded ServiceRequest by extracting the ID from serviceRequest.encounter.reference.

This dual-resolution approach ensures that the component is flexible and supports both direct and indirect usage contexts.

Observation Resolution (Height, Weight, BMI)

The component extracts and formats observation values by:

  • Filtering Observations matching configured codes
  • Sorting them by date
  • Taking the most recent entry
  • Formatting the numeric values for display

If no matching observation found, 'N/A' is returned.

Determination of the Service Request Reason

The applets computes the displayed “Operation” or “Reason” using all service requests linked to the current encounter and the helper function determineServiceRequestReason(). This includes the current priority cascade:

  • Direct ServiceRequest (reasonReference → code)
  • Parent "basedOn" ServiceRequest (reasonReference -> code) - only if step 1 found nothing.
  • Encounter (reasonCode) - only if steps 1 & 2 found nothing.

Example Usage

const config: PatientInformationConfig = {
heightCodes: [
'8302-2', // LOINC: Body height
],
weightCodes: [
'29463-7', // LOINC: Body weight
'3141-9', // LOINC: Body weight Measured
],
bmiCodes: ['39156-5'],
},
};
const encounterId: 'e8f4d3c2-5b6a-4d1e-9f2a-3b4c5d6e7f8a',

<mona-patient-information [config]=config [encounterId]=encounterId></mona-patient-information>