Before you finish
Before enabling the interface, confirm that its gateway has dedicated credentials, its adapter and device are registered, and every metric is mapped. Verify the patient association, process a test message without quarantine, and check the FHIR/openEHR projections. Complete monitoring and downtime procedures and obtain the site's sign-off.
choose adapter -> prepare gateway -> register adapter -> register device
-> map metrics/units -> associate + verify patient -> send test message
-> inspect messages/events/projections -> run negative tests -> approve production
Jump to: integration boundary · choose adapter · prerequisites · register adapter · register device · map metrics · associate patient · send test data · verify · negative tests · production · live monitoring · troubleshoot.
Before you start
AMCDR's central inbound medical-device route is an authenticated HTTP JSON API. The included AMCDR Edge Connector runs inside the facility network and supplies durable local HTTP, HL7 v2 MLLP and watched-folder inputs. An existing integration engine or vendor gateway can use the same connector. SDC participation, DICOM storage and proprietary SDKs remain governed protocol plug-ins or upstream systems; they do not run in the clinician's browser.
device/manufacturer gateway
-> site edge receiver (MLLP, SDC, DICOM, vendor protocol)
-> authenticated POST /medical-devices/adapters/{adapter_id}/messages
-> selected AMCDR family adapter
-> CanonicalDeviceEvent
-> identity + association + terminology + UCUM + quality gates
|-> FHIR R4 exchange projection
`-> openEHR template/path envelope + feeder audit
endpoint_url is governed connection metadata; registering it does not start a listener in the central server. The separately deployed Edge Connector handles framing, sender authentication, durable acknowledgement, reconnect, buffering, certificate validation and forwarding.
FHIR is not a compulsory intermediate. AMCDR normalizes each family payload once to CanonicalDeviceEvent, then derives FHIR and openEHR representations in parallel.
Deploy the AMCDR Edge Connector
The installable service is checked in under edge_connector/. Deploy one or more instances per facility, laboratory or network trust zone. Each input route binds to one registered AMCDR adapter UUID and exact device identifier.
cd edge_connector
python3 -m venv .venv
. .venv/bin/activate
pip install .
cp config.example.json edge-connector.json
export AMCDR_EDGE_CLIENT_SECRET='read from the site secret store'
export AMCDR_EDGE_INGEST_KEY='long random local ingest secret'
amcdr-edge --config edge-connector.json serve
The connector accepts authenticated local HTTP, configured MLLP frames and watched-folder exports. It commits each message to a SQLite WAL queue before returning HTTP 202 or MLLP AA, retries with the same message ID and reports queue/heartbeat health to Resources → Medical devices → Edge connectors. It refuses unauthenticated network HTTP listeners and plain HTTP to a remote AMCDR server. An MLLP listener bound beyond loopback also requires an explicit allowed_clients IP/CIDR allowlist.
An iPhone does not need WebHID or this connector for patient/specimen QR capture. Open AMCDR through HTTPS, select Scan, grant camera access and use the rear camera. The UI uses a Safari-compatible decoder when the browser has no native barcode detector. Proprietary document scanners use their macOS/Windows driver and submit through connector HTTP or a watched folder.
Step 1 — Choose the adapter family
| Source | Adapter type | AMCDR payload | Site edge responsibility |
|---|---|---|---|
| Monitor/ventilator | ihe_pcd_hl7v2 | HL7 v2 ER7 with MSH/PID/PV1/EQU/OBX | Receive MLLP and preserve the original message |
| SDC point-of-care device | ieee_11073_sdc | Normalized JSON or safe SOAP/XML metric/alert state | SDC/SDPi participation and subscriptions |
| Infusion pump | ihe_pump | Start/rate/bolus/pause/resume/stop/completion/alarm JSON | Manufacturer gateway or IHE PIV interface |
| FHIR gateway | fhir_r4 | R4 Bundle, Observation, MedicationAdministration, Device or DeviceMetric | Validate sender and forward complete resources |
| Imaging/waveform source | dicomweb | DICOM JSON metadata, UIDs and HTTPS object reference | Keep bulk object in PACS/VNA and expose governed retrieval |
| Analyser/POCT | laboratory | Normalized JSON or HL7 v2 ORU_R01 | Receive analyser protocol and preserve specimen/QC evidence |
| Home/personal device | personal_health | IEEE 11073 PHD-normalized JSON or FHIR Observation | Pair/authenticate device and preserve patient assignment |
Use a separate adapter record for each connection with its own access and trust requirements. Do not mix unrelated manufacturers or facilities. After authentication, call GET /medical-devices/profiles to confirm the deployed capabilities.
Step 2 — Assign owners and gather device details
| Evidence | Accountable owner |
|---|---|
| Clinical purpose and which values enter the longitudinal record | Clinical service owner |
| Manufacturer/model/UDI/serial/firmware/gateway version | Biomedical or clinical engineering |
| Protocol and exact vendor conformance statement | Integration engineer/vendor |
| Network, ports, DNS, certificates and NTP source | Infrastructure/security |
| Vendor metrics, types, units, states and alarms | Integration modeler |
| Canonical code, UCUM unit and reference ranges | AmyTerm/terminology authority |
| Active openEHR template key and exact RM path | Semantic Studio modeler |
| Alarm/downtime response | Clinical safety lead |
| Normal, boundary, malformed, duplicate and unknown messages | Vendor/site acceptance team |
Use only synthetic or properly de-identified data during development.
Step 3 — Prepare AMCDR, identity and gateway
- Confirm AMCDR health. Hosted deployments normally expose the backend through
https://<amcdr-host>/backend. - Confirm Alembic includes
0130_medical_device_integrationor a later head. - Create facility/location records and any platform Resource linked to the device.
- Approve canonical terminology and exact UCUM codes in AmyTerm.
- Import/validate the openEHR template and obtain the real key/path in Semantic Studio.
- Create a synthetic patient and encounter. Match the fixture's patient identifier or edit the fixture.
- Synchronize device, gateway and AMCDR hosts to the approved NTP source.
- Prepare PACS/VNA/object/telemetry storage for DICOM or high-rate waveform content.
cd backend
alembic current
alembic upgrade head
alembic current
Gateway identity
Use a dedicated non-interactive identity per interface. The recommended production pattern is a Keycloak confidential service client whose validated token resolves to an active AMCDR identity/membership with only device_gateway and the correct signed tenant/organisation/facility context. Do not reuse a human administrator's token in a gateway.
- Create a confidential client such as
amcdr-device-icu-monitor-01in the AMCDR realm. - Enable client authentication and service-account roles; disable browser/direct-password flows for it.
- Add the expected AMCDR API audience and map
roles: device_gateway. - Map signed
tenant_idand, when scoped,organisation_id,environment_idandfacility_idUUID claims. - Store its generated secret in the gateway secret store, never in source control.
export AMCDR_OIDC_TOKEN_URL='https://auth.example.org/realms/amcdr/protocol/openid-connect/token'
export AMCDR_DEVICE_CLIENT_ID='amcdr-device-icu-monitor-01'
read -rsp 'Device client secret: ' AMCDR_DEVICE_CLIENT_SECRET; printf '\n'
TOKEN_JSON="$(curl --fail-with-body --silent --show-error \
-X POST "$AMCDR_OIDC_TOKEN_URL" \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode "client_id=${AMCDR_DEVICE_CLIENT_ID}" \
--data-urlencode "client_secret=${AMCDR_DEVICE_CLIENT_SECRET}")"
unset AMCDR_DEVICE_CLIENT_SECRET
export AMCDR_GATEWAY_TOKEN="$(printf '%s' "$TOKEN_JSON" | jq -er '.access_token')"
For acceptance, inspect the decoded token's issuer, audience, expiry, device_gateway role and governance claims. Decoding alone is not validation; AMCDR still verifies the token signature and configured issuer/audience.
Use a separate short-lived human setup token with biomedical_engineer, clinical_engineer, integration_modeler, system_admin or super_admin. Obtain it through the approved OIDC login/administrative CLI. Do not elevate the gateway client merely to make configuration calls work.
export AMCDR_API_BASE='https://dev-amcdr.sandbox.hygeoniq.com/backend'
export AMCDR_ADMIN_TOKEN='<short-lived-human-setup-token>'
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer ${AMCDR_ADMIN_TOKEN}" \
"${AMCDR_API_BASE}/medical-devices/profiles" | jq .
A successful list proves the human setup token's authentication, operator role and tenant context. The gateway token is proved when Step 8 returns HTTP 202. 401 indicates credential validation; 403 indicates role/context denial; 409 can indicate that the route received no resolved tenant context.
Network and secret checklist
- Allow only the gateway to reach AMCDR HTTPS; verify server certificates and use mTLS where required.
- Keep credentials/private keys in the secret store. Store only references in
auth_secret_ref/tls_profile_ref. - Use a durable outbound queue and retain original messages or immutable governed storage references.
- Retry using the same stable external message ID and sequence number.
Step 4 — Register the adapter
User interface
- Sign in as a biomedical/device integration administrator.
- Open Resources in the sidebar, then select the Medical devices local tab.
- Expand Register adapter.
- Enter a stable lowercase key, name, adapter family and protocol/version.
- Use the API/OpenAPI workspace for endpoint, secret/TLS references, profile and advanced configuration.
API body
POST ${AMCDR_API_BASE}/medical-devices/adapters
Authorization: Bearer ${AMCDR_ADMIN_TOKEN}
Content-Type: application/json
{
"key": "icu-monitor-gateway-01",
"name": "ICU monitor gateway 01",
"adapter_type": "ihe_pcd_hl7v2",
"protocol": "HL7 v2.6 ORU_R01 over site MLLP gateway",
"profile": "IHE DEV PCD-01 DEC",
"version": "site-interface-1.0",
"endpoint_url": "mllp://icu-interface.internal:2575",
"auth_secret_ref": "secret://amcdr/device-gateways/icu-monitor-01",
"tls_profile_ref": "trust://amcdr/device-gateways/icu-monitor-01",
"status": "active",
"trust_mode": "verify"
}
Expected: HTTP 201 and an adapter UUID. Complete the connector, network and credential prechecks before this request: the current API has no general update route, so this runnable path creates the adapter active. The UI also creates an active adapter. Do not send production traffic until all acceptance steps below pass; use a governed version-specific process for any adapter deliberately registered inactive.
Step 5 — Register the device
Under Register device, select the adapter and enter the identifier actually emitted by the payload, plus type, manufacturer, model and serial. Add UDI, firmware, location and resource linkage through the API when available.
POST ${AMCDR_API_BASE}/medical-devices/devices
Authorization: Bearer ${AMCDR_ADMIN_TOKEN}
Content-Type: application/json
{
"adapter_id": "<adapter-uuid>",
"identifier": "MONITOR-ICU-001",
"identifier_system": "urn:hygeoniq:device-id",
"udi_carrier": "(01)01234567890128(21)MONITOR001",
"device_type_code": "monitor",
"device_type_display": "Multiparameter bedside monitor",
"manufacturer": "Synthetic Test Manufacturer",
"model_number": "SIM-MON-1",
"serial_number": "SIM-0001",
"firmware_version": "1.0.0-test",
"status": "active",
"operational_status": "ready",
"details": {"synthetic_test_device": true}
}
Expected: HTTP 201. Save the returned id as DEVICE_ID. The registered identifier must exactly equal the source device identifier.
Step 6 — Map every metric and exact unit
An unknown source code is quarantined. Quantitative metrics require exact, case-sensitive UCUM codes such as %, /min, Cel, kg, mm[Hg] or mL/h.
The supplied IHE PCD fixture requires two mappings:
| Metric key | Vendor/canonical code | System | Type | UCUM unit |
|---|---|---|---|---|
heart-rate | 8867-4 | http://loinc.org | quantity | /min |
oxygen-saturation | 59408-5 | http://loinc.org | quantity | % |
POST ${AMCDR_API_BASE}/medical-devices/devices/${DEVICE_ID}/metrics
Authorization: Bearer ${AMCDR_ADMIN_TOKEN}
Content-Type: application/json
{
"metric_key": "heart-rate",
"vendor_code": "8867-4",
"vendor_system": "http://loinc.org",
"canonical_code": "8867-4",
"canonical_system": "http://loinc.org",
"canonical_display": "Heart rate",
"value_type": "quantity",
"unit_code": "/min",
"unit_system": "http://unitsofmeasure.org",
"unit_display": "beats/minute",
"mapping_version": "site-acceptance-1",
"openehr_mapping": {}
}
Repeat for oxygen saturation. Leaving openehr_mapping empty produces fhir_ready. Before production, use the exact deployed template and Semantic Studio path:
{
"template_key": "<real-active-template-key>",
"path": "<exact-RM-path-from-Semantic-Studio>"
}
openehr_ready means the projection passed its map, not that an openEHR Composition has already been committed.Step 7 — Associate and verify the patient
Clinical device data requires one active, human-verified association.
- Open the synthetic patient and active encounter.
- Open Resources → Medical devices, select the device and choose Associate current patient.
- Independently compare wristband/MRN, encounter/bed and the identifier displayed by the device/gateway.
- Select Verify. Do not verify from an unconfirmed remote bed list.
POST ${AMCDR_API_BASE}/medical-devices/associations
{
"device_id": "<device-uuid>",
"patient_id": "<synthetic-patient-uuid>",
"encounter_id": "<synthetic-encounter-uuid>",
"external_association_id": "SITE-ACCEPTANCE-001",
"association_type": "point_of_care",
"source": "manual",
"started_at": "2026-08-27T10:00:00Z"
}
POST ${AMCDR_API_BASE}/medical-devices/associations/<association-uuid>/verify
{"status":"active","reason":"Wristband, encounter, bed and device identity independently checked"}
The first response must be pending/verified: false; the verification response must be active/verified: true with actor and time.
Step 8 — Send the first test message
Use a trusted checkout containing examples/medical_devices. The tested IHE PCD payload is preserved as a JSON string:
jq -n \
--rawfile payload examples/medical_devices/ihe_pcd_oru_r01.hl7 \
--arg association_id "$ASSOCIATION_ID" \
--arg sent_at "$(date -u +%Y-%m-%dT%H:%M:%SZ)" '{
external_message_id: ("SITE-ACCEPTANCE-ORU-" + $sent_at),
device_identifier: "MONITOR-ICU-001",
message_type: "ORU_R01",
association_id: $association_id,
source_timestamp: $sent_at,
sequence_number: "1",
payload: $payload,
provenance: {
source: "AMCDR synthetic medical-device corpus",
fixture: "ihe_pcd_oru_r01.hl7",
purpose: "site-acceptance"
}
}' | curl --fail-with-body --silent --show-error \
-X POST "${AMCDR_API_BASE}/medical-devices/adapters/${ADAPTER_ID}/messages" \
-H "Authorization: Bearer ${AMCDR_GATEWAY_TOKEN}" \
-H 'Content-Type: application/json' \
--data-binary @- | jq .
Expected HTTP 202:
{
"status": "processed",
"event_count": 2,
"accepted_count": 2,
"quarantined_count": 0,
"validation_issues": []
}
The fixture contains patient identifier PATIENT-DEVICE-001. Give the synthetic patient that enterprise ID/MRN or edit the fixture to one of the patient's AMCDR UUID, enterprise patient ID or MRN.
Step 9 — Verify end to end
GET ${AMCDR_API_BASE}/medical-devices/messages?adapter_id=${ADAPTER_ID}&device_id=${DEVICE_ID}
GET ${AMCDR_API_BASE}/medical-devices/events?patient_id=${PATIENT_ID}&device_id=${DEVICE_ID}
GET ${AMCDR_API_BASE}/medical-devices/exceptions?adapter_id=${ADAPTER_ID}&device_id=${DEVICE_ID}
Require all of the following:
- Message is
processed; payload hash and provenance are present. - Two events exist with correct patient, encounter, association, device and timestamps.
- Values match the source; codes and exact units match the approved mappings.
- FHIR Observations reference the correct AMCDR Patient and Device.
- Exception list is empty.
- Status is
fhir_readywithout an openEHR map oropenehr_readywith a real approved map. - Feeder-audit evidence is present.
openehr_ready event as a Composition. Do not report it as part of the canonical longitudinal openEHR record until openehr_composition_id is populated.Step 10 — Run mandatory negative tests
| Test | Required result |
|---|---|
| Repeat the same external ID and payload | duplicate; no extra events |
| No verified association | patient-association-required |
| Wrong patient identifier | patient-identity-mismatch |
| Wrong device identifier | device-identity-mismatch |
| Unknown source code | metric-mapping-required |
| Wrong unit | unit-mismatch |
| Wrong value type | value-type-mismatch |
| Malformed family payload | Message exception/adapter-validation |
| Inactive adapter/device | Rejected before parsing |
| Identity without ingest role | HTTP 403 |
| Other tenant identity | Denied/not found without disclosure |
| DICOM inline bulk bytes | Rejected; use external object reference |
Correct source transformation or governed mappings, then replay the original stable message ID. Never bypass a safety gate or edit accepted stored events.
Step 11 — Test all seven families
| Adapter | Checked-in fixture | Payload shape | Expected result |
|---|---|---|---|
ihe_pcd_hl7v2 | ihe_pcd_oru_r01.hl7 | String | 2 Observations |
ieee_11073_sdc | sdc_report.json, sdc_report.xml | Object/XML string | Observation + alarm |
ihe_pump | pump_events.json | Object/list | 2 MedicationAdministrations + alarm |
fhir_r4 | fhir_r4_bundle.json | FHIR object | Device, DeviceMetric, Observation, MedicationAdministration |
dicomweb | dicomweb_waveform_metadata.json | DICOM metadata object | DocumentReference with HTTPS URL, no inline data |
laboratory | laboratory_result.json, laboratory_oru_r01.hl7 | Object/HL7 string | Laboratory Observations |
personal_health | personal_health_measurements.json, personal_health_observation.fhir.json | JSON/FHIR object | Home Observations |
For JSON fixtures use jq --slurpfile payload <file> and submit $payload[0]. For XML/HL7 use --rawfile. For each family first register the matching adapter/device, map every code/unit in manifest.json, and verify the patient association.
Open the complete synthetic corpus and manifest on GitHub.
Step 12 — Apply modality-specific safety rules
Alarms
AMCDR is a secondary operational record, not the manufacturer's primary alarm display. Respond at the device, then acknowledge/resolve in AMCDR with actor and time.
Laboratory
Technical ingestion is not result verification. A production result must also pass order, patient, specimen, analyser/QC, verification and release workflows.
Infusion pumps
Reconcile administration evidence with the medication order, product, patient, route, dose/rate and nurse workflow. Live remote command dispatch remains disabled.
DICOM and waveforms
Keep Study/Series/SOP UIDs and an authorized retrieval reference in AMCDR. Keep bulk data in PACS/VNA or an approved telemetry store; persist reviewed summaries/snapshots to openEHR.
Step 13 — Production acceptance and cutover
- Add de-identified messages from the exact manufacturer/model/firmware/gateway to a site-owned corpus.
- Test normal, boundary, malformed, unknown, alarm and disconnect cases against the device display and an independent reference.
- Prove time, clock drift, sequence, retry and replay behaviour.
- Prove identity, mapping, unit and association failures quarantine safely.
- Validate applicable FHIR profiles and exact openEHR template/path/FEEDER_AUDIT mapping.
- Test certificate rotation, network loss, gateway restart, AMCDR recreation, database restore and downtime reconciliation.
- Test tenant isolation, least privilege and credential revocation.
- Monitor
last_seen_at, exceptions, alarm backlog, latency, clock drift and queue age. - Approve rollback and manual clinical downtime procedures.
- Obtain biomedical, clinical engineering, cybersecurity, privacy, clinical-safety, service and site-owner signatures.
Live connected-device monitoring
Session-based personal devices, bedside monitors and gateways use the same source-neutral telemetry path. Select the patient and open Resources → Medical devices. After registering the device, mapping heart rate to LOINC 8867-4 with UCUM /min, and verifying its patient association, use Monitoring sessions to start the session. Copy its ID into the connected client.
Apple Watch → HealthKit → iPhone HTTPS relay --+
Synthetic device CLI --------------------------+→ monitoring session → canonical events
→ five-second UI → governed summary
The panel shows waiting, connected, reconnecting, offline or stopped state. The session-filtered graph shows current heart rate, original measurement time, sample count, minimum, maximum and average. Stable sample IDs make client retry idempotent. AMCDR rejects ambiguous timestamps, non-finite values, inactive sessions and unverified patient-device relationships.
Use the same API without Apple hardware:
export AMCDR_BASE_URL='https://dev-amcdr.sandbox.hygeoniq.com/backend'
export AMCDR_TOKEN='<short-lived-token>'
./scripts/device-simulator --session-id '<session-uuid>' \
--scenario walking --duration 300 --interval 5
The Xcode project and novice Mac deployment guide are in apple/AMCDRHealth. Apple compilation, signing, HealthKit permission and physical Watch streaming are verified on macOS with the paired devices, not on the Linux server.
Step 14 — Operate, view trends, troubleshoot and recover
Clinician trend view
The Device trends panel reads governed numeric events from GET /medical-devices/events. Select a patient/device, measurement and time range to see current-value tiles, reference-range shading, historical points, quality state, alarm markers and provenance. Near-live performs an authenticated five-second refresh; it is not presented as a validated bedside waveform stream.
The patient Overview → Trends tab provides a concise longitudinal view of persisted temperature, oxygen saturation, heart rate, blood pressure and other supported vital signs with a 24-hour default and optional 30-second refresh. Use Device trends for device-specific quality/alarm/provenance review and Patient trends for care-context review.
The development deployment refreshes a clearly labelled demonstration for patient MRN SIM-DEVICE-001 and device SIM-ICU-MONITOR-001: 485 observations across five LOINC/UCUM metrics and one resolved simulated alarm. Kubernetes and VPS deployments do not run this seed.
python scripts/seed_medical_device_trend_demo.py --tenant-key default
# Development deployer opt-out
export AMCDR_DEV_SEED_DEVICE_TRENDS=false
The seed replaces only rows carrying its clinician-device-trends-v1 marker and submits every observation through the normal association, terminology/unit, FHIR and openEHR projection gates.
| Symptom | Check | Response |
|---|---|---|
401 | Expiry, issuer, audience, signature, TLS | Obtain a valid token; never disable verification |
403 | Gateway/admin role and active membership | Correct governed assignment |
409 context | Signed tenant/organisation/facility claims | Correct identity/client mapping |
| Device not found | Payload vs registered identifier and tenant | Correct registry/gateway; do not alias silently |
| All quarantined | Association, maps, units, types | Correct governance and replay original IDs |
| Duplicate | Previously accepted external ID | Treat as idempotent replay; compare hash |
| DICOM unavailable | PACS authorization/retention/WADO URL | Restore governed external access |
openehr_ready, no Composition | Template/EHR/composition writer | Do not claim persistence; investigate projection |
PostgreSQL is authoritative. Back it up with gateway configuration, installation identity, secret references, trust material and the external object catalogue.
Step 15 — End association and decommission
POST ${AMCDR_API_BASE}/medical-devices/associations/${ASSOCIATION_ID}/end
Authorization: Bearer ${AMCDR_ADMIN_TOKEN}
Content-Type: application/json
{"reason":"Device removed after site-acceptance test"}
End an association when the device is removed, reassigned, transferred or the patient is discharged. For permanent retirement, stop the connector, revoke its credential, retire the registry record through governance, retain audit/clinical evidence and prove that new messages are rejected.
API and role reference
| Route | Purpose |
|---|---|
GET /medical-devices/profiles | Adapter capabilities |
GET/POST /medical-devices/adapters | Adapter registry |
GET/POST /medical-devices/devices | Device registry |
GET/POST /medical-devices/devices/{id}/metrics | Canonical maps |
GET/POST /medical-devices/associations | Patient-device relationships |
GET/POST /medical-devices/monitoring-sessions | Start and list connected-device sessions |
GET /medical-devices/monitoring-sessions/{id} | Connection state, counts and summary |
POST /medical-devices/monitoring-sessions/{id}/samples | Idempotent timestamped telemetry batches |
POST /medical-devices/monitoring-sessions/{id}/stop | Close session and generate governed summary |
POST /medical-devices/adapters/{id}/messages | Idempotent gateway ingest |
GET /medical-devices/messages, /exceptions, /events, /alarms | Operational review and clinician trends; events accept patient/device/metric/time filters |
GET /medical-devices/devices/{id}/fhir, /metrics/{id}/fhir | FHIR Device/DeviceMetric |
Configuration uses biomedical/clinical engineering, integration modeler or administrator roles. Ingestion uses device_gateway or an explicitly approved technical role. Every record remains tenant-owned under forced PostgreSQL row-level security. The installed OpenAPI document under Documentation → API documentation is the field-level authority.
Adapter tests
cd backend
pytest -q tests/test_medical_device_adapters.py
AMCDR_ENTERPRISE_TEST_DATABASE_URL='postgresql+psycopg://...' \
pytest -q tests/test_medical_devices_postgres.py
The sample messages cover every declared payload format. The FHIR Bundle was checked with HL7 FHIR validator CLI 6.9.7 against R4 core 4.0.1. Adapter tests check parsing, normalization, access controls and projections. Test the actual device and gateway separately before deployment; sample-message tests do not certify a manufacturer's hardware.
Final checklist
- ☐ Correct adapter and edge transport selected.
- ☐ Exact device and software evidence recorded.
- ☐ Dedicated gateway identity, tenant context and rotation tested.
- ☐ Adapter/device registered and activation approved.
- ☐ Every metric, type, unit, state and alarm mapped/versioned.
- ☐ Real template key/path validated where openEHR persistence is required.
- ☐ Patient association created, independently verified and later ended.
- ☐ Positive test processed with zero quarantine.
- ☐ Mandatory negative tests fail safely.
- ☐ FHIR/openEHR projection status interpreted correctly.
- ☐ Monitoring, downtime, replay, backup and recovery tested.
- ☐ Site-owned real-device corpus and all required signatures completed.
See also Interoperability and Integration, openEHR Conformance, Laboratory Lifecycle, Medication Safety, Authentication and Access-Control Matrix and Deployment and Runtime.