{"messages": [{"role": "system", "content": "You are a chatbot whose job is to generate SQL queries based on prompts user provides"}, {"role": "user", "content": "For your information, I am sharing the table structure for HLS_CONDITION create table XYZ_CONDITION (\n condition_id VARCHAR(500) ,\n diagnosticreport_id VARCHAR(500) ,\n encounter_id VARCHAR(500) ,\n evidence_cd VARCHAR(100) ,\n evidence_display VARCHAR(250) ,\n evidence_reference VARCHAR(500) ,\n abatement_age VARCHAR(50) ,\n abatement_dttm DATETIME ,\n abatement_period_end_dttm DATETIME ,\n abatement_period_start_dttm DATETIME ,\n abatement_range_high VARCHAR(50) ,\n abatement_range_low VARCHAR(50) ,\n abatementstring VARCHAR(50) ,\n asserter_patient_id VARCHAR(500) ,\n asserter_practitioner_id VARCHAR(500) ,\n asserter_practitionerrole_id VARCHAR(500) ,\n body_site_cd VARCHAR(100) ,\n body_site_display VARCHAR(250) ,\n body_site_system VARCHAR(250) ,\n body_site_txt VARCHAR(500) ,\n category_cd VARCHAR(100) ,\n category_display VARCHAR(250) ,\n category_system VARCHAR(250) ,\n category_txt VARCHAR(500) ,\n clinical_status_cd VARCHAR(100) ,\n clinical_status_display VARCHAR(250) ,\n clinical_status_system VARCHAR(250) ,\n clinical_status_txt VARCHAR(500) ,\n clinicalimpression_id VARCHAR(500) ,\n condition_cd VARCHAR(100) ,\n condition_cd_system VARCHAR(250) ,\n condition_display VARCHAR(250) ,\n condition_txt VARCHAR(500) ,\n evidence_system VARCHAR(250) ,\n group_id VARCHAR(500) ,\n note_txt VARCHAR(500) ,\n observation_id VARCHAR(500) ,\n onset_dttm DATETIME ,\n onset_period_end_dttm DATETIME ,\n onset_period_start_dttm DATETIME ,\n onset_range_high VARCHAR(50) ,\n onset_range_low VARCHAR(50) ,\n onsetage VARCHAR(50) ,\n onsetstring VARCHAR(50) ,\n patient_id VARCHAR(500) ,\n recorded_dttm DATETIME ,\n recorder_patient_id VARCHAR(500) ,\n recorder_practitioner_id VARCHAR(500) ,\n recorder_practitionerrole_id VARCHAR(500) ,\n severity_cd VARCHAR(100) ,\n severity_display VARCHAR(250) ,\n severity_system VARCHAR(250) ,\n severity_txt VARCHAR(500) ,\n stage_summary_cd VARCHAR(100) ,\n stage_summary_cd_system VARCHAR(250) ,\n stage_summary_display VARCHAR(250) ,\n stage_summary_txt VARCHAR(500) ,\n stage_type_cd VARCHAR(100) ,\n stage_type_cd_system VARCHAR(250) ,\n stage_type_display VARCHAR(250) ,\n stage_type_txt VARCHAR(500) ,\n verification_status VARCHAR(100) ,\n data_source_type VARCHAR(100) ,\n data_source_name VARCHAR(100) ,\n connection_id VARCHAR(500) ,\n auto_id BIGINT AUTO_INCREMENT ,\n creation_dttm DATETIME ,\n last_update_dttm DATETIME ,\n created_by VARCHAR(100) ,\n updated_by VARCHAR(100) ,\n job_id VARCHAR(500)\n ,SHARD KEY (auto_id )\n ,SORT KEY (auto_id )\n ,PRIMARY KEY (auto_id )\n);\n"}, {"role": "assistant", "content": "Thank you for sharing"}]} {"messages": [{"role": "system", "content": "You are a chatbot whose job is to generate SQL queries based on prompts user provides"}, {"role": "user", "content": "For your information, here is the table structure for HLS_LOCATION create table XYZ_LOCATION (\n location_id VARCHAR(500) ,\n alias VARCHAR(50) ,\n position_altitude DOUBLE ,\n position_latitude DOUBLE ,\n position_longitude DOUBLE ,\n billing_address_line1 VARCHAR(100) ,\n billing_address_line2 VARCHAR(100) ,\n partof_reference_id VARCHAR(500) ,\n billing_address_city VARCHAR(100) ,\n billing_address_country VARCHAR(100) ,\n billing_address_district VARCHAR(100) ,\n billing_address_province VARCHAR(100) ,\n billing_address_region VARCHAR(100) ,\n billing_address_state VARCHAR(100) ,\n billing_address_zip_postal_cd VARCHAR(100) ,\n description VARCHAR(500) ,\n hoursofoperation_closingtime DOUBLE ,\n hoursofoperation_daysofweek VARCHAR(500) ,\n hoursofoperation_openingtime DOUBLE ,\n location_type_cd VARCHAR(100) ,\n location_type_display VARCHAR(250) ,\n location_type_system VARCHAR(250) ,\n location_type_txt VARCHAR(500) ,\n managingorganization_display VARCHAR(250) ,\n managingorganization_id VARCHAR(500) ,\n mode VARCHAR(100) ,\n operationalstatus VARCHAR(100) ,\n organization_nm VARCHAR(250) ,\n physicaltype_cd VARCHAR(100) ,\n physicaltype_display VARCHAR(250) ,\n physicaltype_system VARCHAR(250) ,\n physicaltype_txt VARCHAR(500) ,\n status VARCHAR(100) ,\n data_source_type VARCHAR(100) ,\n data_source_name VARCHAR(100) ,\n connection_id VARCHAR(500) ,\n auto_id BIGINT AUTO_INCREMENT ,\n creation_dttm DATETIME ,\n last_update_dttm DATETIME ,\n created_by VARCHAR(100) ,\n updated_by VARCHAR(100) ,\n job_id VARCHAR(500)\n ,SHARD KEY (auto_id )\n ,SORT KEY (auto_id )\n ,PRIMARY KEY (auto_id )\n);"}, {"role": "assistant", "content": "Thank you for sharing"}]} {"messages": [{"role": "system", "content": "You are a chatbot whose job is to generate SQL queries based on prompts user provides"}, {"role": "user", "content": "For your information, table structure for HLS_ENCOUNTER create table XYZ_ENCOUNTER (\n encounter_id VARCHAR(500) ,\n admit_source_cd VARCHAR(100) ,\n admit_source_display VARCHAR(250) ,\n admit_source_system VARCHAR(250) ,\n admit_source_txt VARCHAR(500) ,\n patient_id VARCHAR(500) ,\n period_end_dttm DATETIME ,\n period_start_dttm DATETIME ,\n class_cd VARCHAR(100) ,\n class_display VARCHAR(250) ,\n class_system VARCHAR(250) ,\n class_txt VARCHAR(500) ,\n encounter_type_cd VARCHAR(100) ,\n encounter_type_display VARCHAR(250) ,\n encounter_type_system VARCHAR(250) ,\n encounter_type_txt VARCHAR(500) ,\n group_id VARCHAR(500) ,\n participant_period_end_dttm DATETIME ,\n participant_period_start_dttm DATETIME ,\n pre_admission_identifier VARCHAR(100) ,\n priority_cd VARCHAR(100) ,\n priority_txt VARCHAR(500) ,\n reason_cd VARCHAR(100) ,\n reason_cd_system VARCHAR(250) ,\n reason_cd_txt VARCHAR(500) ,\n reason_condition_id VARCHAR(500) ,\n reason_display VARCHAR(250) ,\n reason_immunizationrecomm_id VARCHAR(500) ,\n reason_observation_id VARCHAR(500) ,\n reason_procedure_id VARCHAR(500) ,\n service_type_cd VARCHAR(100) ,\n service_type_display VARCHAR(250) ,\n service_type_system VARCHAR(250) ,\n service_type_txt VARCHAR(500) ,\n status VARCHAR(100) ,\n priority_display VARCHAR(250) ,\n priority_system VARCHAR(250) ,\n organization_id VARCHAR(500) ,\n partof_encounter_id VARCHAR(500) ,\n participant_practitioner_id VARCHAR(500) ,\n participant_practrole_id VARCHAR(500) ,\n participant_type_cd VARCHAR(100) ,\n participant_type_display VARCHAR(250) ,\n participant_type_system VARCHAR(250) ,\n discharge_disposition_cd VARCHAR(100) ,\n discharge_disposition_display VARCHAR(250) ,\n discharge_disposition_system VARCHAR(250) ,\n discharge_disposition_txt VARCHAR(500) ,\n encounter_location_id VARCHAR(500) ,\n participant_type_txt VARCHAR(500) ,\n primary_diag_condition_id VARCHAR(500) ,\n primary_diag_procedure_id VARCHAR(500) ,\n primary_diagnosis_system VARCHAR(250) ,\n primary_diagnosis_txt VARCHAR(500) ,\n primary_diagnosis_use_cd VARCHAR(100) ,\n primary_diagnosis_use_display VARCHAR(250) ,\n readmission_cd VARCHAR(100) ,\n);"}, {"role": "assistant", "content": "Thank you for sharing"}]} {"messages": [{"role": "system", "content": "You are a chatbot whose job is to generate SQL queries based on prompts user provides"}, {"role": "user", "content":"Can you provide me a query for Patients whose last name starts with Johnson"}, {"role": "assistant", "content": "Certainly! Here's a query you can use to find patients whose last name starts with \"Johnson\":\n\nSELECT *\nFROM HLS_PATIENT\nWHERE family_nm LIKE 'Johnson%'"}]}