Purpose
This WS is designed to update contract by NHS by creating new contract request. Contract request is created with contract number, and parent contract is added to request. NHS Admin can change only fields that are on nhs side.
...
- Verify the validity of access token
- in case of error return 401 ('Access denied')
- Check user scope contract_request:create in order to perform this action
- in case of error generate 401 response ('Invalid scopes')
- Verify the validity of access token
Verify role
Extract from token:
...
Decode content that is encrypted in an electronic digital signature.
Use Digital signature WS. Method checks digital signature and returns result.
Validate EDRPOU
- Check that EDRPOU in Certificate details exists and not empty
- in case of error return 422 error ('Invalid EDRPOU in DS')
- Check that EDRPOU in Certificate details is equal to EDPOU in legal entity
- Get client_id from token.
- Find prm.legal_entities id by client_id
- Compare EDRPOU in Certificate with legal_entities.edrpou
- In case validation fails - generate 422 error
- Check that SURNAME in Certificate details is equal to LAST_NAME in Party
- Get user_id → user_parties.party_id → parties.last_name and compare to surname from DS
- Convert prm.parties.LAST_NAME and Certificate details.SURNAME to uppercase
- Compare prm.parties.LAST_NAME and Certificate details.SURNAME as Cyrillic letters
- In case validation fails - generate 422 error
- Get user_id → user_parties.party_id → parties.last_name and compare to surname from DS
...
contract request | old contract | edited fields by nhs | other |
---|---|---|---|
contractor_legal_entity_id | contractor_legal_entity_id | ||
contractor_owner_id | contractor_owner_id | ||
contractor_base | contractor_base | ||
contractor_payment_details | contractor_payment_details | ||
contractor_rmsp_amount | contractor_rmsp_amount | ||
start_date | start_date | ||
end_date | end_date | ||
nhs_legal_entity_id | token.client_id | ||
nhs_signer_id | nhs_signer_id | ||
nhs_signer_base | nhs_signer_base | ||
contractor_signed | false | ||
issue_city | issue_city | ||
status | APPROVED | ||
status_reason | null | ||
nhs_contract_price | nhs_contract_price | ||
nhs_payment_method | nhs_payment_method | ||
contract_number | contract_number | ||
id_form | id_form | ||
contractor_divisions | SELECT id | ||
misc | misc | ||
assignee_id | assignee_id | ||
type | type | ||
medical_program_id | medical_program_id |
...
Get url for contract request upload.
ParameterSourceaction 'GET' bucket 'CONTRACT_REQUEST' resource_id : CONTRACT_REQUEST_ID resource_name : CONTRACT_REQUEST_APPROVED timestamp :TIMESTAMP - Upload signed contract request to media storage
...
field | value | example |
---|---|---|
event_type | ContractRequestCreateEvent | |
entity_type | {$.contract.type}ContractRequest | CapitationContractRequest/ReimbursementContractRequest |
entity_id | $.id | |
properties.contract.old | $.parent_id | |
event_time | $.update_at | |
changed_by | $.user_id | |
inserted_at | now() | |
updated_at | now() |