Create Medication

Create Medication using FHIR R4 4.0.1.

Resource category: Medication.

Endpoint

MethodEndpoint
POST/api/fhir/r4/Medication

Use the R4 base URL from your DDFS instance. Send Authorization: Bearer <access-token> and accept application/fhir+json.

Send Content-Type: application/fhir+json.

Parameters

ParameterLocationRequiredTypeDescription
MedicationJSON request bodyYesFHIR R4 MedicationSupply a valid complete resource. The server assigns the created resource ID.

Authorization

ContextResource scope
Resource-server definition / issued tokensystem/Medication.c
Client grant / token requestddfssystem/Medication.c

Resource constraints still apply. Use the least privilege needed for this operation; see authentication and scope configuration.

Example Request

Replace the example logical IDs, version IDs and connection values with values for your workflow.

POST /api/fhir/r4/Medication
Content-Type: application/fhir+json

{
  "resourceType": "Medication",
  "identifier": [
    {
      "system": "https://example.test/medications",
      "value": "med-001"
    }
  ],
  "code": {
    "coding": [
      {
        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
        "code": "860975"
      }
    ]
  },
  "status": "active",
  "ingredient": [
    {
      "itemCodeableConcept": {
        "text": "Metformin hydrochloride"
      },
      "isActive": true
    }
  ],
  "batch": {
    "lotNumber": "synthetic-lot",
    "expirationDate": "2027-01-01"
  }
}

Responses

Successful statusMeaning
201Resource created; response content follows the supported return preference.

For common error statuses and FHIR-formatted error bodies, see OperationOutcome errors. Authentication/authorization responses follow the shared policy; a protected resource can be concealed as 404. See also interaction responses.

Supported Prefer return preferences control response content; applicable Location, ETag and Last-Modified headers follow the lifecycle contract.