For AI agents: the documentation index is at /docs/aidbox/llms.txt. A Markdown version of this page is available at /docs/aidbox/notebooks.md or by requesting it with the Accept: text/markdown header.
Aidbox Docs
All notebooks

Create self-measurement Task + Encounter + Observations

Description

1 cell · updated Jul 31, 2026

This is a read-only view. Responses shown were saved when the notebook was published — open it in your own Aidbox to run the cells against live data.
REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
POST /fhir
accept: application/json
content-type: application/json

{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [
    {
      "fullUrl": "urn:uuid:self-measurement-encounter-1",
      "request": {
        "method": "POST",
        "url": "Encounter"
      },
      "resource": {
        "resourceType": "Encounter",
        "meta": {
          "tag": [
            {
              "code": "development",
              "system": "https://meditools.nl/fhir/CodeSystem/MedikitDeploymentEnvironments"
            }
          ],
          "user": {
            "id": "21c80bbe-7d1e-49af-99a8-270829314b26",
            "resourceType": "User"
          },
          "organization": {
            "id": "mk-test-organization",
            "resourceType": "Organization"
          }
        },
        "status": "finished",
        "class": {
          "code": "VR",
          "system": "http://hl7.org/fhir/v3/ActCode"
        },
        "type": [
          {
            "coding": [
              {
                "code": "08",
                "system": "https://referentiemodel.nhg.org/tabellen/nhg-tabel-14-contactwijze",
                "display": "Postverwerking"
              }
            ]
          }
        ],
        "participant": [
          {
            "type": [
              {
                "coding": [
                  {
                    "code": "PPRF",
                    "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
                    "display": "primary performer"
                  }
                ]
              }
            ],
            "individual": {
              "reference": "PractitionerRole/8db0388f-ad1d-4449-88d5-674d0f2358bc"
            }
          }
        ],
        "period": {
          "start": "2026-07-31T08:15:00Z",
          "end": "2026-07-31T08:15:00Z"
          
        }
      }
    },
    {
      "fullUrl": "urn:uuid:self-measurement-observation-1",
      "request": {
        "method": "POST",
        "url": "Observation"
      },
      "resource": {
        "resourceType": "Observation",
        "meta": {
          "profile": [
            "https://medikit.nl/fhir/StructureDefinition/medikit-intern-observation-self-measurement"
          ],
          "tag": [
            {
              "code": "development",
              "system": "https://meditools.nl/fhir/CodeSystem/MedikitDeploymentEnvironments"
            }
          ],
          "user": {
            "id": "21c80bbe-7d1e-49af-99a8-270829314b26",
            "resourceType": "User"
          },
          "organization": {
            "id": "mk-test-organization",
            "resourceType": "Organization"
          }
        },
        "status": "final",
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://terminology.hl7.org/CodeSystem/observation-category",
                "display": "Vital Signs"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "85354-9",
              "system": "http://loinc.org",
              "display": "Blood pressure panel with all children optional"
            }
          ],
          "text": "Bloeddruk"
        },
        "encounter": {
          "reference": "urn:uuid:self-measurement-encounter-1"
        },
        "effective": {
          "dateTime": "2026-07-30T08:15:00Z"
        },
        "issued": "2026-07-30T08:15:00Z",
        "performer": [
          {
            "reference": "Patient/7cd73345-d120-4ec3-aa75-eb68e701a2d4"
          }
        ],
        "extension": [
          {
            "url": "https://medikit.nl/fhir/StructureDefinition/mediKITInternExtensionDataSource",
            "valueString": "Uw Zorg Online"
          }
        ],
        "component": [
          {
            "code": {
              "coding": [
                {
                  "code": "8480-6",
                  "system": "http://loinc.org",
                  "display": "Systolic blood pressure"
                }
              ]
            },
            "valueQuantity": {
              "value": 128,
              "unit": "mmHg",
              "system": "http://unitsofmeasure.org",
              "code": "mm[Hg]"
            },
            "referenceRange": [
              {
                "low": {
                  "value": 90,
                  "unit": "mmHg",
                  "system": "http://unitsofmeasure.org",
                  "code": "mm[Hg]"
                },
                "high": {
                  "value": 120,
                  "unit": "mmHg",
                  "system": "http://unitsofmeasure.org",
                  "code": "mm[Hg]"
                },
                "text": "Normale systolische bloeddruk volwassene"
              }
            ]
          },
          {
            "code": {
              "coding": [
                {
                  "code": "8462-4",
                  "system": "http://loinc.org",
                  "display": "Diastolic blood pressure"
                }
              ]
            },
            "valueQuantity": {
              "value": 82,
              "unit": "mmHg",
              "system": "http://unitsofmeasure.org",
              "code": "mm[Hg]"
            },
            "referenceRange": [
              {
                "low": {
                  "value": 60,
                  "unit": "beats/minute",
                  "system": "http://unitsofmeasure.org",
                  "code": "/min"
                },
                "high": {
                  "value": 100,
                  "unit": "beats/minute",
                  "system": "http://unitsofmeasure.org",
                  "code": "/min"
                },
                "text": "Normaalbereik volwassene in rust"
              }
            ]
          }
        ],
        "note": [
          {
            "text": "Patient note: measured at home after breakfast."
          }
        ]
      }
    },
    {
      "fullUrl": "urn:uuid:self-measurement-observation-2",
      "request": {
        "method": "POST",
        "url": "Observation"
      },
      "resource": {
        "resourceType": "Observation",
        "meta": {
          "profile": [
            "https://medikit.nl/fhir/StructureDefinition/medikit-intern-observation-self-measurement"
          ],
          "tag": [
            {
              "code": "development",
              "system": "https://meditools.nl/fhir/CodeSystem/MedikitDeploymentEnvironments"
            }
          ],
          "user": {
            "id": "21c80bbe-7d1e-49af-99a8-270829314b26",
            "resourceType": "User"
          },
          "organization": {
            "id": "mk-test-organization",
            "resourceType": "Organization"
          }
        },
        "status": "final",
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://terminology.hl7.org/CodeSystem/observation-category",
                "display": "Vital Signs"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "code": "8867-4",
              "system": "http://loinc.org",
              "display": "Heart rate"
            }
          ],
          "text": "Pols"
        },
        "encounter": {
          "reference": "urn:uuid:self-measurement-encounter-1"
        },
        "effective": {
          "period": {
          	"start": "2026-07-28T08:15:00Z",
          	"end": "2026-07-29T08:15:00Z"
          }
        },
        "issued": "2026-07-29T08:15:00Z",
        "performer": [
          {
            "reference": "Patient/7cd73345-d120-4ec3-aa75-eb68e701a2d4"
          }
        ],
        "extension": [
          {
            "url": "https://medikit.nl/fhir/StructureDefinition/mediKITInternExtensionDataSource",
            "valueString": "Uw Zorg Online"
          }
        ],
        "valueQuantity": {
          "value": 74,
          "unit": "/min",
          "system": "http://unitsofmeasure.org",
          "code": "/min"
        },
        "referenceRange": [
          {
            "low": {
              "value": 60,
              "unit": "beats/minute",
              "system": "http://unitsofmeasure.org",
              "code": "/min"
            },
            "high": {
              "value": 100,
              "unit": "beats/minute",
              "system": "http://unitsofmeasure.org",
              "code": "/min"
            },
            "text": "Normaalbereik volwassene in rust"
          }
        ]
      }
    },
    {
      "fullUrl": "urn:uuid:self-measurement-task-1",
      "request": {
        "method": "POST",
        "url": "Task"
      },
      "resource": {
        "resourceType": "Task",
        "description": "Zelfmeting",
        "meta": {
          "tag": [
            {
              "code": "development",
              "system": "https://meditools.nl/fhir/CodeSystem/MedikitDeploymentEnvironments"
            }
          ],
          "user": {
            "id": "21c80bbe-7d1e-49af-99a8-270829314b26",
            "resourceType": "User"
          },
          "organization": {
            "id": "mk-test-organization",
            "resourceType": "Organization"
          }
        },
        "status": "requested",
        "intent": "order",
        "for": {
          "reference": "Patient/7cd73345-d120-4ec3-aa75-eb68e701a2d4"
        },
        "encounter": {
          "reference": "urn:uuid:self-measurement-encounter-1"
        },
        "requester": {
          "reference": "Patient/7cd73345-d120-4ec3-aa75-eb68e701a2d4"
        },
        "owner": {
          "reference": "Organization/mk-test-organization"
        },
        "code": {
          "coding": [
            {
              "code": "review-incoming-communication",
              "system": "http://www.medikit.nl/ns/cs/task-requested-action-codes",
              "display": "Nieuw"
            }
          ]
        },
        "input": [
          {
            "type": {
              "coding": [
                {
                  "code": "observation-reference",
                  "system": "http://www.medikit.nl/ns/cs/identifier-types"
                }
              ]
            },
            "value": {
              "Reference": {
                "reference": "urn:uuid:self-measurement-observation-1"
              }
            }
          },
          {
            "type": {
              "coding": [
                {
                  "code": "observation-reference",
                  "system": "http://www.medikit.nl/ns/cs/identifier-types"
                }
              ]
            },
            "value": {
              "Reference": {
                "reference": "urn:uuid:self-measurement-observation-2"
              }
            }
          },
          {
            "type": {
              "coding": [
                {
                  "code": "encounter-reference",
                  "system": "http://www.medikit.nl/ns/cs/identifier-types"
                }
              ]
            },
            "value": {
              "Reference": {
                "reference": "urn:uuid:self-measurement-encounter-1"
              }
            }
          }
        ]
      }
    }
  ]
}
Response: Body
Status: 400
{
  "resourceType": "OperationOutcome",
  "id": "processing",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>Transaction failed at entry[2]. Response status is 422. Response body is {\"resourceType\":\"OperationOutcome\",\"text\":{\"status\":\"generated\",\"div\":\"<div xmlns=\\\"http://www.w3.org/1999/xhtml\\\"><p>Invalid resource</p></div>\"},\"issue\":[{\"severity\":\"fatal\",\"code\":\"invalid\",\"expression\":[\"Observation.effective.start\"],\"diagnostics\":\"extra property\"},{\"severity\":\"fatal\",\"code\":\"invalid\",\"expression\":[\"Observation.effective.end\"],\"diagnostics\":\"extra property\"}]}.</p></div>"
  },
  "issue": [
    {
      "severity": "fatal",
      "code": "invalid",
      "diagnostics": "extra property",
      "expression": [
        "Observation.effective.start"
      ]
    },
    {
      "severity": "fatal",
      "code": "invalid",
      "diagnostics": "extra property",
      "expression": [
        "Observation.effective.end"
      ]
    }
  ]
}