---
agentTools:
  projectIndex: https://docs.marbleapi.com/llms.txt
---

# Post Life FHIR Resource

Creates a specific FHIR resource.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Public",
    "version": "21.09"
  },
  "servers": [
    {
      "url": "https://api.marbleapi.com"
    }
  ],
  "paths": {
    "/lives/{lifeId}/data/fhir/r4/{resourceType}": {
      "post": {
        "tags": [
          "Data"
        ],
        "summary": "Post Life FHIR Resource",
        "description": "Creates a specific FHIR resource.",
        "operationId": "data-post-lifefhirresource",
        "parameters": [
          {
            "$ref": "#/components/parameters/apiVersion"
          },
          {
            "name": "lifeId",
            "in": "path",
            "description": "Life Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/resourceType"
          }
        ],
        "requestBody": {
          "description": "Body payload to send",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewFhirData"
              },
              "example": {
                "resourceType": "DocumentReference",
                "id": "example",
                "text": {
                  "status": "generated",
                  "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: example</p><p><b>contained</b>: </p><p><b>masterIdentifier</b>: urn:oid:1.3.6.1.4.1.21367.2005.3.7</p><p><b>identifier</b>: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234</p><p><b>status</b>: current</p><p><b>docStatus</b>: preliminary</p><p><b>type</b>: Outpatient Note <span>(Details : {LOINC code '34108-1' = 'Outpatient Note', given as 'Outpatient Note'})</span></p><p><b>category</b>: History and Physical <span>(Details : {http://ihe.net/xds/connectathon/classCodes code 'History and Physical' = 'History and Physical', given as 'History and Physical'})</span></p><p><b>subject</b>: <a>Patient/xcda</a></p><p><b>date</b>: 24/12/2005 9:43:41 AM</p><p><b>author</b>: </p><ul><li><a>Practitioner/xcda1</a></li><li>id: a2; Gerald Smitty </li></ul><p><b>authenticator</b>: <a>Organization/f001</a></p><p><b>custodian</b>: <a>Organization/f001</a></p><h3>RelatesTos</h3><table><tr><td>-</td><td><b>Code</b></td><td><b>Target</b></td></tr><tr><td>*</td><td>appends</td><td><a>DocumentReference/example</a></td></tr></table><p><b>description</b>: Physical</p><p><b>securityLabel</b>: very restricted <span>(Details : {http://terminology.hl7.org/CodeSystem/v3-Confidentiality code 'V' = 'very restricted', given as 'very restricted'})</span></p><h3>Contents</h3><table><tr><td>-</td><td><b>Attachment</b></td><td><b>Format</b></td></tr><tr><td>*</td><td/><td>History and Physical Specification (Details: urn:oid:1.3.6.1.4.1.19376.1.2.3 code urn:ihe:pcc:handp:2008 = 'urn:ihe:pcc:handp:2008', stated as 'History and Physical Specification')</td></tr></table><h3>Contexts</h3><table><tr><td>-</td><td><b>Encounter</b></td><td><b>Event</b></td><td><b>Period</b></td><td><b>FacilityType</b></td><td><b>PracticeSetting</b></td><td><b>SourcePatientInfo</b></td><td><b>Related</b></td></tr><tr><td>*</td><td><a>Encounter/xcda</a></td><td>Arm <span>(Details : {http://ihe.net/xds/connectathon/eventCodes code 'T-D8200' = 'T-D8200', given as 'Arm'})</span></td><td>23/12/2004 8:00:00 AM --> 23/12/2004 8:01:00 AM</td><td>Outpatient <span>(Details : {http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes code 'Outpatient' = 'Outpatient', given as 'Outpatient'})</span></td><td>General Medicine <span>(Details : {http://www.ihe.net/xds/connectathon/practiceSettingCodes code 'General Medicine' = 'General Medicine', given as 'General Medicine'})</span></td><td><a>Patient/xcda</a></td><td><a>Patient/xcda</a></td></tr></table></div>"
                },
                "contained": [
                  {
                    "resourceType": "Practitioner",
                    "id": "a2",
                    "name": [
                      {
                        "family": "Smitty",
                        "given": [
                          "Gerald"
                        ]
                      }
                    ]
                  }
                ],
                "masterIdentifier": {
                  "system": "urn:ietf:rfc:3986",
                  "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7"
                },
                "identifier": [
                  {
                    "system": "urn:ietf:rfc:3986",
                    "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234"
                  }
                ],
                "status": "current",
                "docStatus": "preliminary",
                "type": {
                  "coding": [
                    {
                      "system": "http://loinc.org",
                      "code": "34108-1",
                      "display": "Outpatient Note"
                    }
                  ]
                },
                "category": [
                  {
                    "coding": [
                      {
                        "system": "http://ihe.net/xds/connectathon/classCodes",
                        "code": "History and Physical",
                        "display": "History and Physical"
                      }
                    ]
                  }
                ],
                "subject": {
                  "reference": "Patient/xcda"
                },
                "date": "2005-12-24T09:43:41+11:00",
                "author": [
                  {
                    "reference": "Practitioner/xcda1"
                  },
                  {
                    "reference": "#a2"
                  }
                ],
                "authenticator": {
                  "reference": "Organization/f001"
                },
                "custodian": {
                  "reference": "Organization/f001"
                },
                "relatesTo": [
                  {
                    "code": "appends",
                    "target": {
                      "reference": "DocumentReference/example"
                    }
                  }
                ],
                "description": "Physical",
                "securityLabel": [
                  {
                    "coding": [
                      {
                        "system": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality",
                        "code": "V",
                        "display": "very restricted"
                      }
                    ]
                  }
                ],
                "content": [
                  {
                    "attachment": {
                      "contentType": "application/hl7-v3+xml",
                      "language": "en-US",
                      "url": "http://example.org/xds/mhd/Binary/07a6483f-732b-461e-86b6-edb665c45510",
                      "size": 3654,
                      "hash": "2jmj7l5rSw0yVb/vlWAYkK/YBwk=",
                      "title": "Physical",
                      "creation": "2005-12-24T09:35:00+11:00"
                    },
                    "format": {
                      "system": "urn:oid:1.3.6.1.4.1.19376.1.2.3",
                      "code": "urn:ihe:pcc:handp:2008",
                      "display": "History and Physical Specification"
                    }
                  }
                ],
                "context": {
                  "encounter": [
                    {
                      "reference": "Encounter/xcda"
                    }
                  ],
                  "event": [
                    {
                      "coding": [
                        {
                          "system": "http://ihe.net/xds/connectathon/eventCodes",
                          "code": "T-D8200",
                          "display": "Arm"
                        }
                      ]
                    }
                  ],
                  "period": {
                    "start": "2004-12-23T08:00:00+11:00",
                    "end": "2004-12-23T08:01:00+11:00"
                  },
                  "facilityType": {
                    "coding": [
                      {
                        "system": "http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes",
                        "code": "Outpatient",
                        "display": "Outpatient"
                      }
                    ]
                  },
                  "practiceSetting": {
                    "coding": [
                      {
                        "system": "http://www.ihe.net/xds/connectathon/practiceSettingCodes",
                        "code": "General Medicine",
                        "display": "General Medicine"
                      }
                    ]
                  },
                  "sourcePatientInfo": {
                    "reference": "Patient/xcda"
                  },
                  "related": [
                    {
                      "reference": "Patient/xcda",
                      "identifier": {
                        "system": "urn:ietf:rfc:3986",
                        "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.2345"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK - Data created\n\nOther properties may be present depending on Resource Type\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FhirData"
                },
                "example": {
                  "resourceType": "DocumentReference",
                  "id": "e771575a-8378-4422-85ad-4ac2b438acc8",
                  "meta": {
                    "versionId": "1",
                    "lastUpdated": "2022-02-03T00:25:03.5-05:00"
                  },
                  "text": {
                    "status": "generated",
                    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: example</p><p><b>contained</b>: </p><p><b>masterIdentifier</b>: urn:oid:1.3.6.1.4.1.21367.2005.3.7</p><p><b>identifier</b>: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234</p><p><b>status</b>: current</p><p><b>docStatus</b>: preliminary</p><p><b>type</b>: Outpatient Note <span>(Details : {LOINC code '34108-1' = 'Outpatient Note', given as 'Outpatient Note'})</span></p><p><b>category</b>: History and Physical <span>(Details : {http://ihe.net/xds/connectathon/classCodes code 'History and Physical' = 'History and Physical', given as 'History and Physical'})</span></p><p><b>subject</b>: <a>Patient/xcda</a></p><p><b>date</b>: 24/12/2005 9:43:41 AM</p><p><b>author</b>: </p><ul><li><a>Practitioner/xcda1</a></li><li>id: a2; Gerald Smitty </li></ul><p><b>authenticator</b>: <a>Organization/f001</a></p><p><b>custodian</b>: <a>Organization/f001</a></p><h3>RelatesTos</h3><table><tr><td>-</td><td><b>Code</b></td><td><b>Target</b></td></tr><tr><td>*</td><td>appends</td><td><a>DocumentReference/example</a></td></tr></table><p><b>description</b>: Physical</p><p><b>securityLabel</b>: very restricted <span>(Details : {http://terminology.hl7.org/CodeSystem/v3-Confidentiality code 'V' = 'very restricted', given as 'very restricted'})</span></p><h3>Contents</h3><table><tr><td>-</td><td><b>Attachment</b></td><td><b>Format</b></td></tr><tr><td>*</td><td/><td>History and Physical Specification (Details: urn:oid:1.3.6.1.4.1.19376.1.2.3 code urn:ihe:pcc:handp:2008 = 'urn:ihe:pcc:handp:2008', stated as 'History and Physical Specification')</td></tr></table><h3>Contexts</h3><table><tr><td>-</td><td><b>Encounter</b></td><td><b>Event</b></td><td><b>Period</b></td><td><b>FacilityType</b></td><td><b>PracticeSetting</b></td><td><b>SourcePatientInfo</b></td><td><b>Related</b></td></tr><tr><td>*</td><td><a>Encounter/xcda</a></td><td>Arm <span>(Details : {http://ihe.net/xds/connectathon/eventCodes code 'T-D8200' = 'T-D8200', given as 'Arm'})</span></td><td>23/12/2004 8:00:00 AM --> 23/12/2004 8:01:00 AM</td><td>Outpatient <span>(Details : {http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes code 'Outpatient' = 'Outpatient', given as 'Outpatient'})</span></td><td>General Medicine <span>(Details : {http://www.ihe.net/xds/connectathon/practiceSettingCodes code 'General Medicine' = 'General Medicine', given as 'General Medicine'})</span></td><td><a>Patient/xcda</a></td><td><a>Patient/xcda</a></td></tr></table></div>"
                  },
                  "contained": [
                    {
                      "resourceType": "Practitioner",
                      "id": "a2",
                      "name": [
                        {
                          "family": "Smitty",
                          "given": [
                            "Gerald"
                          ]
                        }
                      ]
                    }
                  ],
                  "extension": [
                    {
                      "url": "http://medchart.com/fhir/extensions/mc-data-owner-id",
                      "valueString": "VK0nHTwB8ZGopSAot8mJyvs1CGfzovrJ@clients"
                    }
                  ],
                  "masterIdentifier": {
                    "system": "urn:ietf:rfc:3986",
                    "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7"
                  },
                  "identifier": [
                    {
                      "system": "urn:ietf:rfc:3986",
                      "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234"
                    }
                  ],
                  "status": "current",
                  "docStatus": "preliminary",
                  "type": {
                    "coding": [
                      {
                        "system": "http://loinc.org",
                        "code": "34108-1",
                        "display": "Outpatient Note"
                      }
                    ]
                  },
                  "category": [
                    {
                      "coding": [
                        {
                          "system": "http://ihe.net/xds/connectathon/classCodes",
                          "code": "History and Physical",
                          "display": "History and Physical"
                        }
                      ]
                    }
                  ],
                  "subject": {
                    "reference": "Patient/xcda"
                  },
                  "date": "2005-12-23T17:43:41-05:00",
                  "author": [
                    {
                      "reference": "Practitioner/xcda1"
                    },
                    {
                      "reference": "#a2"
                    }
                  ],
                  "authenticator": {
                    "reference": "Organization/f001"
                  },
                  "custodian": {
                    "reference": "Organization/f001"
                  },
                  "relatesTo": [
                    {
                      "code": "appends",
                      "target": {
                        "reference": "DocumentReference/example"
                      }
                    }
                  ],
                  "description": "Physical",
                  "securityLabel": [
                    {
                      "coding": [
                        {
                          "system": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality",
                          "code": "V",
                          "display": "very restricted"
                        }
                      ]
                    }
                  ],
                  "content": [
                    {
                      "attachment": {
                        "contentType": "application/hl7-v3+xml",
                        "language": "en-US",
                        "url": "http://example.org/xds/mhd/Binary/07a6483f-732b-461e-86b6-edb665c45510",
                        "size": 3654,
                        "hash": "2jmj7l5rSw0yVb/vlWAYkK/YBwk=",
                        "title": "Physical",
                        "creation": "2005-12-23T17:35:00-05:00"
                      },
                      "format": {
                        "system": "urn:oid:1.3.6.1.4.1.19376.1.2.3",
                        "code": "urn:ihe:pcc:handp:2008",
                        "display": "History and Physical Specification"
                      }
                    }
                  ],
                  "context": {
                    "encounter": [
                      {
                        "reference": "Encounter/xcda"
                      }
                    ],
                    "event": [
                      {
                        "coding": [
                          {
                            "system": "http://ihe.net/xds/connectathon/eventCodes",
                            "code": "T-D8200",
                            "display": "Arm"
                          }
                        ]
                      }
                    ],
                    "period": {
                      "start": "2004-12-22T16:00:00-05:00",
                      "end": "2004-12-22T16:01:00-05:00"
                    },
                    "facilityType": {
                      "coding": [
                        {
                          "system": "http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes",
                          "code": "Outpatient",
                          "display": "Outpatient"
                        }
                      ]
                    },
                    "practiceSetting": {
                      "coding": [
                        {
                          "system": "http://www.ihe.net/xds/connectathon/practiceSettingCodes",
                          "code": "General Medicine",
                          "display": "General Medicine"
                        }
                      ]
                    },
                    "sourcePatientInfo": {
                      "reference": "Patient/xcda"
                    },
                    "related": [
                      {
                        "reference": "Patient/xcda",
                        "identifier": {
                          "system": "urn:ietf:rfc:3986",
                          "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.2345"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/403Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404NotFound"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BadRequest": {
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "example": "An error has occurred."
                },
                "message": {
                  "type": "string",
                  "example": "One or more validations errors occurred."
                },
                "field": {
                  "type": "string",
                  "example": "givenName"
                }
              }
            }
          }
        }
      },
      "FhirData": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/NewFhirData"
          }
        ],
        "properties": {
          "meta": {
            "type": "object",
            "properties": {
              "versionId": {
                "type": "string"
              },
              "lastUpdated": {
                "type": "string"
              }
            }
          }
        }
      },
      "NewFhirData": {
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "text": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "div": {
                "type": "string"
              }
            }
          },
          "status": {
            "type": "string"
          },
          "category": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "coding": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "system": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "display": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "code": {
            "type": "object",
            "properties": {
              "coding": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "system": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "display": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "subject": {
            "type": "object",
            "properties": {
              "reference": {
                "type": "string"
              }
            }
          },
          "encounter": {
            "type": "object",
            "properties": {
              "reference": {
                "type": "string"
              }
            }
          },
          "effectiveDateTime": {
            "type": "string",
            "format": "date"
          },
          "valueQuantity": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              },
              "system": {
                "type": "string"
              },
              "code": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyHeader": {
        "type": "apiKey",
        "name": "Api-Key",
        "in": "header"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Always required, obtain one using your Client Id and Client Secret"
      }
    },
    "parameters": {
      "apiVersion": {
        "name": "api-version",
        "in": "query",
        "description": "API Version",
        "schema": {
          "type": "string",
          "default": "21.09"
        }
      },
      "resourceType": {
        "name": "resourceType",
        "in": "path",
        "description": "Resource type (must be FHIR v4.0.1)",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "CapabilityStatement",
            "StructureDefinition",
            "ImplementationGuide",
            "SearchParameter",
            "MessageDefinition",
            "OperationDefinition",
            "CompartmentDefinition",
            "StructureMap",
            "GraphDefinition",
            "ExampleScenario",
            "CodeSystem",
            "ValueSet",
            "ConceptMap",
            "NamingSystem",
            "TerminologyCapabilities",
            "Provenance",
            "AuditEvent",
            "Consent",
            "Composition",
            "DocumentManifest",
            "DocumentReference",
            "CatalogEntry",
            "Basic",
            "Linkage",
            "MessageHeader",
            "Parameters",
            "Subscription",
            "Patient",
            "Practitioner",
            "PractitionerRole",
            "RelatedPerson",
            "Person",
            "Group",
            "Organization",
            "OrganizationAffiliation",
            "HealthcareService",
            "Endpoint",
            "Location",
            "Substance",
            "BiologicallyDerivedProduct",
            "Device",
            "DeviceMetric",
            "Task",
            "Appointment",
            "AppointmentResponse",
            "Schedule",
            "Slot",
            "VerificationResult",
            "Encounter",
            "EpisodeOfCare",
            "Flag",
            "List",
            "Library",
            "AllergyIntolerance",
            "AdverseEvent",
            "Condition",
            "Procedure",
            "FamilyMemberHistory",
            "ClinicalImpression",
            "DetectedIssue",
            "Observation",
            "Media",
            "DiagnosticReport",
            "Specimen",
            "BodyStructure",
            "ImagingStudy",
            "QuestionnaireResponse",
            "MolecularSequence",
            "MedicationRequest",
            "MedicationAdministration",
            "MedicationDispense",
            "MedicationStatement",
            "Medication",
            "MedicationKnowledge",
            "Immunization",
            "ImmunizationEvaluation",
            "ImmunizationRecommendation",
            "CarePlan",
            "CareTeam",
            "Goal",
            "ServiceRequest",
            "NutritionOrder",
            "VisionPrescription",
            "RiskAssessment",
            "RequestGroup",
            "Communication",
            "CommunicationRequest",
            "DeviceRequest",
            "DeviceUseStatement",
            "GuidanceResponse",
            "SupplyRequest",
            "SupplyDelivery",
            "Coverage",
            "CoverageEligibilityRequest",
            "CoverageEligibilityResponse",
            "EnrollmentRequest",
            "EnrollmentResponse",
            "Claim",
            "ClaimResponse",
            "Invoice",
            "PaymentNotice",
            "PaymentReconciliation",
            "Account",
            "ChargeItem",
            "ChargeItemDefinition",
            "Contract",
            "ExplanationOfBenefit",
            "InsurancePlan",
            "ResearchStudy",
            "ResearchSubject",
            "ActivityDefinition",
            "DeviceDefinition",
            "EventDefinition",
            "ObservationDefinition",
            "PlanDefinition",
            "Questionnaire",
            "SpecimenDefinition",
            "ResearchDefinition",
            "ResearchElementDefinition",
            "Evidence",
            "EvidenceVariable",
            "EffectEvidenceSynthesis",
            "RiskEvidenceSynthesis",
            "Measure",
            "MeasureReport",
            "TestScript",
            "TestReport",
            "MedicinalProduct",
            "MedicinalProductAuthorization",
            "MedicinalProductContraindication",
            "MedicinalProductIngredient",
            "MedicinalProductInteraction",
            "MedicinalProductManufactured",
            "MedicinalProductPackaged",
            "MedicinalProductPharmaceutical",
            "MedicinalProductUndesirableEffect",
            "SubstanceNucleicAcid",
            "SubstancePolymer",
            "SubstanceProtein",
            "SubstanceReferenceInformation",
            "SubstanceSpecification",
            "SubstanceSourceMaterial"
          ]
        }
      }
    },
    "responses": {
      "400BadRequest": {
        "description": "Bad Request <br><br>Returned when there is an error in the validation in any of the fields.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BadRequest",
              "example": {
                "errors": [
                  {
                    "code": "An error has occurred.",
                    "message": "One or more validations errors occurred.",
                    "field": "givenName"
                  }
                ]
              }
            }
          }
        }
      },
      "403Forbidden": {
        "description": "Forbidden <br><br>Returned when there are no authorizations for the specific resource."
      },
      "404NotFound": {
        "description": "Resource not found <br><br>Returned when the specific resource could not be found, or does not exist."
      }
    }
  },
  "security": [
    {
      "bearerAuth": [],
      "apiKeyHeader": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 99,
      "1": 129,
      "2": 102,
      "3": 174,
      "4": 222,
      "5": 237,
      "6": 125,
      "7": 0,
      "8": 30,
      "9": 225,
      "10": 38,
      "11": 162
    }
  }
}
```