30d re-admission

mail@pastecode.io avatar
unknown
yaml
8 days ago
5.3 kB
2
Indexable
Never
predicates:
  hospital_admission:
    code: [
      "HOSPITAL_ADMISSION//EW EMER.//EMERGENCY ROOM",
      "HOSPITAL_ADMISSION//EU OBSERVATION//EMERGENCY ROOM",
      "HOSPITAL_ADMISSION//SURGICAL SAME DAY ADMISSION//PHYSICIAN REFERRAL",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//EMERGENCY ROOM",
      "HOSPITAL_ADMISSION//URGENT//TRANSFER FROM HOSPITAL",
      "HOSPITAL_ADMISSION//URGENT//PHYSICIAN REFERRAL",
      "HOSPITAL_ADMISSION//DIRECT EMER.//PHYSICIAN REFERRAL",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//PHYSICIAN REFERRAL",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//PHYSICIAN REFERRAL",
      "HOSPITAL_ADMISSION//ELECTIVE//PHYSICIAN REFERRAL",
      "HOSPITAL_ADMISSION//EU OBSERVATION//PHYSICIAN REFERRAL",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//TRANSFER FROM HOSPITAL",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//WALK-IN/SELF REFERRAL",
      "HOSPITAL_ADMISSION//DIRECT EMER.//CLINIC REFERRAL",
      "HOSPITAL_ADMISSION//EU OBSERVATION//WALK-IN/SELF REFERRAL",
      "HOSPITAL_ADMISSION//EW EMER.//TRANSFER FROM HOSPITAL",
      "HOSPITAL_ADMISSION//EW EMER.//PHYSICIAN REFERRAL",
      "HOSPITAL_ADMISSION//AMBULATORY OBSERVATION//PROCEDURE SITE",
      "HOSPITAL_ADMISSION//URGENT//INTERNAL TRANSFER TO OR FROM PSYCH",
      "HOSPITAL_ADMISSION//EW EMER.//PROCEDURE SITE",
      "HOSPITAL_ADMISSION//EW EMER.//WALK-IN/SELF REFERRAL",
      "HOSPITAL_ADMISSION//AMBULATORY OBSERVATION//PACU",
      "HOSPITAL_ADMISSION//EW EMER.//PACU",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//CLINIC REFERRAL",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//TRANSFER FROM HOSPITAL",
      "HOSPITAL_ADMISSION//URGENT//TRANSFER FROM SKILLED NURSING FACILITY",
      "HOSPITAL_ADMISSION//EU OBSERVATION//TRANSFER FROM HOSPITAL",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//CLINIC REFERRAL",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//TRANSFER FROM SKILLED NURSING FACILITY",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//EMERGENCY ROOM",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//WALK-IN/SELF REFERRAL",
      "HOSPITAL_ADMISSION//EU OBSERVATION//CLINIC REFERRAL",
      "HOSPITAL_ADMISSION//EW EMER.//TRANSFER FROM SKILLED NURSING FACILITY",
      "HOSPITAL_ADMISSION//EW EMER.//INTERNAL TRANSFER TO OR FROM PSYCH",
      "HOSPITAL_ADMISSION//URGENT//WALK-IN/SELF REFERRAL",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//TRANSFER FROM SKILLED NURSING FACILITY",
      "HOSPITAL_ADMISSION//EW EMER.//CLINIC REFERRAL",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//PROCEDURE SITE",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//PROCEDURE SITE",
      "HOSPITAL_ADMISSION//EU OBSERVATION//TRANSFER FROM SKILLED NURSING FACILITY",
      "HOSPITAL_ADMISSION//URGENT//CLINIC REFERRAL",
      "HOSPITAL_ADMISSION//EW EMER.//INFORMATION NOT AVAILABLE",
      "HOSPITAL_ADMISSION//URGENT//PROCEDURE SITE",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//INTERNAL TRANSFER TO OR FROM PSYCH",
      "HOSPITAL_ADMISSION//URGENT//EMERGENCY ROOM",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//PACU",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//PACU",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//AMBULATORY SURGERY TRANSFER",
      "HOSPITAL_ADMISSION//OBSERVATION ADMIT//INFORMATION NOT AVAILABLE",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//INFORMATION NOT AVAILABLE",
      "HOSPITAL_ADMISSION//URGENT//PACU",
      "HOSPITAL_ADMISSION//EW EMER.//AMBULATORY SURGERY TRANSFER",
      "HOSPITAL_ADMISSION//DIRECT OBSERVATION//INTERNAL TRANSFER TO OR FROM PSYCH",
      "HOSPITAL_ADMISSION//URGENT//AMBULATORY SURGERY TRANSFER",
      "HOSPITAL_ADMISSION//SURGICAL SAME DAY ADMISSION//TRANSFER FROM SKILLED NURSING FACILITY",
      "HOSPITAL_ADMISSION//EU OBSERVATION//INFORMATION NOT AVAILABLE",
      "HOSPITAL_ADMISSION//URGENT//INFORMATION NOT AVAILABLE",
      "HOSPITAL_ADMISSION//EU OBSERVATION//AMBULATORY SURGERY TRANSFER",
      "HOSPITAL_ADMISSION//SURGICAL SAME DAY ADMISSION//TRANSFER FROM HOSPITAL"
    ]

  hospital_discharge:
    code: [
      "HOSPITAL_DISCHARGE//HOME",
      "HOSPITAL_DISCHARGE//UNK",
      "HOSPITAL_DISCHARGE//HOME HEALTH CARE",
      "HOSPITAL_DISCHARGE//SKILLED NURSING FACILITY",
      "HOSPITAL_DISCHARGE//REHAB",
      "HOSPITAL_DISCHARGE//DIED",
      "HOSPITAL_DISCHARGE//CHRONIC/LONG TERM ACUTE CARE",
      "HOSPITAL_DISCHARGE//HOSPICE",
      "HOSPITAL_DISCHARGE//AGAINST ADVICE",
      "HOSPITAL_DISCHARGE//PSYCH FACILITY",
      "HOSPITAL_DISCHARGE//ACUTE HOSPITAL",
      "HOSPITAL_DISCHARGE//OTHER FACILITY",
      "HOSPITAL_DISCHARGE//ASSISTED LIVING",
      "HOSPITAL_DISCHARGE//HEALTHCARE FACILITY"
    ]

trigger: hospital_discharge

windows:
  input:
    start: NULL
    end: trigger
    start_inclusive: True
    end_inclusive: True
    index_timestamp: end
  prior_hospitalization:
    start: end <- hospital_admission
    end: trigger
    start_inclusive: True
    end_inclusive: True
  target:
    start: trigger
    end: start + 30d
    start_inclusive: False
    end_inclusive: True
    label: hospital_admission
  censoring_protection_window:
    start: target.end
    end: null
    start_inclusive: False
    end_inclusive: True
    has:
      _ANY_EVENT: (1, None)