temaon_lieto

Untitled

Sep 16th, 2025
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. CREATE TABLE IF NOT EXISTS cascade_lvl00_progress_disease_codes (
  2. id Int32,
  3. code_type String,
  4. encounter_id Int32,
  5. patient_id Int32,
  6. employee_id Int32 DEFAULT NULL,
  7. code String DEFAULT NULL,
  8. title String,
  9. role String,
  10. diagnose_id Int32 DEFAULT NULL,
  11. legal_entity_id Int32 DEFAULT NULL,
  12. asserted_date DateTime,
  13. ehealth_status Enum('not_sent'=0,'finished'=1, 'entered_in_error'=2, 'failed'=3, 'pending'=4, 'failed_with_error'=5)
  14. ) ENGINE = MergeTree()
  15. ORDER BY tuple()
  16.  
  17.  
  18.  
  19. CREATE TABLE IF NOT EXISTS cascade_lvl00_actions
  20. (
  21. id Int32,
  22. status String DEFAULT 1,
  23. encounter_id Nullable(Int32),
  24. employee_id Nullable(Int32),
  25. patient_id Nullable(Int32),
  26. legal_entity_id Nullable(Int32),
  27. asserted_date Nullable(DateTime),
  28. code Nullable(String),
  29. item_type Int32 DEFAULT 3,
  30. title String
  31. ) ENGINE = MergeTree()
  32. ORDER BY id
  33.  
  34. CREATE TABLE IF NOT EXISTS cascade_lvl01_progress_diseases_services (
  35. id Int32,
  36. asserted_date DateTime DEFAULT NULL,
  37. code String DEFAULT NULL,
  38. encounter_id Int32 DEFAULT NULL,
  39. item_type UInt8,
  40. status String,
  41. title String,
  42. employee_id Int32 DEFAULT NULL,
  43. legal_entity_id Int32 DEFAULT NULL,
  44. patient_id Int32 DEFAULT NULL,
  45. resource_type String
  46. ) ENGINE = MergeTree()
  47. ORDER BY tuple()
  48.  
  49. CREATE TABLE IF NOT EXISTS cascade_lvl02_patient_declarations
  50. (
  51. id Int32,
  52. employee_id Int32,
  53. declaration_id Int32,
  54. legal_entity_id Nullable(Int32),
  55. division_id Nullable(Int32),
  56. declaration_number String,
  57. patient_full_name String,
  58. date_of_birth Date32,
  59. gender Nullable(UInt8),
  60. tax_id Nullable(String),
  61. patient_phone Nullable(String),
  62. health24_id Int32,
  63. ehealth_patient_id Nullable(String),
  64. doctor_full_name String,
  65. doctor_position String,
  66. ehealth_employee_status String,
  67. medical_facility Nullable(String),
  68. declaration_start_date Nullable(Date32),
  69. declaration_end_date Nullable(Date32),
  70. declaration_created_at Nullable(Date32),
  71. declaration_updated_at Nullable(Date32),
  72. ehealth_declaration_id String,
  73. declaration_status String,
  74. declaration_status_title String,
  75. patient_address Nullable(String),
  76. settlement_type_title Nullable(String),
  77. settlement_name Nullable(String),
  78. full_settlement_name Nullable(String),
  79. full_address Nullable(String),
  80. verification_status Nullable(String),
  81. declared_employee_last_encounter_id Nullable(Int32),
  82. last_encounter_id Nullable(Int32),
  83. country_id Nullable(Int32),
  84. region_id Nullable(Int32),
  85. settlement_id Nullable(Int32),
  86. district_id Nullable(Int32)
  87. ) ENGINE = MergeTree()
  88. ORDER BY (id, declaration_id)
  89.  
Advertisement
Add Comment
Please, Sign In to add comment