<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
  <info>
    <name>citizen_foreign_diploma_once</name>
    <name_sync_with_filename>Y</name_sync_with_filename>
    <description/>
    <extended_description/>
    <pipeline_version/>
    <pipeline_type>Normal</pipeline_type>
    <parameters>
    </parameters>
    <capture_transform_performance>N</capture_transform_performance>
    <transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
    <transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
    <created_user>-</created_user>
    <created_date>2025/04/29 16:01:18.326</created_date>
    <modified_user>-</modified_user>
    <modified_date>2025/04/29 16:01:18.326</modified_date>
  </info>
  <notepads>
  </notepads>
  <order>
    <hop>
      <from>Table input</from>
      <to>Table output</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Table output</from>
      <to>Dummy (do nothing)</to>
      <enabled>Y</enabled>
    </hop>
  </order>
  <transform>
    <name>Dummy (do nothing)</name>
    <type>Dummy</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <attributes/>
    <GUI>
      <xloc>928</xloc>
      <yloc>352</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Table input</name>
    <type>TableInput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <connection>ervu_person_registry</connection>
    <execute_each_row>N</execute_each_row>
    <limit>0</limit>
    <sql>select ri.recruit_id,
       diploma_item->>'kvalif' as qualification,
       diploma_item->>'kodOKSM' as oksm_code,
       diploma_item->>'naprPod' as study_field,
       diploma_item->>'nomSved' as education_certificate_number,
       diploma_item->>'kodUrObr' as education_level_code,
       to_date(diploma_item->>'dataPriz', 'YYYY-MM-DD') as recognition_date,
       diploma_item->>'prVUSpecz' = '1' as vus_spec,
       diploma_item->>'regNomDok' as doc_reg_num,
       diploma_item->>'serNomDok' as doc_reg_series,
       diploma_item->>'naimInoDok' as foreign_doc_name,
       diploma_item->>'naimUchZaved' as education_institution_name,
       diploma_item->'svedSpeczMinobr'->>'kodSpecz' as education_speciality_minpobr_code,
       diploma_item->'svedSpeczMinprosv'->>'kodSpecz' as education_speciality_minprosv_code
from recruits_info ri
         join recruits r
              ON ri.recruit_id = r.id
                 and '${RCRT_C}' IN (r.target_recruitment_id, r.current_recruitment_id),
     jsonb_array_elements(info->'svedFL'->'svedInObr'->'inObr') as diploma_item
where info->'svedFL'->'svedInObr'->'inObr' != 'null';</sql>
    <variables_active>Y</variables_active>
    <attributes/>
    <GUI>
      <xloc>656</xloc>
      <yloc>208</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Table output</name>
    <type>TableOutput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <commit>20000</commit>
    <connection>ervu-dashboard</connection>
    <fields>
      <field>
        <column_name>recruit_id</column_name>
        <stream_name>recruit_id</stream_name>
      </field>
      <field>
        <column_name>qualification</column_name>
        <stream_name>qualification</stream_name>
      </field>
      <field>
        <column_name>oksm_code</column_name>
        <stream_name>oksm_code</stream_name>
      </field>
      <field>
        <column_name>study_field</column_name>
        <stream_name>study_field</stream_name>
      </field>
      <field>
        <column_name>education_certificate_number</column_name>
        <stream_name>education_certificate_number</stream_name>
      </field>
      <field>
        <column_name>education_level_code</column_name>
        <stream_name>education_level_code</stream_name>
      </field>
      <field>
        <column_name>recognition_date</column_name>
        <stream_name>recognition_date</stream_name>
      </field>
      <field>
        <column_name>vus_spec</column_name>
        <stream_name>vus_spec</stream_name>
      </field>
      <field>
        <column_name>doc_reg_num</column_name>
        <stream_name>doc_reg_num</stream_name>
      </field>
      <field>
        <column_name>doc_reg_series</column_name>
        <stream_name>doc_reg_series</stream_name>
      </field>
      <field>
        <column_name>foreign_doc_name</column_name>
        <stream_name>foreign_doc_name</stream_name>
      </field>
      <field>
        <column_name>education_institution_name</column_name>
        <stream_name>education_institution_name</stream_name>
      </field>
      <field>
        <column_name>education_speciality_minpobr_code</column_name>
        <stream_name>education_speciality_minpobr_code</stream_name>
      </field>
      <field>
        <column_name>education_speciality_minprosv_code</column_name>
        <stream_name>education_speciality_minprosv_code</stream_name>
      </field>
    </fields>
    <ignore_errors>N</ignore_errors>
    <only_when_have_rows>N</only_when_have_rows>
    <partitioning_daily>N</partitioning_daily>
    <partitioning_enabled>N</partitioning_enabled>
    <partitioning_field/>
    <partitioning_monthly>Y</partitioning_monthly>
    <return_field/>
    <return_keys>N</return_keys>
    <schema>ervu_dashboard</schema>
    <specify_fields>Y</specify_fields>
    <table>citizen_foreign_education_diploma</table>
    <tablename_field/>
    <tablename_in_field>N</tablename_in_field>
    <tablename_in_table>Y</tablename_in_table>
    <truncate>N</truncate>
    <use_batch>Y</use_batch>
    <attributes/>
    <GUI>
      <xloc>816</xloc>
      <yloc>208</yloc>
    </GUI>
  </transform>
  <transform_error_handling>
    <error>
      <source_transform>Table output</source_transform>
      <target_transform>Dummy (do nothing)</target_transform>
      <is_enabled>Y</is_enabled>
      <nr_valuename/>
      <descriptions_valuename/>
      <fields_valuename/>
      <codes_valuename/>
      <max_errors/>
      <max_pct_errors/>
      <min_pct_rows/>
    </error>
  </transform_error_handling>
  <attributes/>
</pipeline>
