Managing Relationship Definition

Relationship definitions defines links between the available profiles.

Once profiles are created, you can define existing relationships between them by creation Relationship Definition.

A relationship definition can be created by defining the from and to attributes. Relationship profiles can also contain properties.

{
   "from":{
      "profileKey":"<from-profile-key>",
      "includeKey":"<from-relationship-key>",
      "cardinality":"<cardinality>"
   },
   "to":{
      "profileKey":"<to-profile-key>",
      "includeKey":"<to-relationship-key>",
      "cardinality":"<cardinality>"
   },
   // Optional
   "properties":{
      "<propertyKey>":{
         "type":"<type>"
      }
   }
}

Create a relationship

Once base profiles are created, and you want to link them together (ex: Linking a provider and it's office), you must create a relationship definition.

{
  "from": {
    "profileKey": "provider",
    "includeKey": "worksAt", // Name for the property "practitioner -> worksAt -> office"
    "includeCardinality": "0:*"
  },
  "to": {
    "profileKey": "office",
    "includeKey": "staff",  // Name for the property "office -> staff -> practitioner"
    "includeCardinality": "0:*"
  }
}

📘

For more Relationship Definition endpoint references (Fetch), see our Relationship Definition API documentation.