Hi all,
My goal is to calculate time (days) from admission to the time a patient first received a surgical procedure, specifically, days from admission to the first "skin graft" performed for those who received this surgery. It seems straightforward, but allow me to explain this question which is actually a bit complicated.
In the NIS database, there are 25 procedure variables (PR1, PR2,..., PR25) for procedure coding (using ICD-10). And for each procedure variable, there is a corresponding variable indicating the days from admission to the time that procedure is performed (PRDAY1, PRDAY2,...,PRDAY25).
There are actually multiple ICD-10 codes for "skin graft". For example, "0HR0X73", "0HR1X73",...,"0HR7X73", and "0HR8X73" all mean "skin grafts", and they could be coded in any of the 25 procedure variables (PR1 - PR25).
We can imagine a scenario where a patient was coded "0HR0X73" in PR1 variable with "3" in the corresponding PRDAY1 variable and also coded "0HR1X73" in PR2 variable with "5" in the corresponding PRDAY2 variable. It means that this patient received a skin graft surgery on day 3 after admission and another skin graft surgery on day 5. Since my goal is to capture the time the first skin graft was performed, I would like to generate 2 variables, with one indicating that the patient received this procedure and the other one indicating it's day 3.
I am able to generate a variable indicating whether a patient received this procedure using the following codes, but I couldn't figure out a way to generate a variable indicating the time it's first performed.
gen Skingraft=0
forvalues j=1/25{
replace Skingraft=1 if inlist(PR`j', 0HR0X73", "0HR1X73",...,"0HR7X73", "0HR8X73" )
}
Thank in advance!
Related Posts with Calculate days from hospital admission to a procedure using National Inpatient Sample (NIS)
DataexPlease house, I need a users' guide on dataex, I am using stata 16 SE on window 7. Thanks for your a…
ppml_panel_sg estimator: fixed effectsHi, I am using the ppml_panel_sg estimator for a gravity model with fixed effects (exporter-time, i…
How to recover stored results from e() class?Hello, I am working on mwitch command of Stata. I work in Stata 15. I ran the following: . mswitch …
How to create a simple table with my own specifications?Hi, I want to create my own table with column names and observations in stata. I have been searchin…
Overlay graphs in Panel data without -collapse- or creating by group averagesHi, If we collapse data, we essentially create new data set containing averaged values. By creating…
Subscribe to:
Post Comments (Atom)
0 Response to Calculate days from hospital admission to a procedure using National Inpatient Sample (NIS)
Post a Comment