Versions Compared

Key

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

General

Key features and main differences from previous edition:

  • legal entity types and licenses are created/updated one by one, i.e. one legal entity type and one license are accepted in one call

  • medical_services_providers structure is removed, accreditation parameter is moved to edr_legal_entities table

  • legal entity type calculation rules are removed

  • validation and merge of kveds step is removed

  • mithrill AuthAPI call is changed

  • mis verification is removed

  • suspend contract on name change is removed

  • owner employee can be updated 

...

At the moment it is - "P1, P2, P3, P32, P4, P6, P5, P18, P19, P22, P23, P24, P25, P26, P229, P230, P231, P232, P233, P234, P235, P236, P240, P257, P237, P238, P239, P247, P249"

Validate employee type

if $.employee_id is not null check that employee exists in DB and has type OWNER

...


Legal entity types license obligation and corresponding types


Legal Entity type

License needed

License type

PRIMARY_CARE

Y

MSP

OUTPATIENT

Y

MSP

EMERGENCY

Y

MSP

PHARMACY

Y

PHARMACY

MIS

N


NHS

N



Save signed content

Generate RESOURCE_NAME for signed content

...

Invoke Media Content Storage to get upload URL for the document

Parameter

Source

action

'PUT'

bucket

'LEGAL_ENTITIES'

resource_id

:RESOURCE_NAME

resource_name

:RESOURCE_ID


Upload file via Google Cloud API

...

Search Legal Entity in prm.legal_entities using EDRPOU from Signer Certificate where legal_entities.type = Request: $.type and status = active or suspended

...

  1. If $.license_id is not null then

    1. Check if any attribute has changed comparing request and prm.licenses data. If any, then:

      1. For each record in prm.legal_entities related to the license:

        1. If nhs_reviewed = true reset it to false

        2. If nhs_verified = true

          1. reset it to false

          2. set nhs_verified_change_date to current date

    2.  Update prm.licenses data according to received request

  2.  If $.license_id is null then create new record according to received request

    1. link license and edr_data record

...

  1. Update prm.legal_entities data according to received request

    1. link to the license if license_id is not null 

    2. populate updated_by, updated_at

  2. If nhs_reviewed = true reset it to false

  3. If nhs_verified = true reset it to false and set nhs_verified_change_date to current date

Update LE official name

Extract official name from Digital signature. 

  • Update `legal_entities.public_name` in prm with official name from Digital signature

  • Update `clients.name` in mithril with official name from Digital signature  

Update Contract Request

Find contract requests related to current legal entity in status = NEW, APPROVED, PENDING_NHS_SIGN, NHS_SIGNED, set status = 'TERMINATED', status_reason "Legal Entity Data has changed"

...

  1. If $.license_id is not null then

    1. Check if any attribute has changed comparing request and prm.licenses data. If any, then:

      1. For each record in prm.legal_entities related to the license:

        1. If nhs_reviewed = true reset it to false

        2. If nhs_verified = true

          1. reset it to false

          2. set nhs_verified_change_date to current date

    2.  Update prm.licenses data according to received request

  2.  If $.license_id is null then create new record according to received request

    1. link license and edr_data record

...

  1. Create new record according to received request

    1. Link it to the license

    2. Link it to edr_data record

  2. Set  `nhs_reviewed` and `nhs_verified` to false

  3. Set status = active suspended

  4. Set nhs_verified_change_date to current date

Save LE official name

Extract official name from Digital signature. 

  • Save LE official name to prm DB = legal_entities.public_name

  • Save LE official name to mithril DB = clients.name 

...

Init IL.Create employee request

Mapping

Parameter

Source

employee_id

Request: $.employee_id

legal_entity_id

Generated previously

employee_type

Const: OWNER

position

Request: $.owner.position

status

Const: ACTIVE

start_date

now()

party

Request: $.owner