Skip to content

API Walkthroughs 10.2 Court to Other move without PNC PN

Martyn Whitwell edited this page Aug 3, 2020 · 1 revision

Moves API Walkthrough

10. Court to Other (excluding Prison/STC/SCH) court_other moves

10.2 Move for a person without a PNC/PN identifier from Court to another Court on a specific move date

When the person to be moved does not have a Prison Number (PN) or Police National Computer (PNC) number, it may be necessary to create a new person record in the system.

  1. Create a new person record for the person

    First, retrieve reference data for genders:

    curl --request GET \
      --url http://server/api/reference/genders \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX'

    which returns:

    {
      "data": [
        {
          "id": "1b227566-ef41-4516-b41d-9aec6651243a",
          "type": "genders",
          "attributes": {
            "key": "female",
            "title": "Female",
            "description": null,
            "disabled_at": null,
            "nomis_code": "F"
          }
        },
        {
          "id": "ffac6763-26d6-4425-8005-6e5d052aed88",
          "type": "genders",
          "attributes": {
            "key": "male",
            "title": "Male",
            "description": null,
            "disabled_at": null,
            "nomis_code": "M"
          }
        },
        {
          "id": "a5546a86-2183-4a4f-a352-293e61764586",
          "type": "genders",
          "attributes": {
            "key": "trans",
            "title": "Trans",
            "description": null,
            "disabled_at": null,
            "nomis_code": null
          }
        },
        {
          "id": "94f33833-35f1-4a7c-bbfa-3091e7d7f39b",
          "type": "genders",
          "attributes": {
            "key": "nk",
            "title": "Not Known / Not Recorded",
            "description": null,
            "disabled_at": "2019-07-22T16:35:43+01:00",
            "nomis_code": "NK"
          }
        },
        {
          "id": "6d440a66-c281-4aae-8c9d-92ff84cf62ff",
          "type": "genders",
          "attributes": {
            "key": "ns",
            "title": "Not Specified (Indeterminate)",
            "description": null,
            "disabled_at": "2019-07-22T16:35:43+01:00",
            "nomis_code": "NS"
          }
        }
      ]
    }

    Similarly, reference data for ethnicities can be retrieved with:

    curl --request GET \
      --url http://server/api/reference/ethnicities \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX'

    Which returns:

    {
      "data": [
        {
          "id": "9894def5-2997-4c46-affa-e868412e2d0e",
          "type": "ethnicities",
          "attributes": {
            "key": "a1",
            "title": "Asian/Asian British: Indian",
            "description": null,
            "nomis_code": "A1",
            "disabled_at": null
          }
        },
        {
          "id": "91a0a306-3269-4c76-85f6-79957b97d41f",
          "type": "ethnicities",
          "attributes": {
            "key": "a2",
            "title": "Asian/Asian British: Pakistani",
            "description": null,
            "nomis_code": "A2",
            "disabled_at": null
          }
        },
        {
          "id": "639a0389-5fac-4e1b-83ec-f8257e43f9d6",
          "type": "ethnicities",
          "attributes": {
            "key": "a3",
            "title": "Asian/Asian British: Bangladeshi",
            "description": null,
            "nomis_code": "A3",
            "disabled_at": null
          }
        },
        {
          "id": "8bf95acf-2fb3-4d7a-8b30-b06c6cb821e2",
          "type": "ethnicities",
          "attributes": {
            "key": "a4",
            "title": "Asian/Asian British: Chinese",
            "description": null,
            "nomis_code": "A4",
            "disabled_at": null
          }
        },
        {
          "id": "983d219e-57f2-4513-b77b-58f22bee9769",
          "type": "ethnicities",
          "attributes": {
            "key": "a9",
            "title": "Asian/Asian British: Any other backgr'nd",
            "description": null,
            "nomis_code": "A9",
            "disabled_at": null
          }
        },
        {
          "id": "6a6e1d05-fcd6-465d-b6fc-a67d3f4988da",
          "type": "ethnicities",
          "attributes": {
            "key": "b1",
            "title": "Black/Black British: Caribbean",
            "description": null,
            "nomis_code": "B1",
            "disabled_at": null
          }
        },
        {
          "id": "a4f988ba-5ebc-4b24-9dfe-b7fa0c23c30e",
          "type": "ethnicities",
          "attributes": {
            "key": "b2",
            "title": "Black/Black British: African",
            "description": null,
            "nomis_code": "B2",
            "disabled_at": null
          }
        },
        {
          "id": "69ec16cd-7172-47bf-a568-3283edb0e119",
          "type": "ethnicities",
          "attributes": {
            "key": "b9",
            "title": "Black/Black British: Any other Backgr'nd",
            "description": null,
            "nomis_code": "B9",
            "disabled_at": null
          }
        },
        {
          "id": "6e74c8ae-2ba7-4b1d-afdd-d8f59ede69d5",
          "type": "ethnicities",
          "attributes": {
            "key": "m1",
            "title": "Mixed: White and Black Caribbean",
            "description": null,
            "nomis_code": "M1",
            "disabled_at": null
          }
        },
        {
          "id": "572a9f0f-5b69-4535-b6a6-6d2782a1838f",
          "type": "ethnicities",
          "attributes": {
            "key": "m2",
            "title": "Mixed: White and Black African",
            "description": null,
            "nomis_code": "M2",
            "disabled_at": null
          }
        },
        {
          "id": "f480eeff-848c-4fcc-bd75-9f61850fa5bf",
          "type": "ethnicities",
          "attributes": {
            "key": "m3",
            "title": "Mixed: White and Asian",
            "description": null,
            "nomis_code": "M3",
            "disabled_at": null
          }
        },
        {
          "id": "1bffeb81-6746-4218-a073-810495416d9a",
          "type": "ethnicities",
          "attributes": {
            "key": "m9",
            "title": "Mixed: Any other background",
            "description": null,
            "nomis_code": "M9",
            "disabled_at": null
          }
        },
        {
          "id": "d1b29783-77f8-498b-b0a5-73e192e59e58",
          "type": "ethnicities",
          "attributes": {
            "key": "ns",
            "title": "Prefer not to say",
            "description": null,
            "nomis_code": "NS",
            "disabled_at": null
          }
        },
        {
          "id": "379ced2e-a3f2-44dd-8ebe-e935e600ad68",
          "type": "ethnicities",
          "attributes": {
            "key": "o2",
            "title": "Other: Arab",
            "description": null,
            "nomis_code": "O2",
            "disabled_at": null
          }
        },
        {
          "id": "a88e980c-aef3-4d50-9935-0186f22947d2",
          "type": "ethnicities",
          "attributes": {
            "key": "o9",
            "title": "Other: Any other background",
            "description": null,
            "nomis_code": "O9",
            "disabled_at": null
          }
        },
        {
          "id": "318cbc7b-d8d9-4798-9430-a588872446aa",
          "type": "ethnicities",
          "attributes": {
            "key": "w1",
            "title": "White: Eng./Welsh/Scot./N.Irish/British",
            "description": null,
            "nomis_code": "W1",
            "disabled_at": null
          }
        },
        {
          "id": "56508a65-c618-497a-9575-81671c70b92f",
          "type": "ethnicities",
          "attributes": {
            "key": "w2",
            "title": "White : Irish",
            "description": null,
            "nomis_code": "W2",
            "disabled_at": null
          }
        },
        {
          "id": "7807fb2a-712a-4350-af48-3a2f79e18871",
          "type": "ethnicities",
          "attributes": {
            "key": "w3",
            "title": "White: Gypsy or Irish Traveller",
            "description": null,
            "nomis_code": "W3",
            "disabled_at": null
          }
        },
        {
          "id": "d567cfb2-9622-4979-be4a-a1341cc4aefa",
          "type": "ethnicities",
          "attributes": {
            "key": "w9",
            "title": "White: Any other background",
            "description": null,
            "nomis_code": "W9",
            "disabled_at": null
          }
        },
        {
          "id": "622b7a0d-a66d-4b10-83c2-79221fdc67c5",
          "type": "ethnicities",
          "attributes": {
            "key": "merge",
            "title": "Needs to be confirmed following Merge",
            "description": null,
            "nomis_code": "MERGE",
            "disabled_at": "2019-07-28T12:51:30+01:00"
          }
        }
      ]
    }

    Finally, using the reference data and other known data about the person, create a new person record:

    curl --request POST \
      --url http://server/api/people \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX' \
      --header 'content-type: application/json' \
      --header 'idempotency-key: a0daa75e-20ad-4478-9b2b-152d947d28f5' \
      --data '{
      "data": {
        "type": "people",
        "attributes": {
          "first_names": "Bob",
          "last_name": "Roberts",
          "date_of_birth": "1980-03-04",
          "gender_additional_information": null,
          "prison_number": null,
          "police_national_computer": null,
          "criminal_records_office": null
        },
        "relationships": {
          "gender": {
            "data": {
              "type": "genders",
              "id": "ffac6763-26d6-4425-8005-6e5d052aed88"
            }
          },
          "ethnicity": {
            "data": {
              "type": "ethnicities",
              "id": "f480eeff-848c-4fcc-bd75-9f61850fa5bf"
            }
          }
        }
      }
    }'

    This returns a new person record:

    {
      "data": {
        "id": "72bd5e3e-6034-4588-9a95-3ab1b181d6b2",
        "type": "people",
        "attributes": {
          "first_names": "Bob",
          "last_name": "Roberts",
          "date_of_birth": "1980-03-04",
          "gender_additional_information": null,
          "prison_number": null,
          "criminal_records_office": null,
          "police_national_computer": null
        },
        "relationships": {
          "ethnicity": {
            "data": {
              "id": "f480eeff-848c-4fcc-bd75-9f61850fa5bf",
              "type": "ethnicities"
            }
          },
          "gender": {
            "data": {
              "id": "ffac6763-26d6-4425-8005-6e5d052aed88",
              "type": "genders"
            }
          },
          "profiles": {
            "data": []
          }
        }
      }
    }
  2. Create a new profile record for the person. As the person does not have a Prison Number (PN), they will not synchronise with Nomis. So the profile assessment answers (PTR) will need to be set manually.

    First, retrieve the assessment questions reference data:

    curl --request GET \
      --url http://server/api/reference/assessment_questions \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX'

    Which returns:

    {
      "data": [
        {
          "id": "af8cfc67-757c-4019-9d5e-618017de1617",
          "type": "assessment_questions",
          "attributes": {
            "key": "violent",
            "category": "risk",
            "title": "Violent",
            "disabled_at": null
          }
        },
        {
          "id": "f2db9a8f-a5a9-40cf-875b-d1f5f62b2497",
          "type": "assessment_questions",
          "attributes": {
            "key": "escape",
            "category": "risk",
            "title": "Escape",
            "disabled_at": null
          }
        },
        {
          "id": "8f38efb0-36c1-4a56-8c66-3b72c9525f92",
          "type": "assessment_questions",
          "attributes": {
            "key": "hold_separately",
            "category": "risk",
            "title": "Must be held separately",
            "disabled_at": null
          }
        },
        {
          "id": "4e7e54b4-a40c-488f-bdff-c6b2268ca4eb",
          "type": "assessment_questions",
          "attributes": {
            "key": "self_harm",
            "category": "risk",
            "title": "Self harm",
            "disabled_at": null
          }
        },
        {
          "id": "56826f64-da5d-42eb-b360-131e60bcc3d3",
          "type": "assessment_questions",
          "attributes": {
            "key": "concealed_items",
            "category": "risk",
            "title": "Concealed items",
            "disabled_at": null
          }
        },
        {
          "id": "4e37ac1a-a461-45a8-bca9-f0e994d3105e",
          "type": "assessment_questions",
          "attributes": {
            "key": "other_risks",
            "category": "risk",
            "title": "Any other risks",
            "disabled_at": null
          }
        },
        {
          "id": "e6faaf20-3072-4a65-91f7-93d52b16260f",
          "type": "assessment_questions",
          "attributes": {
            "key": "special_diet_or_allergy",
            "category": "health",
            "title": "Special diet or allergy",
            "disabled_at": null
          }
        },
        {
          "id": "8872ad2e-b1b6-44c1-a937-b7540e633355",
          "type": "assessment_questions",
          "attributes": {
            "key": "health_issue",
            "category": "health",
            "title": "Health issue",
            "disabled_at": null
          }
        },
        {
          "id": "7ac3ffc9-57ac-4d0f-aa06-ad15b55c3cee",
          "type": "assessment_questions",
          "attributes": {
            "key": "medication",
            "category": "health",
            "title": "Medication",
            "disabled_at": null
          }
        },
        {
          "id": "bc5fd9d1-6c86-4c39-b9a0-2e88bee98c50",
          "type": "assessment_questions",
          "attributes": {
            "key": "wheelchair",
            "category": "health",
            "title": "Wheelchair user",
            "disabled_at": null
          }
        },
        {
          "id": "bf0d3e65-f88a-4ee5-aad5-60947a1b5a51",
          "type": "assessment_questions",
          "attributes": {
            "key": "pregnant",
            "category": "health",
            "title": "Pregnant",
            "disabled_at": null
          }
        },
        {
          "id": "5a4c5feb-9244-4c29-ab3f-d453c6fee10a",
          "type": "assessment_questions",
          "attributes": {
            "key": "other_health",
            "category": "health",
            "title": "Any other requirements",
            "disabled_at": null
          }
        },
        {
          "id": "5c3ec467-4932-4d58-8281-fb27eaba3ddf",
          "type": "assessment_questions",
          "attributes": {
            "key": "solicitor",
            "category": "court",
            "title": "Solicitor or other legal representation",
            "disabled_at": null
          }
        },
        {
          "id": "821254c9-680b-4eb5-9c15-bf22e31e7c5e",
          "type": "assessment_questions",
          "attributes": {
            "key": "interpreter",
            "category": "court",
            "title": "Sign or other language interpreter",
            "disabled_at": null
          }
        },
        {
          "id": "aad663f1-d213-4ce7-af86-e180bdaa71dd",
          "type": "assessment_questions",
          "attributes": {
            "key": "other_court",
            "category": "court",
            "title": "Any other information",
            "disabled_at": null
          }
        },
        {
          "id": "3a661bc8-5536-43e9-bcea-0a4d9651a175",
          "type": "assessment_questions",
          "attributes": {
            "key": "not_for_release",
            "category": "risk",
            "title": "Not for release",
            "disabled_at": null
          }
        },
        {
          "id": "bafcde0b-46e9-44b2-ad20-de3644256a42",
          "type": "assessment_questions",
          "attributes": {
            "key": "not_to_be_released",
            "category": "risk",
            "title": "Not to be released",
            "disabled_at": null
          }
        },
        {
          "id": "1a73d31a-8dd4-47b6-90a0-15ce4e332539",
          "type": "assessment_questions",
          "attributes": {
            "key": "special_vehicle",
            "category": "health",
            "title": "Requires special vehicle",
            "disabled_at": null
          }
        }
      ]
    }

    Using the assessment questions reference data, create a new profile record with:

    curl --request POST \
      --url http://server/api/people/72bd5e3e-6034-4588-9a95-3ab1b181d6b2/profiles \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX' \
      --header 'content-type: application/json' \
      --header 'idempotency-key: cdceb594-c581-4c7e-b15a-ed49d37b5cc3' \
      --data '{
      "data": {
        "type": "profiles",
        "attributes": {
          "assessment_answers": [
            {
              "key": "violent",
              "category": "risk",
              "title": "Violent",
              "comments": "does not like marmite",
              "assessment_question_id": "af8cfc67-757c-4019-9d5e-618017de1617",
              "imported_from_nomis": false
            },
            {
              "key": "escape",
              "category": "risk",
              "title": "Escape",
              "comments": "good at climbing fences",
              "assessment_question_id": "f2db9a8f-a5a9-40cf-875b-d1f5f62b2497",
              "imported_from_nomis": false
            },
            {
              "key": "hold_separately",
              "category": "risk",
              "title": "Must be held separately",
              "comments": "must be held separately",
              "assessment_question_id": "8f38efb0-36c1-4a56-8c66-3b72c9525f92",
              "imported_from_nomis": false
            },
            {
              "key": "special_diet_or_allergy",
              "category": "health",
              "title": "Special diet or allergy",
              "comments": "peanut allergy",
              "assessment_question_id": "e6faaf20-3072-4a65-91f7-93d52b16260f",
              "imported_from_nomis": false
            }
          ]
        }
      }
    }'

    This returns the new profile record:

    {
      "data": {
        "id": "7cb3e831-4ecd-4aa8-b6fa-b04af615fc5d",
        "type": "profiles",
        "attributes": {
          "assessment_answers": [
            {
              "title": "Violent",
              "comments": "does not like marmite",
              "created_at": "2020-07-31",
              "expires_at": null,
              "assessment_question_id": "af8cfc67-757c-4019-9d5e-618017de1617",
              "category": "risk",
              "key": "violent",
              "nomis_alert_type": null,
              "nomis_alert_code": null,
              "nomis_alert_type_description": null,
              "nomis_alert_description": null,
              "imported_from_nomis": false
            },
            {
              "title": "Escape",
              "comments": "good at climbing fences",
              "created_at": "2020-07-31",
              "expires_at": null,
              "assessment_question_id": "f2db9a8f-a5a9-40cf-875b-d1f5f62b2497",
              "category": "risk",
              "key": "escape",
              "nomis_alert_type": null,
              "nomis_alert_code": null,
              "nomis_alert_type_description": null,
              "nomis_alert_description": null,
              "imported_from_nomis": false
            },
            {
              "title": "Must be held separately",
              "comments": "must be held separately",
              "created_at": "2020-07-31",
              "expires_at": null,
              "assessment_question_id": "8f38efb0-36c1-4a56-8c66-3b72c9525f92",
              "category": "risk",
              "key": "hold_separately",
              "nomis_alert_type": null,
              "nomis_alert_code": null,
              "nomis_alert_type_description": null,
              "nomis_alert_description": null,
              "imported_from_nomis": false
            },
            {
              "title": "Special diet or allergy",
              "comments": "peanut allergy",
              "created_at": "2020-07-31",
              "expires_at": null,
              "assessment_question_id": "e6faaf20-3072-4a65-91f7-93d52b16260f",
              "category": "health",
              "key": "special_diet_or_allergy",
              "nomis_alert_type": null,
              "nomis_alert_code": null,
              "nomis_alert_type_description": null,
              "nomis_alert_description": null,
              "imported_from_nomis": false
            }
          ]
        },
        "relationships": {
          "person": {
            "data": {
              "id": "72bd5e3e-6034-4588-9a95-3ab1b181d6b2",
              "type": "people"
            }
          },
          "documents": {
            "data": []
          },
          "person_escort_record": {
            "data": null
          }
        }
      }
    }
  3. Create a Court to Other court_other move using the new profile

    curl --request POST \
      --url http://server/api/moves \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX' \
      --header 'content-type: application/json' \
      --header 'idempotency-key: 5b775dc7-c7e7-4e9e-9c68-6febc96263cb' \
      --data '{
      "data": {
        "type": "moves",
        "attributes": {
          "date": "2020-08-04",
          "time_due": "2020-08-04T09:00:00+01:00",
          "status": "requested",
          "additional_information": "example Court to Other move: Huddersfield Youth Court to Bradford County Court",
          "move_type": "court_other"
        },
        "relationships": {
          "profile": {
            "data": {
              "type": "profiles",
              "id": "7cb3e831-4ecd-4aa8-b6fa-b04af615fc5d"
            }
          },
          "from_location": {
            "data": {
              "type": "locations",
              "id": "00034e29-9ef8-4802-a2f5-09342bf9f174"
            }
          },
          "to_location": {
            "data": {
              "type": "locations",
              "id": "ed58f509-5b6b-4ae7-8302-2de70eb59281"
            }
          }
        }
      }
    }'

    This returns the new move record:

    {
      "data": {
        "id": "bbab118f-0356-4c93-8fbf-d251764bd854",
        "type": "moves",
        "attributes": {
          "additional_information": "example Court to Other move: Huddersfield Youth Court to Bradford County Court",
          "cancellation_reason": null,
          "cancellation_reason_comment": null,
          "created_at": "2020-07-31T12:04:19+01:00",
          "date": "2020-08-04",
          "date_from": null,
          "date_to": null,
          "move_agreed": null,
          "move_agreed_by": null,
          "move_type": "court_other",
          "reference": "PRX5247T",
          "rejection_reason": null,
          "status": "requested",
          "time_due": "2020-08-04T09:00:00+01:00",
          "updated_at": "2020-07-31T12:04:19+01:00"
        },
        "relationships": {
          "profile": {
            "data": {
              "id": "7cb3e831-4ecd-4aa8-b6fa-b04af615fc5d",
              "type": "profiles"
            }
          },
          "from_location": {
            "data": {
              "id": "00034e29-9ef8-4802-a2f5-09342bf9f174",
              "type": "locations"
            }
          },
          "to_location": {
            "data": {
              "id": "ed58f509-5b6b-4ae7-8302-2de70eb59281",
              "type": "locations"
            }
          },
          "prison_transfer_reason": {
            "data": null
          },
          "court_hearings": {
            "data": []
          },
          "allocation": {
            "data": null
          },
          "original_move": {
            "data": null
          }
        }
      }
    }
  4. The new move can then be accepted changing its status from "requested" to "booked" by calling the accept endpoint:

    curl --request POST \
      --url http://server/api/moves/bbab118f-0356-4c93-8fbf-d251764bd854/accept \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX' \
      --header 'content-type: application/json' \
      --header 'idempotency-key: 5b56a9bc-6c8a-4341-812c-8f542a8f9ea4' \
      --data '{
      "data": {
        "type": "accepts",
        "attributes": {
          "timestamp": "2020-07-31T11:18:20.163Z"
        }
      }
    }'

    This will return a 204 No Content response.

  5. Journeys should be added to move: please see the separate Journey API walkthrough document.

  6. The move can be started, changing its status from "booked" to "in_transit" by calling the start endpoint:

    curl --request POST \
      --url http://server/api/moves/bbab118f-0356-4c93-8fbf-d251764bd854/start \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX' \
      --header 'content-type: application/json' \
      --header 'idempotency-key: a0408dea-d361-4d7c-9013-cb64f36d4d6c' \
      --data '{
      "data": {
        "type": "starts",
        "attributes": {
          "timestamp": "2020-07-31T11:18:29.999Z",
          "notes": "van on the way"
        }
      }
    }'

    This will return a 204 No Content response.

  7. Finally, the move can be completed, changing its status from "in_transit" to "completed" by posting to the complete endpoint:

    curl --request POST \
      --url http://server/api/moves/bbab118f-0356-4c93-8fbf-d251764bd854/complete \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX' \
      --header 'content-type: application/json' \
      --header 'idempotency-key: 109acf9e-6d52-4fa2-87ed-0c667f07a0a9' \
      --data '{
      "data": {
        "type": "completes",
        "attributes": {
          "timestamp": "2020-07-31T11:18:45.148Z",
          "notes": "all is well"
        }
      }
    }'

    This will return a 204 No Content response.

  8. Optionally, the current move record can be inspected at any time by calling the GET move endpoint, using an ?include parameter as required to return the full person, profile or location records:

    curl --request GET \
      --url 'http://server/api/moves/bbab118f-0356-4c93-8fbf-d251764bd854?include=profile.person%2Cfrom_location%2Cto_location' \
      --header 'accept: application/vnd.api+json; version=2' \
      --header 'authorization: Bearer XXX'

    Which returns:

    {
      "data": {
        "id": "bbab118f-0356-4c93-8fbf-d251764bd854",
        "type": "moves",
        "attributes": {
          "additional_information": "example Court to Other move: Huddersfield Youth Court to Bradford County Court",
          "cancellation_reason": null,
          "cancellation_reason_comment": null,
          "created_at": "2020-07-31T12:04:19+01:00",
          "date": "2020-08-04",
          "date_from": null,
          "date_to": null,
          "move_agreed": null,
          "move_agreed_by": null,
          "move_type": "court_other",
          "reference": "PRX5247T",
          "rejection_reason": null,
          "status": "completed",
          "time_due": "2020-08-04T09:00:00+01:00",
          "updated_at": "2020-07-31T12:04:36+01:00"
        },
        "relationships": {
          "profile": {
            "data": {
              "id": "7cb3e831-4ecd-4aa8-b6fa-b04af615fc5d",
              "type": "profiles"
            }
          },
          "from_location": {
            "data": {
              "id": "00034e29-9ef8-4802-a2f5-09342bf9f174",
              "type": "locations"
            }
          },
          "to_location": {
            "data": {
              "id": "ed58f509-5b6b-4ae7-8302-2de70eb59281",
              "type": "locations"
            }
          },
          "prison_transfer_reason": {
            "data": null
          },
          "court_hearings": {
            "data": []
          },
          "allocation": {
            "data": null
          },
          "original_move": {
            "data": null
          }
        }
      },
      "included": [
        {
          "id": "7cb3e831-4ecd-4aa8-b6fa-b04af615fc5d",
          "type": "profiles",
          "attributes": {
            "assessment_answers": [
              {
                "title": "Violent",
                "comments": "does not like marmite",
                "created_at": "2020-07-31",
                "expires_at": null,
                "assessment_question_id": "af8cfc67-757c-4019-9d5e-618017de1617",
                "category": "risk",
                "key": "violent",
                "nomis_alert_type": null,
                "nomis_alert_code": null,
                "nomis_alert_type_description": null,
                "nomis_alert_description": null,
                "imported_from_nomis": false
              },
              {
                "title": "Escape",
                "comments": "good at climbing fences",
                "created_at": "2020-07-31",
                "expires_at": null,
                "assessment_question_id": "f2db9a8f-a5a9-40cf-875b-d1f5f62b2497",
                "category": "risk",
                "key": "escape",
                "nomis_alert_type": null,
                "nomis_alert_code": null,
                "nomis_alert_type_description": null,
                "nomis_alert_description": null,
                "imported_from_nomis": false
              },
              {
                "title": "Must be held separately",
                "comments": "must be held separately",
                "created_at": "2020-07-31",
                "expires_at": null,
                "assessment_question_id": "8f38efb0-36c1-4a56-8c66-3b72c9525f92",
                "category": "risk",
                "key": "hold_separately",
                "nomis_alert_type": null,
                "nomis_alert_code": null,
                "nomis_alert_type_description": null,
                "nomis_alert_description": null,
                "imported_from_nomis": false
              },
              {
                "title": "Special diet or allergy",
                "comments": "peanut allergy",
                "created_at": "2020-07-31",
                "expires_at": null,
                "assessment_question_id": "e6faaf20-3072-4a65-91f7-93d52b16260f",
                "category": "health",
                "key": "special_diet_or_allergy",
                "nomis_alert_type": null,
                "nomis_alert_code": null,
                "nomis_alert_type_description": null,
                "nomis_alert_description": null,
                "imported_from_nomis": false
              }
            ]
          },
          "relationships": {
            "person": {
              "data": {
                "id": "72bd5e3e-6034-4588-9a95-3ab1b181d6b2",
                "type": "people"
              }
            },
            "documents": {
              "data": []
            },
            "person_escort_record": {
              "data": null
            }
          }
        },
        {
          "id": "72bd5e3e-6034-4588-9a95-3ab1b181d6b2",
          "type": "people",
          "attributes": {
            "first_names": "Bob",
            "last_name": "Roberts",
            "date_of_birth": "1980-03-04",
            "gender_additional_information": null,
            "prison_number": null,
            "criminal_records_office": null,
            "police_national_computer": null
          },
          "relationships": {
            "ethnicity": {
              "data": {
                "id": "f480eeff-848c-4fcc-bd75-9f61850fa5bf",
                "type": "ethnicities"
              }
            },
            "gender": {
              "data": {
                "id": "ffac6763-26d6-4425-8005-6e5d052aed88",
                "type": "genders"
              }
            },
            "profiles": {
              "data": [
                {
                  "id": "7cb3e831-4ecd-4aa8-b6fa-b04af615fc5d",
                  "type": "profiles"
                }
              ]
            }
          }
        },
        {
          "id": "00034e29-9ef8-4802-a2f5-09342bf9f174",
          "type": "locations",
          "attributes": {
            "key": "hudryc",
            "title": "Huddersfield Youth Court",
            "location_type": "court",
            "nomis_agency_id": "HUDRYC",
            "can_upload_documents": false,
            "disabled_at": null
          },
          "relationships": {
            "suppliers": {
              "data": []
            }
          }
        },
        {
          "id": "ed58f509-5b6b-4ae7-8302-2de70eb59281",
          "type": "locations",
          "attributes": {
            "key": "bradct",
            "title": "Bradford County Court",
            "location_type": "court",
            "nomis_agency_id": "BRADCT",
            "can_upload_documents": false,
            "disabled_at": null
          },
          "relationships": {
            "suppliers": {
              "data": []
            }
          }
        }
      ]
    }
Clone this wiki locally