Skip to main content
Skip table of contents

Creating a child episode

Overview

When a Spine Client System wishes to create a new child care episode in the Spine, a request is made to the Create Child Episode endpoint, passing a FHIR Bundle resource within the body of the request in JSON format. The bundle may contain any valid combination of resources relating to the new paediatric care episode, but at a minimum, it must contain:

  • A single Patient resource with national Identifier and BirthDate properties populated

  • A single EpisodeOfCare resource with the following values populated:

    • type - value set of one of the valid BadgerNet Episode Types

    • period.start - start date and time of the care episode

    • Organization - a reference to the id of the associated BadgerNet Care Location

If the child care episode is successfully created as part of a whole-child record, a response with status code 201 -- Created is returned, including headers indicating the new child episode logical ID.

If a child episode matching the same parameters already exists, the Spine will return a 409 -- Conflict status code. In this circumstance, the Spine Client System should make a request to the Find Child endpoint to obtain the Logical ID for subsequent updates to the record.


Request

POST [baseUrl]/Patient/$create-child-episode

Request Flow

Response

Possible response codes

Code

Description

201

Created

See response headers:
X-Logical-Id to obtain the ID of the created record
Location to obtain the full URL to read the child record

422

Unprocessable Entity

Example

Request Body

JSON
{
    "resourceType": "Bundle",
    "entry": [
        {
            "resource": {
                "resourceType": "Patient",
                "extension": [
                    {
                        "url": "https://hl7.org/fhir/StructureDefinition/patient-birthTime",
                        "valueDateTime": "2024-05-17T01:24:00+00:00"
                    }
                ],
                "identifier": [
                    {
                        "use": "official",
                        "system": "https://standards.digital.health.nz/ns/nhi-id",
                        "value": "20240517"
                    }
                ],
                "name": [
                    {
                        "use": "official",
                        "family": "Smith",
                        "given": [
                            "Baby",
                            "Betty"
                        ]
                    }
                ],
                "birthDate": "2024-05-17",
                "multipleBirthInteger": 2
            }
        },
        {
            "resource": {
                "resourceType": "EpisodeOfCare",
                "meta": {
                    "profile": [
                        "https://fhir.clevermed.com/StructureDefinition/EpisodeOfCare-BNet-Child-Active"
                    ]
                },
                "type": [
                    {
                        "coding": [
                            {
                                "system": "https://fhir.clevermed.com/codesystem",
                                "code": "birth"
                            }
                        ]
                    }
                ],
                "status": "active",      
                "patient": {
                    "identifier": {
						"use": "official",
						"system": "https://standards.digital.health.nz/ns/nhi-id",
						"value": "20240517"
					}
                },
                "managingOrganization": {
                    "identifier": {
                        "system": "https://standards.digital.health.nz/ns/hpi-facility-id",
                        "value": "STLA"
                    }
                }
            }
        }
    ]
}

Response

The response’s body does not contain any information on a successful result.

Header Code

Description

201

Child record has been successfully created


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.