Commit d3347bf 1 parent 923173c commit d3347bf Copy full SHA for d3347bf
File tree 1 file changed +7
-6
lines changed
src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/services
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,14 @@ class GetHmppsIdService(
11
11
@Autowired val getPersonService : GetPersonService ,
12
12
) {
13
13
fun execute (hmppsId : String ): Response <HmppsId ?> {
14
- val personResponse = getPersonService.execute(hmppsId)
14
+ val personResponse = getPersonService.execute(hmppsId.uppercase() )
15
15
16
- val hmppsIdToReturn =
17
- personResponse.data?.hmppsId ? : run {
18
- // Attempt to look up the person in NOMIS if not found in the probation offender search
19
- getPersonService.getPersonFromNomis(hmppsId).data?.prisonerNumber
20
- }
16
+ var hmppsIdToReturn =
17
+ personResponse.data?.hmppsId
18
+
19
+ if (hmppsIdToReturn == null ) {
20
+ hmppsIdToReturn = getPersonService.getPersonFromNomis(hmppsId.uppercase()).data?.prisonerNumber
21
+ }
21
22
22
23
return Response (
23
24
data = HmppsId (hmppsIdToReturn),
You can’t perform that action at this time.
0 commit comments