Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

Uploading and processing registers

Terminate declaration

Logic

NHS admin download files with fields according to file structure.

...

Name

Source

Description

id

$batch_id

id=batch_id from il.registers

file_name

$file_name

file_name=file_name from il.registers

status

[new, processing, processed ]

new - file was downloaded and not processed

processing - when processing entries>0

processed - when processing entries=0

type

$type

type=type from il.dictionaries.name='REGISTER_TYPE'

qty

{not_found: number,

processing: number,

errors: number,

total: number}


errors

["Row has length 4 - expected length 5 on line 5",
"Row has length 1 - expected length 5 on line 7"]


inserted_at

user_id


inserted_by

:timestamp


updated_at

user_id


updated_by

:timestamp



The data from file must be stored to il.register_entries. In case some rows had errors those entries will be shown in filed "errors" and won't be processed.

Name 

Source

Description

id



register_id


the unique id for the batch upload

person_type

enum(employee,patient)


type

$type

document_type

number

$number

document_number

status

  • processing

  • matched, not_found


inserted_at

user_id

from token

inserted_by

:timestamp


updated_at

user_id


updated_by

:timestamp


After the file was processed the field "qty" from table il.registers must be updated.

Terminate declaration

If the person was matched then

  1. update declarations.status to `terminated`

  2. update persons.status='INACTIVE'

  3. change declarations.reason to $"auto_"||type

  4. update il.registers.status='matched'

  5. update mpi.persons.death_date = $death_date

...

If declaration_id was matched

  1. update ops.declarations.status to `terminated`

  2. update ops.declaration.updated_at = now()

  3. update ops.declaration.updated_by = $user_id

  4. change declarations.reason to $"auto_"||type

  5. update il.registers.status='matched'

  6. involve Event Manager for changed status 

Reset authentication method

If the person was matched then

  1. update mpi.person_authentication_methods.type to `NA`

  2. update mpi.person_authentication_methods.phone_number to `null`

  3. update mpi.person_authentication_methods.updated_at to `now`

  4. update il.registers.status='matched'

...