--- title: "Medical Notes Setup" description: "Configure a medical notes mapping so Leyr can translate its note templates into the fields of each EHR." canonical_url: "http://localhost/product/leyr-setup/medical-notes" --- # Medical Notes Setup > Configure a medical notes mapping so Leyr can translate its note templates into the fields of each EHR. Medical notes allow you to create and retrieve clinical documentation in the EHR on behalf of your users. Before you can use the [Medical Notes API](https://api.leyr.io/docs#tag/Medical-Notes), you need to configure a **medical notes mapping** for the EHR in your application settings in the [Developer Portal](https://leyr.io/developers). ## What is a medical notes mapping? Different EHRs structure clinical notes differently - some use templates with named fields, others use a single free-text area. The medical notes mapping tells Leyr how to translate between a [Leyr template](#leyr-templates) and the corresponding template in the EHR. Each mapping connects: - a **Leyr template** (e.g. `leyr_unstructured`) to the matching template in the EHR - each **Leyr field** in that template to the corresponding field name or ID in the EHR ## Leyr Templates Leyr defines a set of standard templates. Each template has a fixed set of content fields that your integration sends when creating a note.
Template ID Description
leyr_unstructured Single free-text field - the simplest and most widely supported template
leyr_acute_visit Acute visit note
leyr_new_visit_psychology Structured psychology intake note with fields for reason of visit, anamnesis, assessment, and plan
leyr_follow_up_visit_psychology Structured follow-up psychology note
leyr_care_status Nursing care status note with clinical fields
Don't see a template that fits your use case? Just let us know and we'll be happy to add it. ## How to configure the mapping Go to your application in the [Developer Portal](https://leyr.io/developers), open the EHR integration, and click the **settings icon** (⚙️) at the instance card. This opens the **Settings** panel listing all available Leyr templates. ![Medical Notes Templates settings panel](http://localhost/images/medical-notes/settings-templates.png) Templates that are already connected show a **Connected** badge. Click on any template to configure it. ### Configuring a template Each template configuration has two fields: - **EHR template ID** - the identifier or name of the matching template in the EHR (check the relevant [EHR Setup Guide](http://localhost/product/ehrs-setup) for where to find this) - **EHR field ID** - for each Leyr field shown on the left, enter the corresponding field name or ID from the EHR ![Configuring a single template](http://localhost/images/medical-notes/configure-template.png) Once filled in, click **Confirm** and then **Save settings**. ## What happens without a mapping? If you try to create a medical note without a mapping configured, the API returns a `MEDICAL_NOTE_MAPPING_NOT_FOUND` error. Configure at least one template in the Developer Portal before making medical note API calls. ## Next Steps Once your mapping is configured, follow the [Write a Medical Note](http://localhost/api/quickstart/write-medical-note) quickstart to start creating notes. ## Sitemap See the full [sitemap](http://localhost/sitemap.md) for all pages.