> ## 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.

# Retrieve a FHIR resource by identifier



## OpenAPI

````yaml /openapi/marmar-cds.openapi.yaml get /v1/fhir/{resourceType}/{id}
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/fhir/{resourceType}/{id}:
    get:
      tags:
        - FHIR
      summary: Retrieve a FHIR resource by identifier
      operationId: getFhirResource
      parameters:
        - $ref: '#/components/parameters/FhirResourceTypePath'
        - $ref: '#/components/parameters/FhirResourceIdPath'
      responses:
        '200':
          description: FHIR resource payload
          content:
            application/fhir+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/FhirPatient'
                  - $ref: '#/components/schemas/FhirMedicationStatement'
                  - $ref: '#/components/schemas/FhirMedicationRequest'
                  - $ref: '#/components/schemas/FhirCondition'
                  - $ref: '#/components/schemas/FhirAllergyIntolerance'
                  - $ref: '#/components/schemas/FhirObservation'
                  - $ref: '#/components/schemas/FhirEncounter'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationOutcome'
      security:
        - BearerAuth: []
components:
  parameters:
    FhirResourceTypePath:
      name: resourceType
      in: path
      required: true
      description: FHIR resource type.
      schema:
        type: string
        enum:
          - Patient
          - MedicationStatement
          - MedicationRequest
          - Condition
          - AllergyIntolerance
          - Observation
          - Encounter
    FhirResourceIdPath:
      name: id
      in: path
      required: true
      description: Resource identifier.
      schema:
        type: string
  schemas:
    FhirPatient:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Patient
        id:
          type: string
        identifier:
          type: array
          items:
            $ref: '#/components/schemas/FhirIdentifier'
        name:
          type: array
          items:
            $ref: '#/components/schemas/FhirHumanName'
        gender:
          type: string
        birthDate:
          type: string
      required:
        - resourceType
    FhirMedicationStatement:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - MedicationStatement
        id:
          type: string
        status:
          type: string
        medicationCodeableConcept:
          $ref: '#/components/schemas/FhirCodeableConcept'
        subject:
          $ref: '#/components/schemas/FhirReference'
        effectiveDateTime:
          type: string
        effectivePeriod:
          type: object
          properties:
            start:
              type: string
            end:
              type: string
        dateAsserted:
          type: string
        dosage:
          type: array
          items:
            $ref: '#/components/schemas/FhirDosage'
      required:
        - resourceType
        - subject
    FhirMedicationRequest:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - MedicationRequest
        id:
          type: string
        status:
          type: string
        intent:
          type: string
        medicationCodeableConcept:
          $ref: '#/components/schemas/FhirCodeableConcept'
        subject:
          $ref: '#/components/schemas/FhirReference'
        authoredOn:
          type: string
        requester:
          $ref: '#/components/schemas/FhirReference'
        dosageInstruction:
          type: array
          items:
            $ref: '#/components/schemas/FhirDosage'
      required:
        - resourceType
        - subject
    FhirCondition:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Condition
        id:
          type: string
        clinicalStatus:
          $ref: '#/components/schemas/FhirCodeableConcept'
        verificationStatus:
          $ref: '#/components/schemas/FhirCodeableConcept'
        code:
          $ref: '#/components/schemas/FhirCodeableConcept'
        subject:
          $ref: '#/components/schemas/FhirReference'
        recordedDate:
          type: string
      required:
        - resourceType
        - subject
    FhirAllergyIntolerance:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - AllergyIntolerance
        id:
          type: string
        clinicalStatus:
          $ref: '#/components/schemas/FhirCodeableConcept'
        verificationStatus:
          $ref: '#/components/schemas/FhirCodeableConcept'
        code:
          $ref: '#/components/schemas/FhirCodeableConcept'
        patient:
          $ref: '#/components/schemas/FhirReference'
        recordedDate:
          type: string
        reaction:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
              severity:
                type: string
      required:
        - resourceType
        - patient
    FhirObservation:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Observation
        id:
          type: string
        status:
          type: string
        category:
          type: array
          items:
            $ref: '#/components/schemas/FhirCodeableConcept'
        code:
          $ref: '#/components/schemas/FhirCodeableConcept'
        subject:
          $ref: '#/components/schemas/FhirReference'
        effectiveDateTime:
          type: string
        valueQuantity:
          type: object
          properties:
            value:
              type: number
            unit:
              type: string
      required:
        - resourceType
        - code
        - subject
    FhirEncounter:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Encounter
        id:
          type: string
        status:
          type: string
        class:
          type: object
          properties:
            code:
              type: string
            display:
              type: string
        subject:
          $ref: '#/components/schemas/FhirReference'
        period:
          type: object
          properties:
            start:
              type: string
            end:
              type: string
      required:
        - resourceType
        - subject
    OperationOutcome:
      type: object
      additionalProperties: false
      properties:
        resourceType:
          type: string
          enum:
            - OperationOutcome
        issue:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              severity:
                type: string
                enum:
                  - fatal
                  - error
                  - warning
                  - information
              code:
                type: string
              diagnostics:
                type: string
              expression:
                type: array
                items:
                  type: string
            required:
              - severity
              - code
      required:
        - resourceType
        - issue
    FhirIdentifier:
      type: object
      properties:
        system:
          type: string
        value:
          type: string
      required:
        - value
    FhirHumanName:
      type: object
      properties:
        family:
          type: string
        given:
          type: array
          items:
            type: string
        text:
          type: string
    FhirCodeableConcept:
      type: object
      properties:
        text:
          type: string
        coding:
          type: array
          items:
            type: object
            properties:
              system:
                type: string
              code:
                type: string
              display:
                type: string
    FhirReference:
      type: object
      properties:
        reference:
          type: string
        display:
          type: string
      required:
        - reference
    FhirDosage:
      type: object
      properties:
        text:
          type: string
        route:
          $ref: '#/components/schemas/FhirCodeableConcept'
        method:
          $ref: '#/components/schemas/FhirCodeableConcept'
        doseQuantity:
          type: object
          properties:
            value:
              type: number
            unit:
              type: string
        timing:
          type: object
          properties:
            repeat:
              type: object
              properties:
                frequency:
                  type: number
                period:
                  type: number
                periodUnit:
                  type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key obtained from the Tenant Dashboard. Use as Authorization: Bearer
        YOUR_API_KEY

````