Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added autocomplete for first_for_patient()/last_for_patient() #2388

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ehrql/docs/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
ql.when,
ql.DummyDataConfig,
ql.Error,
ql.int_property, # Internal thing for type hints and autocomplete
# All of the rest are internal things for type hints and autocomplete
ql.int_property,
ql.PatientLevelTable,
}


Expand Down
Empty file.
28 changes: 28 additions & 0 deletions ehrql/patient_level_table_definitions/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# THIS FILE IS AUTOGENERATED. DO NOT CHANGE IT MANUALLY.
#
# It can be regenerated by executing `just update-patient-level-table-definitions`

from ehrql.query_language import (
CodePatientSeries,
DatePatientSeries,
FloatPatientSeries,
IntPatientSeries,
PatientLevelTable,
)


class PracticeRegistrations(PatientLevelTable):
start_date: DatePatientSeries
end_date: DatePatientSeries
practice_pseudo_id: IntPatientSeries


class ClinicalEvents(PatientLevelTable):
date: DatePatientSeries
snomedct_code: CodePatientSeries
numeric_value: FloatPatientSeries


class Medications(PatientLevelTable):
date: DatePatientSeries
dmd_code: CodePatientSeries
26 changes: 26 additions & 0 deletions ehrql/patient_level_table_definitions/emis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# THIS FILE IS AUTOGENERATED. DO NOT CHANGE IT MANUALLY.
#
# It can be regenerated by executing `just update-patient-level-table-definitions`

from ehrql.query_language import (
CodePatientSeries,
DatePatientSeries,
FloatPatientSeries,
PatientLevelTable,
)


class ClinicalEvents(PatientLevelTable):
date: DatePatientSeries
snomedct_code: CodePatientSeries
numeric_value: FloatPatientSeries


class Medications(PatientLevelTable):
date: DatePatientSeries
dmd_code: CodePatientSeries


class Vaccinations(PatientLevelTable):
date: DatePatientSeries
procedure_code: CodePatientSeries
Empty file.
25 changes: 25 additions & 0 deletions ehrql/patient_level_table_definitions/raw/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# THIS FILE IS AUTOGENERATED. DO NOT CHANGE IT MANUALLY.
#
# It can be regenerated by executing `just update-patient-level-table-definitions`

from ehrql.query_language import CodePatientSeries, DatePatientSeries, PatientLevelTable


class OnsDeaths(PatientLevelTable):
date: DatePatientSeries
underlying_cause_of_death: CodePatientSeries
cause_of_death_01: CodePatientSeries
cause_of_death_02: CodePatientSeries
cause_of_death_03: CodePatientSeries
cause_of_death_04: CodePatientSeries
cause_of_death_05: CodePatientSeries
cause_of_death_06: CodePatientSeries
cause_of_death_07: CodePatientSeries
cause_of_death_08: CodePatientSeries
cause_of_death_09: CodePatientSeries
cause_of_death_10: CodePatientSeries
cause_of_death_11: CodePatientSeries
cause_of_death_12: CodePatientSeries
cause_of_death_13: CodePatientSeries
cause_of_death_14: CodePatientSeries
cause_of_death_15: CodePatientSeries
25 changes: 25 additions & 0 deletions ehrql/patient_level_table_definitions/raw/emis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# THIS FILE IS AUTOGENERATED. DO NOT CHANGE IT MANUALLY.
#
# It can be regenerated by executing `just update-patient-level-table-definitions`

from ehrql.query_language import CodePatientSeries, DatePatientSeries, PatientLevelTable


class OnsDeaths(PatientLevelTable):
date: DatePatientSeries
underlying_cause_of_death: CodePatientSeries
cause_of_death_01: CodePatientSeries
cause_of_death_02: CodePatientSeries
cause_of_death_03: CodePatientSeries
cause_of_death_04: CodePatientSeries
cause_of_death_05: CodePatientSeries
cause_of_death_06: CodePatientSeries
cause_of_death_07: CodePatientSeries
cause_of_death_08: CodePatientSeries
cause_of_death_09: CodePatientSeries
cause_of_death_10: CodePatientSeries
cause_of_death_11: CodePatientSeries
cause_of_death_12: CodePatientSeries
cause_of_death_13: CodePatientSeries
cause_of_death_14: CodePatientSeries
cause_of_death_15: CodePatientSeries
154 changes: 154 additions & 0 deletions ehrql/patient_level_table_definitions/raw/tpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# THIS FILE IS AUTOGENERATED. DO NOT CHANGE IT MANUALLY.
#
# It can be regenerated by executing `just update-patient-level-table-definitions`

from ehrql.query_language import (
CodePatientSeries,
DatePatientSeries,
FloatPatientSeries,
IntPatientSeries,
PatientLevelTable,
StrPatientSeries,
)


