ЕСОЗ - публічна документація

RC_(CSI-2625) Submit Encounter Data Package

Зміни стосуються розділу “Validate Encounter”, підрозділу “Global validations”:

 

Validate Encounter

Global validations

  1. Validate encounter id as a primary key (Submit Encounter Data Package | Primary key validation )

  2. Validate that the date is within acceptable limits

    1. $.encounter.date<= current_date

    2. $.encounter.date>=current_date-encounter_max_days_passed

    3. $.encounter.date>=episode.period.start where episode.id=$encounter.episode.identifier.value

      1. in case of error return 422 "Encounter’s date must be equal to or greater than start date of episode"

  3. Validate that the period is within acceptable limits

    1. $.encounter.period.start<= current_date

      1. in case of error return 422 "Date must be in past"

    2. $.encounter.period.start>=current_date-encounter_max_days_passed

      1. in case of error return 422 "Date must be greater than {{current_date-encounter_max_days_passed}}"

    3. $.encounter.period.start>=episode.period.start where episode.id=$encounter.episode.identifier.value

      1. in case of error return 422 "Encounter’s date must be equal to or greater than start date of episode"

    4. $.encounter.period.end <= current_date

      1. in case of error return 422 "End date must be equal to or less than current date"

    5. $.encounter.period.end>= $.encounter.period.start

      1. in case of error return 422 "End date must be greater than start date"

  4. Validate "episode" is an active episode that belongs to the current patient

    1. $.encounter.episode.identifier.value is one of  ME.patinet{patient_id}.episodes{*}.id

      1. in case of error return 422 "Episode with such ID is not found"

    2. $.encounter.episode.identifier.value is an ID of an Episode that meets the requirements:

      1. ME.patient{patinet_id}.episodes{episode_id}.status = 'active'

        1. in case of error return 422 "Episode is not active"

      2. ME.patient{patinet_id}.episodes{episode_id}.managing_organization==token.client_id

        1. in case of error return 422 "Managing_organization in the episode does not correspond to user`s legal_entity"

ЕСОЗ - публічна документація