CDM Table name: stem_table (CDM v5.4)
Reading from hesin_diag, hesin

| Destination Field | Source field | Logic | Comment field | |
|---|---|---|---|---|
| id | Autogenerate | |||
| domain_id | NULL | |||
| person_id | eid | |||
| visit_occurrence_id | eid, hesin.spell_index | |||
| visit_detail_id | eid, ins_index | |||
| source_value | diag_icd9, diag_icd10 | add dots when necessary | diag_icd9 and diag_icd10 are mutually exclusive; they are provided without dots | |
| source_concept_id | diag_icd9, diag_icd10 | |||
| type_concept_id | 32829 - EHR administration record | |||
| start_date | hesin.epistart, hesin.admidate | use the first not null of (hesin.epistart, hesin.admidate) | ||
| start_datetime | hesin.epistart, hesin.admidate | |||
| end_date | hesin.epiend, hesin.disdate, hesin.epistart, hesin.admidate | use the first not null of (hesin.epiend,hesin.disdate,hesin.epistart,hesin.admidate) | ||
| end_datetime | hesin.epiend, hesin.disdate, hesin.epistart, hesin.admidate | |||
| concept_id | diag_icd9, diag_icd10 | use ICD9CM or ICD10 vocabulary depending on the presence of diag_icd9 or diag_icd10 | ||
| disease_status_source_value | level | use 32902 for primary diagnosis (level = 1) or 32908 for secondary diagnosis (level > 1) | ||
| stem_source_table | hesin_diag |
Reading from hesin_oper, hesin

| Destination Field | Source field | Logic | Comment field | |
|---|---|---|---|---|
| id | Autogenerate | |||
| domain_id | NULL | |||
| person_id | eid | |||
| visit_occurrence_id | eid, hesin.spell_index | |||
| visit_detail_id | eid, ins_index | |||
| source_value | oper4 | add dots when necessary | OPCS4 codes are provided without dots | |
| source_concept_id | oper4 | |||
| type_concept_id | 32829 - EHR administration record | |||
| modifier_source_value | level | |||
| start_date | opdate, hesin.epistart | use the first not null of (opdate,hesin.epistart) | ||
| start_datetime | opdate, hesin.epistart | |||
| end_date | opdate, hesin.epistart | use the first not null of (opdate,hesin.epistart) | ||
| end_datetime | opdate, hesin.epistart | |||
| concept_id | oper4 | use OPSC4 vocabulary | ||
| stem_source_table | hesin_oper |