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
...
Anchor | ||||
---|---|---|---|---|
|
Search Legal Entity in prm.legal_entities using EDRPOU from Signer Certificate where legal_entities.type = Request: $.type and status = active or suspended
...
If $.license_id is not null then
Check if any attribute has changed comparing request and prm.licenses data. If any, then:
For each record in prm.legal_entities related to the license:
If nhs_reviewed = true reset it to false
If nhs_verified = true
reset it to false
set nhs_verified_change_date to current date
Update prm.licenses data according to received request
If $.license_id is null then create new record according to received request
link license and edr_data record
...
Update prm.legal_entities data according to received request
link to the license if license_id is not null
populate updated_by, updated_at
If nhs_reviewed = true reset it to false
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"
Anchor | ||||
---|---|---|---|---|
|
...
If $.license_id is not null then
Check if any attribute has changed comparing request and prm.licenses data. If any, then:
For each record in prm.legal_entities related to the license:
If nhs_reviewed = true reset it to false
If nhs_verified = true
reset it to false
set nhs_verified_change_date to current date
Update prm.licenses data according to received request
If $.license_id is null then create new record according to received request
link license and edr_data record
...
Create new record according to received request
Link it to the license
Link it to edr_data record
Set `nhs_reviewed` and `nhs_verified` to false
Set status =
activesuspendedSet 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 |