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)
New package -checkipaddresses- on SSC : identify IP addresses behind VPN/VPSThanks to Kit Baum, my checkipaddresses is available from SSC. checkipaddresses queries an IP addre…
Total over values of a row up to a certain value (long format)Hi there, I have panel data set in long format with company data containing funding data over 72 pe…
2SLS estimationHello, I would like to estimate the following 2SLS panel regression: First stage: Zit = α Wit*Fit +…
Merging two data sets: weighting help?Hi All, I am working to merge two separate data sets, each with their own sampling method and weight…
output coeffs and CI from looped cox regressionHi there, I need to run a cox regression over 21 pollutants (many times) and I want to then output H…
Subscribe to:
Post Comments (Atom)
0 Response to Calculate days from hospital admission to a procedure using National Inpatient Sample (NIS)
Post a Comment