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

# Create Prescription

> Create a new prescription for a patient

## Body Parameters

<ParamField body="appointmentId" type="string" required>The appointment context</ParamField>

<ParamField body="medications" type="array" required>
  List of prescribed medications

  <Expandable title="medications">
    <ParamField body="name" type="string" required>Medication name and dosage form</ParamField>
    <ParamField body="dosage" type="string" required>Dosage instructions</ParamField>
    <ParamField body="duration" type="string" required>Treatment duration</ParamField>
    <ParamField body="instructions" type="string">Additional instructions</ParamField>
  </Expandable>
</ParamField>

<ParamField body="diagnosis" type="string">Associated diagnosis</ParamField>
<ParamField body="notes" type="string">Additional notes</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.nevatal.com/api/v1/emr/prescriptions" \
    -H "Authorization: Bearer nvtl_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "appointmentId": "apt_xyz789",
      "medications": [
        {
          "name": "Ibuprofeno 400mg",
          "dosage": "1 tableta cada 8 horas",
          "duration": "5 días",
          "instructions": "Tomar después de las comidas"
        },
        {
          "name": "Amoxicilina 500mg",
          "dosage": "1 cápsula cada 8 horas",
          "duration": "7 días",
          "instructions": "Completar todo el tratamiento"
        }
      ],
      "diagnosis": "Infección periapical"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "rx_002",
    "patientId": "pat_abc123",
    "appointmentId": "apt_xyz789",
    "medications": [
      {
        "name": "Ibuprofeno 400mg",
        "dosage": "1 tableta cada 8 horas",
        "duration": "5 días",
        "instructions": "Tomar después de las comidas"
      },
      {
        "name": "Amoxicilina 500mg",
        "dosage": "1 cápsula cada 8 horas",
        "duration": "7 días",
        "instructions": "Completar todo el tratamiento"
      }
    ],
    "diagnosis": "Infección periapical",
    "createdBy": "usr_doctor456",
    "createdAt": "2025-04-01T10:15:00Z"
  }
  ```
</ResponseExample>
