Historical Import

Specifying Metadata information on resources and relationships creation

Each hit returned by Clinia is enriched with metadata information such as createdAt and updatedAt information that is an out-of-the-box system generated information by Clinia's infrastructure.

To allow for more flexibility and support a system migration, Clinia's Resource API and Bulk API allow specifying metadata information in a create operation (This also includes resources created in an upsert operation, but not in an update operation).

System modifiable metadata properties are:

{
    "createdAt": "<datetime>",
    "updatedAt": "<datetime>",
    "identifier": [
        {
            // Identifier type
        }
    ]
}

Metadata Rules

Some validation rules are imposed on those metadata to ensure consistency with system-generated values. Those are:

  • If a value is specified for updatedAt, one must also be provided for createdAt
  • The datetime value of the updatedAt must be greater or equal to the createdAt
  • The createdAt and updatedAt datetime values cannot be in the future.
  • The identifier field must contain Identifier Type with distinct combined valuee of system, use and value fields.
    • Field use can't take the reserved value "source"
    • Field system can't take the reserved value "mdm"

Bulk API Metadata

When using the Bulk API, Create and Upsert (Resource or relationship creation only) operations allow for meta properties to be specified such as:

{
    "operations": [
        {
            "action": "CREATE",
            "create": {
                "data": {},
                "contained": {},
                "meta": {
                    "createdAt": "2023-12-12T15:30:10.0000Z",
                    "updatedAt": "2023-12-12T15:31:10.0000Z",
                    "identifier": [
                        {
                            "system": "<uri>",
                            "use": "<symbol>",
                            "value": "<code>",
                            "period": {
                                "start": "<datetime>",
                                "end": "<datetime>"
                            }
                        }
                    ]
                }
            }
        },
        {
            "action": "UPSERT",
            "upsert": {
                "data": {},
                "contained": {},
                "meta": {
                    "createdAt": "2023-12-12T15:30:10.0000Z",
                    "updatedAt": "2023-12-12T15:31:10.0000Z"
                }
            }
        }
    ]
}

Resource & Relationship API Metadata

The same metadata can be specified when using the resource or relationship endpoints.

Resource Create:

{
    "data": {},
    "contained": {},
    "meta": {
        "createdAt": "2023-12-12T15:30:10.0000Z",
        "updatedAt": "2023-12-12T15:31:10.0000Z",
        "identifier": [
            {
                "system": "<uri>",
                "use": "<symbol>",
                "value": "<code>",
                "period": {
                    "start": "<datetime>",
                    "end": "<datetime>"
                }
            }
        ]
    }
}

For base payload, see Creating a Resource documentation

Relationship Create:

{
    "from": {},
    "to": {},
    "data": {},
    "meta": {
        "createdAt": "2023-12-12T15:30:10.0000Z",
        "updatedAt": "2023-12-12T15:31:10.0000Z",
        "identifier": [
            {
                "system": "<uri>",
                "use": "<symbol>",
                "value": "<code>",
                "period": {
                    "start": "<datetime>",
                    "end": "<datetime>"
                }
            }
        ]
    }
}

For base payload, see Creating a Relationship documentation