class Isaric(PatientLevelTable):
age: StrPatientSeries
age_factor: StrPatientSeries
calc_age: StrPatientSeries
sex: StrPatientSeries
ethnic___1: StrPatientSeries
ethnic___2: StrPatientSeries
ethnic___3: StrPatientSeries
ethnic___4: StrPatientSeries
ethnic___5: StrPatientSeries
ethnic___6: StrPatientSeries
ethnic___7: StrPatientSeries
ethnic___8: StrPatientSeries
ethnic___9: StrPatientSeries
ethnic___10: StrPatientSeries
covid19_vaccine: StrPatientSeries
covid19_vaccined: DatePatientSeries
covid19_vaccine2d: DatePatientSeries
covid19_vaccined_nk: StrPatientSeries
corona_ieorres: StrPatientSeries
coriona_ieorres2: StrPatientSeries
coriona_ieorres3: StrPatientSeries
inflammatory_mss: StrPatientSeries
cestdat: DatePatientSeries
chrincard: StrPatientSeries
hypertension_mhyn: StrPatientSeries
chronicpul_mhyn: StrPatientSeries
asthma_mhyn: StrPatientSeries
renal_mhyn: StrPatientSeries
mildliver: StrPatientSeries
modliv: StrPatientSeries
chronicneu_mhyn: StrPatientSeries
malignantneo_mhyn: StrPatientSeries
chronichaemo_mhyn: StrPatientSeries
aidshiv_mhyn: StrPatientSeries
obesity_mhyn: StrPatientSeries
diabetes_type_mhyn: StrPatientSeries
diabetescom_mhyn: StrPatientSeries
diabetes_mhyn: StrPatientSeries
rheumatologic_mhyn: StrPatientSeries
dementia_mhyn: StrPatientSeries
malnutrition_mhyn: StrPatientSeries
smoking_mhyn: StrPatientSeries
hostdat: DatePatientSeries
hooccur: StrPatientSeries
hostdat_transfer: DatePatientSeries
hostdat_transfernk: StrPatientSeries
readm_cov19: StrPatientSeries
dsstdat: DatePatientSeries
dsstdtc: DatePatientSeries


class Medications(PatientLevelTable):
date: DatePatientSeries
dmd_code: CodePatientSeries
consultation_id: IntPatientSeries
medication_status: IntPatientSeries


class OnsDeaths(PatientLevelTable):
date: DatePatientSeries
place: StrPatientSeries
underlying_cause_of_death: CodePatientSeries
cause_of_death_01: CodePatientSeries
cause_of_death_02: CodePatientSeries
cause_of_death_03: CodePatientSeries
cause_of_death_04: CodePatientSeries
cause_of_death_05: CodePatientSeries
cause_of_death_06: CodePatientSeries
cause_of_death_07: CodePatientSeries
cause_of_death_08: CodePatientSeries
cause_of_death_09: CodePatientSeries
cause_of_death_10: CodePatientSeries
cause_of_death_11: CodePatientSeries
cause_of_death_12: CodePatientSeries
cause_of_death_13: CodePatientSeries
cause_of_death_14: CodePatientSeries
cause_of_death_15: CodePatientSeries


class WlClockstops(PatientLevelTable):
activity_treatment_function_code: StrPatientSeries
priority_type_code: StrPatientSeries
pseudo_organisation_code_patient_pathway_identifier_issuer: StrPatientSeries
pseudo_patient_pathway_identifier: StrPatientSeries
pseudo_referral_identifier: StrPatientSeries
referral_request_received_date: StrPatientSeries
referral_to_treatment_period_end_date: StrPatientSeries
referral_to_treatment_period_start_date: StrPatientSeries
source_of_referral_for_outpatients: StrPatientSeries
waiting_list_type: StrPatientSeries
week_ending_date: StrPatientSeries


class WlOpenpathways(PatientLevelTable):
activity_treatment_function_code: StrPatientSeries
current_pathway_period_start_date: StrPatientSeries
priority_type_code: StrPatientSeries
pseudo_organisation_code_patient_pathway_identifier_issuer: StrPatientSeries
pseudo_patient_pathway_identifier: StrPatientSeries
pseudo_referral_identifier: StrPatientSeries
referral_request_received_date: StrPatientSeries
referral_to_treatment_period_end_date: StrPatientSeries
referral_to_treatment_period_start_date: StrPatientSeries
source_of_referral: StrPatientSeries
waiting_list_type: StrPatientSeries
week_ending_date: StrPatientSeries


class ApcsHistorical(PatientLevelTable):
apcs_ident: IntPatientSeries
admission_date: DatePatientSeries
discharge_date: DatePatientSeries
spell_core_hrg_sus: StrPatientSeries


class ApcsCostHistorical(PatientLevelTable):
apcs_ident: IntPatientSeries
grand_total_payment_mff: FloatPatientSeries
tariff_initial_amount: FloatPatientSeries
tariff_total_payment: FloatPatientSeries
admission_date: DatePatientSeries
discharge_date: DatePatientSeries


class CovidTherapeuticsRaw(PatientLevelTable):
current_status: StrPatientSeries
covid_indication: StrPatientSeries
diagnosis: StrPatientSeries
intervention: StrPatientSeries
treatment_start_date: DatePatientSeries
CASIM05_risk_cohort: StrPatientSeries
MOL1_high_risk_cohort: StrPatientSeries
SOT02_risk_cohorts: StrPatientSeries
form_name: StrPatientSeries
received: DatePatientSeries
count: IntPatientSeries
age_at_received_date: IntPatientSeries
region: StrPatientSeries
load_date: DatePatientSeries
Loading
Loading