Skip to main content

Assessment Patient Search Applet

The Assessment Patient Search Applet provides an integrated workflow for finding patients and completing clinical assessment forms. Users can search for patients by demographic criteria or hospital case ID, select a patient from the results, and immediately open the corresponding assessment questionnaire in a dialog.

The applet is fully self-contained — it manages the patient search, result display, questionnaire loading, and form submission in one cohesive flow.

Configuration Overview

The applet is configured via the AssessmentAidboxConfig interface.

Properties Overview

PropertyTypeRequiredDescription
titlestringYesTitle displayed in the assessment form dialog header
questionnaireIdstringYesID of the FHIR Questionnaire to render as the assessment form
tokenstringNoJWT token for Aidbox authentication
sdcConfigIdstringNoSDC Config ID used for form rendering configuration
hideFooterbooleanNoHides the footer of the rendered form
hideLanguageSelectorbooleanNoHides the language selector in the form
themestringNoTheme identifier for the form renderer
searchTitlestringNoCustom title shown above the search form
searchDescriptionstringNoCustom description shown below the search form title
searchCountnumberNoMaximum number of results returned per search (default: 250)

Property Details

title

Type: string (required)

The title displayed in the dialog header when the assessment form is opened.

title: "Pre-Anesthesia Assessment"

questionnaireId

Type: string (required)

The unique ID of the FHIR Questionnaire resource to load and render as the assessment form. The applet fetches the questionnaire and any existing QuestionnaireResponse for the selected patient automatically.

questionnaireId: "patientenstammdaten"

sdcConfigId

Type: string (optional)

References an SDC (Structured Data Capture) configuration resource used to control how the questionnaire is rendered. Omit if no custom rendering configuration is needed.

searchTitle / searchDescription

Type: string (optional)

Custom text displayed above the search form. Useful for providing context-specific instructions to users.

searchTitle: "Find Patient",
searchDescription: "Search by name, date of birth, or hospital case ID to locate the patient."

Search Form

The search form allows users to filter patients by demographic data or hospital case ID. All fields are optional — submitting without criteria returns all available patients (up to 250 results).

Search Criteria

FieldTypeDescription
firstNamestringPatient first name (partial match)
lastNamestringPatient last name (partial match)
birthDatestringDate of birth — future dates are disabled
caseIdstringHospital case ID for direct encounter lookup
info

If a Case ID is provided, the applet performs a direct encounter lookup and ignores the demographic fields. Otherwise, the demographic fields are used to search for matching patients, and then their encounters are fetched.

Search Behavior

Search by Case ID:

GET /Encounter?identifier={caseId}&_include=Encounter:subject

Search by Patient Criteria:

# Step 1 — Find matching patients
GET /Patient?given:contains={firstName}&family:contains={lastName}&birthdate={birthDate}&_count=250&_elements=id

# Step 2 — Fetch encounters for those patients
GET /Encounter?subject={patientIds}&_include=Encounter:subject&_count=250

The maximum number of returned results per search is controlled by searchCount (default: 250).

Results Table

After a successful search, matching patients are shown in a results table. Each row represents one encounter linked to a patient.

Displayed Data

ColumnSourceDescription
Full NamePatient.nameFirst and last name
Date of BirthPatient.birthDateFormatted as dd.MM.yyyy with calculated age in years
MRNPatient.identifier (type MR)Medical record number
Case IDEncounter.identifier (use usual or official)Hospital case identifier

FHIR Mappings

Patient Demographics

💡Context
Patient demographics displayed in each result row. The MRN is extracted from the identifier array by matching the type code 'MR'.
📋FHIR Resource
Patient: Demographics and other administrative information about an individual receiving care or other health-related services.
UI FieldFHIR PathDescriptionData TypeRequiredExample
Full NamePatient.nameA name associated with the patientHumanName[]No[ { "use": "official", "family": "Doe", "given": [ "John", "Robert" ] } ]
Date of BirthPatient.birthDateThe date of birth for the individualdateNo1980-05-15
MRN (type: MR)Patient.identifierAn identifier for this patientIdentifier[]No[ { "use": "usual", "system": "http://hospital.example.org/patients", "value": "123456789" } ]
Common Usage: patient identification, display names, age calculation, demographic data, medical record number

Encounter Identifier

💡Context
The case ID is extracted from the Encounter identifier with use 'usual' or 'official'. This corresponds to the hospital case number.
📋FHIR Resource
Encounter: An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.
UI FieldFHIR PathDescriptionData TypeRequiredExample
Case IDEncounter.identifierIdentifier(s) by which this encounter is knownIdentifier[]No[ { "use": "official", "system": "http://hospital.example.org/encounters", "value": "ENC-2024-001234" } ]
Common Usage: case identification, encounter tracking

Workflow

The following diagram shows the complete flow from search input to form submission:

Flow explanation:

  1. The user fills in search criteria and submits the form
  2. The applet queries for matching Encounters and their linked Patients
  3. Results are displayed in the table; each row is clickable
  4. Selecting a row loads or creates a QuestionnaireResponse for that patient
  5. The assessment dialog opens with the rendered questionnaire
  6. On submission, the response is saved and the dialog closes

Assessment Dialog

When a patient row is clicked, the applet opens a dialog containing the configured questionnaire rendered by the Aidbox form renderer.

Pre-population

If a QuestionnaireResponse already exists for the selected patient and questionnaire, it is loaded and pre-fills the form. The applet matches responses by:

  • Canonical questionnaire URL
  • Patient reference (subject)

If no previous response exists, a new one is created and pre-populated automatically.

Submission

On successful form submission, the dialog closes and the user is returned to the search results. The QuestionnaireResponse is persisted to the FHIR server.

FHIR Resources

ResourceRole
PatientDemographic data and identification
EncounterClinical visit / hospital case
QuestionnaireForm definition loaded by questionnaireId
QuestionnaireResponseStored form responses per patient

Example Configuration

const config: AssessmentAidboxConfig = {
title: 'Pre-Anesthesia Assessment',
questionnaireId: 'patientenstammdaten',
token: '<JWT_TOKEN>',
sdcConfigId: 'sdc-config-default',
hideFooter: false,
hideLanguageSelector: true,
searchTitle: 'Patient Search',
searchDescription: 'Search by name, date of birth, or hospital case ID.',
searchCount: 100,
};