History

The history endpoints return information about previous maternity records, or changes (history) within a maternity record

URL Method Description
/history GET Get all maternity record status' for a patient (any current and for previous pregnancies)
/history/record_id GET Get all versions/changes of the given (id) maternity record

Get list of all previous maternity record

A patient can have multiple previous maternity records, so this endpoint lets you fetch a list of previus maternity records, and their status/metadata

Curl example

curl --location --request GET 'https://test.maternity-record.hit.nhn.no/api/maternity-record/v1/history' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiI......<HelseId machine token>' \
--header 'nhn-source-system: My EPJ system name' \
--header 'Content-Type: application/json; charset=UTF-8' \
--header 'Accept: application/json' \
--header 'nhn-source-system: My EPJ system name' \
--header 'nhn-patient-nin: 10086055555' 

Response

{
  "history": [
    {
      "recordId": "d835038a-fece-4130-8de8-69d2901cf03e",
      "recordStatus": {
        "status": "TERMINATED",
        "terminationDate": "2025-03-05T06:41:27.217541Z"
      },
      "version": 2,
      "lastUpdated": "2025-03-05T06:41:27.217541Z",
      "lastUpdatedBy": {
        "userType": "HEALTH_CARE_PROFESSIONAL",
        "orgNr": "99857032804120076480",
        "orgName": "Munkholmen Legesenter",
        "hprNr": "222200063",
        "hprRole": "LE",
        "name": "Lillehagen, Rolf Fos"
      }
    },
    {
      "recordId": "3e15f63c-78fd-471e-93f5-914ec0ef5ef4",
      "recordStatus": {
        "status": "ACTIVE"
      },
      "version": 1,
      "lastUpdated": "2025-03-05T06:41:27.217541Z",
      "lastUpdatedBy": {
        "userType": "HEALTH_CARE_PROFESSIONAL",
        "orgNr": "99857032804120076480",
        "orgName": "Munkholmen Legesenter",
        "hprNr": "222200063",
        "hprRole": "LE",
        "name": "Lillehagen, Rolf Fos"
      }
    }
  ]
}
Field Type Required Description
hasGivenConsent Boolean x The patient has given her consent to participate in the trial to share maternity record information
hasActiveMaternityRecord Boolean x The patient has a registered maternity record with status active
lastChangedDateTime Timestamp Timestamp when the maternity record information was last changed for this patient (if one exists)
latestRecordId String UUID in String format which is the ID of the latest maternity record belonging to the patient (if one exists)
deceased Boolean x Whether the patient is deceased or not
hasConfidentialAddress Boolean x Whether the patient has a confidential address or not

Fetching the history of a single maternity record

GET /history/record_id

Returns the maternity record with the given ID for the patient, including changes made (all versions of each element)

Response:

{
  "metadata": {
    "recordId": "37331627-4e2a-4454-b3ec-ddc742e724c1",
    "recordStatus": {
      "status": "ACTIVE"
    },
    "version": 1,
    "lastUpdated": "2025-03-05T06:41:27.217541Z",
    "lastUpdatedBy": {
      "userType": "HEALTH_CARE_PROFESSIONAL",
      "orgNr": "998570328",
      "orgNrDisplay": "Munkholmen Legesenter",
      "hprNr": "222200063",
      "hprRole": "LE",
      "name": "Lillehagen, Rolf Fos"
    }
  },
  "mother": [
    {
      "metadata": {
        "id": "6473a401-37b7-4084-a3e2-cfbffb16ad4a",
        "version": 1,
        "lastUpdated": "2025-03-05T06:41:27.217541Z",
        "lastUpdatedBy": {
          "userType": "HEALTH_CARE_PROFESSIONAL",
          "orgNr": "998570328",
          "orgNrDisplay": "Munkholmen Legesenter",
          "hprNr": "222200063",
          "hprRole": "LE",
          "name": "Lillehagen, Rolf Fos"
        }
      },
      "name": "Navn Navnesen",
      ...
    },
    {
      "metadata": {
        "id": "6473a401-37b7-4084-a3e2-cfbffb16ad4a",
        "version": 2,
        "lastUpdated": "2025-03-05T06:41:27.217541Z",
        "lastUpdatedBy": {
          "userType": "HEALTH_CARE_PROFESSIONAL",
          "orgNr": "998570328",
          "orgNrDisplay": "Munkholmen Legesenter",
          "hprNr": "222200063",
          "hprRole": "LE",
          "name": "Lillehagen, Rolf Fos"
        }
      },
      "name": "Navn Navnesen Endret",
      ...
    }
  ],
  ...
}