Skip to main content
Skip table of contents

Find all pregnancies

Overview

For Spine Client Types that perform read-only queries on pregnancy records where only the National ID and Date of Birth are known, then this $find-all-pregnancies function should be used.

Given just the National ID and Date of Birth of the woman, this function will return all the single-pregnancy logical IDs of each distinct pregnancy for that woman held on the BadgerNet Platform.

The client can then use this logical ID to call the $everything command to get the FHIR Bundle for that single pregnancy.


Request

POST [baseUrl]/Patient/$find-all-pregnancies

The Parameters FHIR resource within the body of the request consists of two key request parameters (National ID and DOB):

national-id

(FHIR Identifier) National single-person healthcare identifier. Must be an exact match, and include the corresponding FHIR Identifier System.

dob

(FHIR Date) Date of Birth of the pregnant person. Must be an exact match to the pregnant person’s date of birth.

Request Flow

Request flow - Find All Pregnancies

Response

In response to the query, a FHIR Bundle is returned containing a Patient resource (in FHIR Summary form) and the corresponding EDD Observation for each of the pregnancies held for that woman. The Logical ID of each of the single pregnancy is present within the Patient resource. Only pregnancies in which the Spine Client is a stakeholder are returned in the query.

Possible response codes

Code

Description

200

Pregnancies found for which the client is a stakeholder

404

No matching pregnancies found, or client is not a stakeholder

Example

Request Body

JSON
{
    "resourceType": "Parameters",
    "parameter": [
        {
            "name": "national-id",
            "valueIdentifier": {
                "use": "official",
                "system": "https://fhir.nhs.uk/Id/nhs-number",
                "value": "NationalID123"
            }
        },
        {
            "name": "dob",
            "valueDate": "1986-11-01"
        }
    ]
}

Response

Header

Header Code

Description

200

Pregnancy summary has been successfully retrieved

Body

JSON
{
    "resourceType": "Bundle",
    "id": "6e1c0f94-d0c9-41b6-b1e8-e4358b4d31bf",
    "meta": {
        "lastUpdated": "2023-06-09T09:33:32.166514+00:00"
    },
    "type": "searchset",
    "entry": [
        {
            "resource": {
                "resourceType": "Patient",
                "id": "0mBE6sXVpEtMpJGQkudMKzb99FpX04ZWiy0ZvMQ8JiL-aYtF9xUQWZbFnj3Xj1iK",
                "meta": {
                    "versionId": "1",
                    "lastUpdated": "2023-06-08T08:56:54.968+00:00",
                    "tag": [
                        {
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
                            "code": "SUBSETTED"
                        }
                    ]
                },
                "contained": [
                    {
                        "resourceType": "Observation",
                        "id": "8ec818392ebf779a21e666be405b150573098f2bc0041f083f8acc556e934d1d",
                        "meta": {
                            "versionId": "2",
                            "lastUpdated": "2023-06-08T09:07:05.504+00:00",
                            "profile": [
                                "https://clevermed.com/fhir/StructureDefinition/Observation-BNet-Preg-EDDByAgreed"
                            ]
                        },
                        "extension": [
                            {
                                "url": "http://hl7.org/fhir/StructureDefinition/workflow-episodeOfCare",
                                "valueReference": {
                                    "reference": "EpisodeOfCare/0mBE6sXVpEtMpJGQkudMKzb99FpX04ZWiy0ZvMQ8JiL-aYtF9xUQWZbFnj3Xj1iK"
                                }
                            }
                        ],
                        "status": "final",
                        "code": {
                            "coding": [
                                {
                                    "system": "http://snomed.info/sct",
                                    "code": "161714006",
                                    "display": "Agreed EDD"
                                }
                            ]
                        },
                        "subject": {
                            "reference": "Patient/0mBE6sXVpEtMpJGQkudMKzb99FpX04ZWiy0ZvMQ8JiL-aYtF9xUQWZbFnj3Xj1iK"
                        },
                        "valueDateTime": "2022-02-13"
                    }
                ],
                "identifier": [
                    {
                        "use": "official",
                        "system": "https://fhir.nhs.uk/Id/nhs-number",
                        "value": "T:PR20230608"
                    }
                ],
                "name": [
                    {
                        "use": "official",
                        "family": "Smith",
                        "given": [
                            "Julie"
                        ],
                        "prefix": [
                            "Mrs"
                        ]
                    }
                ],
                "birthDate": "1990-06-08",
                "address": [
                    {
                        "use": "home"
                    }
                ]
            }
        },
        {
            "resource": {
                "resourceType": "Patient",
                "id": "5CIwIwcuD3EL0gUUJdxeg1bwIsvWyju-r-rzXnncqNcFp8dS4DtQd7xcqJ5shBSB",
                "meta": {
                    "versionId": "1",
                    "lastUpdated": "2023-06-08T09:22:58.762+00:00",
                    "tag": [
                        {
                            "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
                            "code": "SUBSETTED"
                        }
                    ]
                },
                "contained": [
                    {
                        "resourceType": "Observation",
                        "id": "02500f33932594e98b7dd0cdddb7746acae0551b19ab85f5b9f2bf90be859bb3",
                        "meta": {
                            "versionId": "1",
                            "lastUpdated": "2023-06-08T09:24:16.731+00:00",
                            "profile": [
                                "https://clevermed.com/fhir/StructureDefinition/Observation-BNet-Preg-EDDByAgreed"
                            ]
                        },
                        "extension": [
                            {
                                "url": "http://hl7.org/fhir/StructureDefinition/workflow-episodeOfCare",
                                "valueReference": {
                                    "reference": "EpisodeOfCare/5CIwIwcuD3EL0gUUJdxeg1bwIsvWyju-r-rzXnncqNcFp8dS4DtQd7xcqJ5shBSB"
                                }
                            }
                        ],
                        "status": "final",
                        "code": {
                            "coding": [
                                {
                                    "system": "http://snomed.info/sct",
                                    "code": "161714006",
                                    "display": "Agreed EDD"
                                }
                            ]
                        },
                        "subject": {
                            "reference": "Patient/5CIwIwcuD3EL0gUUJdxeg1bwIsvWyju-r-rzXnncqNcFp8dS4DtQd7xcqJ5shBSB"
                        },
                        "valueDateTime": "2024-01-16"
                    }
                ],
                "identifier": [
                    {
                        "use": "official",
                        "system": "https://fhir.nhs.uk/Id/nhs-number",
                        "value": "T:PR20230608"
                    }
                ],
                "name": [
                    {
                        "use": "official",
                        "family": "Smith",
                        "given": [
                            "Jule"
                        ],
                        "prefix": [
                            "Mrs"
                        ]
                    }
                ],
                "birthDate": "1990-06-08",
                "address": [
                    {
                        "use": "home"
                    }
                ]
            }
        }
    ]
}

JavaScript errors detected

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

If this problem persists, please contact our support.