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

# Create a medication safety assessment



## OpenAPI

````yaml /openapi/marmar-cds.openapi.yaml post /v1/assessments
openapi: 3.1.0
info:
  title: Marmar Clinical Decision Support Reference
  version: 0.1.0
  description: >
    API for integrating Marmar's medication safety assessments into clinical
    workflows. Tenants can synchronize patient records, request assessments, and
    receive webhook notifications when assessments are completed.
servers:
  - url: https://cds.marmar.life
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags:
  - name: Patients
  - name: Assessments
  - name: Tenants
  - name: Webhooks
  - name: FHIR
paths:
  /v1/assessments:
    post:
      tags:
        - Assessments
      summary: Create a medication safety assessment
      operationId: createAssessment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAssessmentRequest'
      responses:
        '202':
          description: Assessment request accepted for processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssessmentQueuedResponse'
        '400':
          description: Invalid request payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateAssessmentRequest:
      type: object
      properties:
        patient:
          $ref: '#/components/schemas/PatientContext'
        medications:
          type: array
          items:
            $ref: '#/components/schemas/MedicationInput'
          minItems: 1
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ConditionInput'
          nullable: true
          example: null
        allergies:
          type: array
          items:
            $ref: '#/components/schemas/AllergyInput'
          nullable: true
          example: null
        vitals:
          type: array
          items:
            $ref: '#/components/schemas/VitalSignInput'
          nullable: true
          example: null
        labs:
          type: array
          items:
            $ref: '#/components/schemas/LabResultInput'
          nullable: true
          example: null
        socialHistory:
          type: array
          items:
            $ref: '#/components/schemas/SocialHistoryInput'
          nullable: true
          example: null
      required:
        - patient
        - medications
    AssessmentQueuedResponse:
      type: object
      properties:
        assessmentId:
          $ref: '#/components/schemas/Identifier'
        status:
          type: string
          enum:
            - PENDING
        createdAt:
          type: string
          format: date-time
      required:
        - assessmentId
        - status
        - createdAt
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    PatientContext:
      type: object
      properties:
        patientId:
          $ref: '#/components/schemas/Identifier'
          nullable: true
          example: null
        externalId:
          type: string
          nullable: true
          example: null
        demographics:
          allOf:
            - $ref: '#/components/schemas/PatientDemographics'
          nullable: true
          example: null
        reproductiveStatus:
          $ref: '#/components/schemas/ReproductiveStatus'
          nullable: true
          example: null
        hormonalTherapies:
          type: array
          items:
            $ref: '#/components/schemas/HormonalTherapy'
          nullable: true
          example: null
      anyOf:
        - required:
            - patientId
        - required:
            - demographics
    MedicationInput:
      type: object
      properties:
        name:
          type: string
        form:
          type: string
          nullable: true
          example: null
        route:
          type: string
          nullable: true
          example: null
        dosage:
          $ref: '#/components/schemas/MedicationDosage'
        status:
          $ref: '#/components/schemas/MedicationStatus'
          nullable: true
          example: null
        providedRxNormCode:
          type: string
          nullable: true
          example: null
        providedDrugbankId:
          type: string
          nullable: true
          example: null
        source:
          type: string
          nullable: true
          example: null
        startDate:
          type: string
          format: date
          nullable: true
          example: null
        endDate:
          type: string
          format: date
          nullable: true
          example: null
      required:
        - name
        - dosage
    ConditionInput:
      type: object
      properties:
        name:
          type: string
        code:
          type: string
          nullable: true
          example: null
        system:
          type: string
          nullable: true
          example: null
        severity:
          type: string
          nullable: true
          example: null
        onsetDate:
          type: string
          format: date
          nullable: true
          example: null
        abatementDate:
          type: string
          format: date
          nullable: true
          example: null
      required:
        - name
    AllergyInput:
      type: object
      properties:
        name:
          type: string
        substanceCode:
          type: string
          nullable: true
          example: null
        reaction:
          type: string
          nullable: true
          example: null
        severity:
          type: string
          nullable: true
          example: null
      required:
        - name
    VitalSignInput:
      type: object
      properties:
        type:
          type: string
        value:
          type: number
          format: float
        unit:
          type: string
        recordedAt:
          type: string
          format: date-time
      required:
        - type
        - value
        - unit
        - recordedAt
    LabResultInput:
      type: object
      properties:
        type:
          type: string
        value:
          oneOf:
            - type: number
              format: float
            - type: string
        unit:
          type: string
          nullable: true
          example: null
        referenceRange:
          type: string
          nullable: true
          example: null
        recordedAt:
          type: string
          format: date-time
      required:
        - type
        - value
        - recordedAt
    SocialHistoryInput:
      type: object
      properties:
        factor:
          type: string
        status:
          type: string
        notes:
          type: string
          nullable: true
          example: null
      required:
        - factor
        - status
    Identifier:
      type: string
      format: uuid
    PatientDemographics:
      type: object
      properties:
        firstName:
          type: string
          nullable: true
          example: null
        lastName:
          type: string
          nullable: true
          example: null
        phone:
          type: string
          nullable: true
          example: null
        dateOfBirth:
          type: string
          format: date
          nullable: true
          example: null
        sex:
          $ref: '#/components/schemas/Sex'
        genderIdentity:
          type: string
          nullable: true
          example: null
        weightKg:
          type: number
          format: float
          nullable: true
          example: null
        heightCm:
          type: number
          format: float
          nullable: true
          example: null
        ethnicity:
          type: string
          nullable: true
          example: null
    ReproductiveStatus:
      type: string
      enum:
        - REGULAR_CYCLE
        - PREGNANT
        - BREASTFEEDING
        - PERIMENOPAUSE
        - POSTMENOPAUSAL
        - PLANNING_PREGNANCY
        - UNKNOWN
    HormonalTherapy:
      type: object
      properties:
        name:
          type: string
        classification:
          type: string
        startDate:
          type: string
          format: date
          nullable: true
        endDate:
          type: string
          format: date
          nullable: true
      required:
        - name
        - classification
    MedicationDosage:
      type: object
      properties:
        amount:
          type: number
          format: float
        unit:
          type: string
          nullable: true
          example: null
        frequency:
          type: string
          nullable: true
      required:
        - amount
        - unit
    MedicationStatus:
      type: string
      enum:
        - ACTIVE
        - COMPLETE
        - INTENDED
        - STOPPED
    Sex:
      type: string
      enum:
        - MALE
        - FEMALE
        - OTHER
      nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key obtained from the Tenant Dashboard. Use as Authorization: Bearer
        YOUR_API_KEY

````