Настройка интеграции с CMD
Создаем конфигурационный файл и вносим параметры доступа, полученные от службы поддержки лаборатории:
echo 'LpuCode = xxx token = xxx url = https://office.cmd-online.ru/api/v1/order/integration ftp = 10.10.1.45 ftp_login = xxx ftp_password = kr4JrL5f '>> /var/www/mgerm25/conf/cmd.ini
Настройки базы данных
USE
medis_interface
; REPLACE INTO references
(recordTypeID
, name
, dead
, chapter
, med_refferal
, need_redirection
, edit_GUID
, order
, order2
, interf_ref
, d_table
, num_list
, signs
, show_treatment
, show_content
, show_time
, print_size_percentage
, print_checker
, status_buttons
, buttonSetID
, buttonSetID_inp
, extend_record_class
, record_method_in
, record_method_out
, TH_output_style
, TD_output_style
, Tbl_output_style
, Tbl_input_style
, TH_input_style
, TD_input_style
, button_line_style
, status_line_style
, button_line_style_inp
, text_style
, files_style
, files_alias
, files_script
, show_in_summary
, show_in_hystory
, show_in_refferals
, identifier
, print_form
, print_form_cap
, common_view
, use_autotemplate
, multifier
, specialist_visit
, form14_operation_identifier
, show_creation_date_in_caption
, copy_content_from_previous_record_of_same_type
, show_date
, print_full_text_position
, allow_record_date_change
, PHR_notification
, PHR_hide_record
, summary_referecnce_order
, print_template_php
, print_record_date_from_field_date
, dont_show_name_in_print_all_records
, dont_show_name_in_print_record
, dont_print_treatment
, show_contract_type_in_head
, first_hystory_record
, auto_lock
, advanced_protocols
, info
, ClinicalDocument/code
, force_patient_name_printing
, minzdrav_code
, show_count_in_report
, show_time_in_info
, Место оказания помощи
, Порядок случаев госпитализации или обращения
, export_recordTypeGroup
, show_in_analise_dynamic
, dont_print_recomendations
, ref_replace_dep_director_position
, IdCaseType
, IdVisitPurpose
, sisterEveryDayMandatoryRecord
) VALUES (709, 'Заказ CMD', 0, 80, 0, 0, NULL, NULL, NULL, 'default', 'default', 0, NULL, NULL, 1, 0, NULL, 1, 'procbiomaterialslock', 'procbiomaterials convertplan', 'saveonly zakazcmd', 'classextentionrecord', 'showbill', 'HidePayForHystoryZabor', 'THoutputstd', 'TDoutputstd', 'Tbloutputstd', 'Tbloutputstd', 'THoutputstd', 'TRoutputinp', 'recordbuttonsrow', 'statusstyle', 'recordbuttonsrow', 'stdinfostyle', 'stdfilesstyle', NULL, '/fileoperationsdownload.php', 0, 1, 1, NULL, NULL, NULL, 0, 1, 1, 0, NULL, 1, 0, 1, 0, NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, NULL, 0, 0, NULL, NULL, 0, NULL, 0, 1, NULL, NULL, NULL, 0, 0, NULL, 2, 1, 0); REPLACE INTO references
(recordTypeID
, name
, dead
, chapter
, med_refferal
, need_redirection
, edit_GUID
, order
, order2
, interf_ref
, d_table
, num_list
, signs
, show_treatment
, show_content
, show_time
, print_size_percentage
, print_checker
, status_buttons
, buttonSetID
, buttonSetID_inp
, extend_record_class
, record_method_in
, record_method_out
, TH_output_style
, TD_output_style
, Tbl_output_style
, Tbl_input_style
, TH_input_style
, TD_input_style
, button_line_style
, status_line_style
, button_line_style_inp
, text_style
, files_style
, files_alias
, files_script
, show_in_summary
, show_in_hystory
, show_in_refferals
, identifier
, print_form
, print_form_cap
, common_view
, use_autotemplate
, multifier
, specialist_visit
, form14_operation_identifier
, show_creation_date_in_caption
, copy_content_from_previous_record_of_same_type
, show_date
, print_full_text_position
, allow_record_date_change
, PHR_notification
, PHR_hide_record
, summary_referecnce_order
, print_template_php
, print_record_date_from_field_date
, dont_show_name_in_print_all_records
, dont_show_name_in_print_record
, dont_print_treatment
, show_contract_type_in_head
, first_hystory_record
, auto_lock
, advanced_protocols
, info
, ClinicalDocument/code
, force_patient_name_printing
, minzdrav_code
, show_count_in_report
, show_time_in_info
, Место оказания помощи
, Порядок случаев госпитализации или обращения
, export_recordTypeGroup
, show_in_analise_dynamic
, dont_print_recomendations
, ref_replace_dep_director_position
, IdCaseType
, IdVisitPurpose
, sisterEveryDayMandatoryRecord
) VALUES (201, 'Результаты анализа', 0, 80, 0, 0, NULL, NULL, NULL, 'default', 'default', 0, NULL, 0, 1, 0, NULL, 1, NULL, 'getcmdpdf', 'saveonly', 'classextentionrecord', 'showbodyfromphpscript', 'restorebodyshow', 'THoutputstd', 'TDoutputstd', 'Tbloutputstd', 'Tbloutputstd', 'THoutputstd', 'TRoutputinp', 'recordbuttonsrow', 'statusstyle', 'recordbuttonsrow', 'stdinfostyle', 'stdfilesstyle', NULL, '/fileoperationsdownload.php', 1, 1, 1, NULL, '-', NULL, 0, 1, 1, 0, NULL, 1, 0, 1, 0, NULL, 0, 0, NULL, '/services/Core/DatabaseRecord.getData?template=/laboratory/CMD/results.html', 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, NULL, 0, 1, NULL, NULL, NULL, 0, 0, NULL, 2, 1, 0); INSERT INTO button_set
(author_only
, GUID
, digested
, always
, ID
, order
, html_id
, style
, Name
, script
, Action
, title
, image
, dead
, lifespan
, callback
) VALUES (0, NULL, 1, 0, 'getcmdpdf', 2, NULL, 'butimage', NULL, 'butpresssi', '/services/Laboratory/LaboratoryRequest.getResult?template=/laboratory/CMD/download.html&', 'Запросить PDF результат анализа', 'pdf.png', 0, NULL, NULL); UPDATE button_set
SET dead
= 1 WHERE ID
= 'procbiomaterials'; INSERT INTO button_set
(author_only
, GUID
, digested
, always
, ID
, order
, html_id
, style
, Name
, script
, Action
, title
, image
, dead
, lifespan
, callback
) VALUES (0, NULL, 0, 0, 'procbiomaterials', 0, NULL, 'std40', 'Изменить', 'butpresssi', '/kpo/calculator', 'Составить список услуг', NULL, 0, NULL, NULL); INSERT INTO button_set
(author_only
, GUID
, digested
, always
, ID
, order
, html_id
, style
, Name
, script
, Action
, title
, image
, dead
, lifespan
, callback
) VALUES (0, NULL, 0, 0, 'procbiomaterials', 0, 'DEL', 'std40', 'Удалить', 'butpresssidel', 'edit', 'Удалить запись', NULL, 0, NULL, NULL); INSERT INTO button_set
(author_only
, GUID
, digested
, always
, ID
, order
, html_id
, style
, Name
, script
, Action
, title
, image
, dead
, lifespan
, callback
) VALUES (0, 9, 0, 0, 'procbiomaterials', 2, NULL, 'std40', 'Отправить в CMD', 'butpresssi', '/_services/Laboratory/LaboratoryRequest.makeOrder?template=/laboratory/helix/saveDataResult.html&', 'Отправка заказа в CMD', NULL, 0, NULL, NULL);
Настройки планировщика задач
#write out current crontab crontab -l> mycron #echo new cron into cron file echo '0 */2 * * * curl «http:localhost/services/Laboratory/CMD/CmdConnector.getAndStoreResult?noconnection=1»'» mycron #install new cron file crontab mycron rm mycron
Для получения результатов необходимо установить и настроить VPN согласно инструкциям от лаборатории CMD.
Основные методы интерфейса
Получение результата
/services/Laboratory/CMD/CmdConnector.getAndStoreResult?noconnection=1
Отправка заказа
/_services/Laboratory/LaboratoryRequest.makeOrder?template=/laboratory/helix/saveDataResult.html&
Получение PDF
/_services/Laboratory/LaboratoryRequest.getResult?template=/laboratory/CMD/download.html&