> ## Documentation Index
> Fetch the complete documentation index at: https://docs.medisync.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Data exchange

> What clinical data MediSync Connect exchanges, in which direction, and how it maps to each transport.

MediSync Connect exchanges the same clinical information regardless of the
[connectivity model](/connect/connectivity-models). What changes is the wire format:
FHIR resources for API-based systems, and GDT records / HL7 messages / structured XML
for file-based systems reached through the [Agent](/connect/medisync-agent).

* **Inbound** — MediSync reads patient context from the source system.
* **Outbound** — MediSync writes finished documentation back into the source system.

## Capability matrix

| Capability                             | Direction     | FHIR resource                | File-based equivalent             |
| -------------------------------------- | ------------- | ---------------------------- | --------------------------------- |
| Find / identify a patient              | Inbound       | `Patient`                    | GDT patient record (`6302`)       |
| Import patient demographics            | Inbound       | `Patient`                    | GDT patient fields                |
| Read existing diagnoses / problem list | Inbound       | `Condition` (ICD-10-GM)      | —                                 |
| Read observations & results            | Inbound       | `Observation`                | GDT result fields                 |
| Read existing clinical documents       | Inbound       | `DocumentReference`          | —                                 |
| Read calendar / slots (scheduling)     | Inbound       | `Slot`, `Appointment` (ISiK) | —                                 |
| Write a clinical note                  | Outbound      | `DocumentReference`          | GDT `6310`, HL7 v2, or vendor XML |
| Write a referral / doctor's letter     | Outbound      | `DocumentReference`          | GDT `6310`, HL7 v2, or vendor XML |
| Write back a diagnosis                 | Outbound      | `Condition` (ICD-10-GM)      | structured field / XML section    |
| Book an appointment (scheduling)       | Outbound      | `Appointment/$book` (ISiK)   | —                                 |
| Export a combined encounter record     | Outbound      | `Bundle`                     | —                                 |
| Exchange structured clinical documents | Bidirectional | —                            | HL7 CDA document                  |

<Note>
  The exact set of capabilities depends on what a given system exposes. Scheduling
  (Slot / Appointment) is available on ISiK hospital systems and selected PVS; file-based
  systems primarily exchange patient context inbound and clinical documentation outbound.
  We confirm the capabilities of your specific system during onboarding.
</Note>

## Reading patient context (inbound)

Before documentation begins, MediSync pulls the patient and relevant context from the
source system:

* **Patient identity & demographics** — the current patient, brought into MediSync.
* **Diagnoses** — the existing problem list, as coded `Condition` resources
  (ICD-10-GM) where the system provides them.
* **Observations & results** — prior results and measurements.
* **Documents** — existing clinical documents where available.

## Writing documentation back (outbound)

Once documentation is complete in MediSync, it is filed back into the record:

* **Clinical note** — written as a `DocumentReference`, a GDT `6310` result record, an
  HL7 v2 message, or the system's native XML format, depending on the system.
* **Referral / doctor's letter** — written the same way, in the system's format.
* **Diagnosis** — written back as coded data (`Condition` / ICD-10-GM) where the system
  supports structured write-back.

<Tip>
  Diagnoses are exchanged as **coded** data rather than free text, so they land as
  structured, queryable entries in the receiving system.
</Tip>
