/
RCC (CSI-3150) Submit Diagnostic Report Package
  • In progress
  • ЕСОЗ - публічна документація

    RCC (CSI-3150) Submit Diagnostic Report Package

    Diagnostic report validation

    1. Validate diagnostic_report _id is unique for MongoDB.Diagnostic_reports

    2. Validate $.diagnostic_report.categories

      1. is an array with only one item

        1. in case of error return 422 "Expected a maximum of 1 items but got <number of elements>"

    3. Validate that $.diagnostic_report.category.coding.code is eHealth/diagnostic_report_categories dictionary, required

      1. in case of error return 422 "value is not allowed in enum"

    4. Validate that diagnostic reports category corresponds to service category, that is references as code in DR

      1. $.diagnostic_report.category=PRM.services.category
        where PRM.services.id=$.diagnostic_report.code.identifier.value

        1. in case of error return 422 "Diagnostic report category does not match with the service category"

    5. Validate that service, referenced as a code in DR, is active
      Note. For diagnostic_report.code pass only "service", and the "service_group" does not pass

      1. PRM.services.is_active = true where PRM.services.id=$.diagnostic_report.code.identifier.value

        1. in case of errror return 422 "Service is not active"

      2. If service_requests.code.identifier.value is service, validate $diagnostic_report.code.identifier.value = service_requests.code.identifier.value

        1. in case error return 409, "Service in diagnostic_report differ from service in service request"

      3. if service_requests.code.identifier.value is service_group, validate $diagnostic_report.code.identifier.value in (SELECT service_id from service_inclusions where service_group_id='service_requests.code.identifier.value')

        1. in case error return 409, "Service in diagnostic_report differ from services in service request's service_group"

    6. Validate referrals

      1. As a referral it can be referenced electronic (registered in the system) OR paper service request

      2. Validate ($.diagnostic_report.based_on OR $.diagnostic_report.paper_referral) or none in request

      3. Validate based on as Reference

      4. Validate paper referral as Object (paper_referral)

      5. Validate that service_request, referenced as based_on, is

        1. in status is active or program_processing_status=in_progress (any status is valid in case program_processing_status= in_progress)

          1. in case of error return 409 "Invalid service request status"

        2. used_by_legal_entity==token.client_id OR null

          1. in case of error return 409 "Service request is used by another legal_entity"

        3. if program is defined than used_by_legal_entity==token.client_id or NULL

          1. in case of error return 409 "Service request is used by another legal_entity"

        4. if program is defined than program_processing_status == new, in_queue or in_progress

        5. check that service_request contains based_on parameter

          1. in case based_on present in service_request

            1. verify care_plan:

              1. It should be in active status

              2. Care plan's period end (if exist) should be greater than current date or equal.

            2. verify activity:

              1. It has activity.detail.kind=service_request; activity.detail.product_reference=service_id. 

              2. It has scheduled, in_progress status

              3. For an old activities (has no units in quantity) validate remaining_quantity as described at Submit Encounter Data Package: Related care plan validation

          2. in case based_on not present in request skip previous validations.

        6. Check if service request quantity is not exhausted as described at Submit Encounter Data Package: Related service request validation

    7. Validate effective_period and effective_date_time:

      1. Check that only one of this parameters present

        1. in case error return 422 "Only one of the parameters must be present"

    8. Validate effective_period as a period (PeriodValidation)

      1. Validate that effective_period.end is within acceptable limits

        1. $.diagnostic_reports[*].effective_period.end <= diagnostic_reports[*].issued

          1. in case of error return 422 "End date time must be less than or equal the issued date time"

    9. Validate that effective_date_time is within acceptable limits

      1. $.diagnostic_reports[*].effective_date_time <= diagnostic_reports[*].issued

        1. in case of error return 422 "Effective date time must be less than or equal the issued date time"

    10. Validate that issued is within acceptable limits

      1. $.diagnostic_reports[*].issued<= current date_time

        1. in case of error 422 "Issued date  must be in past"

      2. $.diagnostic_reports[*].issued>=current_date-diagnostic_report_max_days_passed

        1. in case of error 422 "Issued must be greater than  {{current_date-diagnostic_report_max_days_passed}}" 

    Related content

    RCC (CSI-2960+2919) Submit Encounter Package
    RCC (CSI-2960+2919) Submit Encounter Package
    More like this
    RCC (CSI-3150) Submit Encounter Data Package
    RCC (CSI-3150) Submit Encounter Data Package
    More like this

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