Hello,

I just want to check I have got some code right that I had been having some problems with

I am using the Feudtner Chronic complex stata code (https://feudtnerlab.research.chop.edu/ccc_version_2.php)

Part of the temaplate code is: (see below for instructions)
forvalues i=1/`n_dxs' {
replace dx_count = dx_count + 1 if `dx'`i'!=""
}

I have 30 diagnosis variables (dx1-30)

I think the correct code for my data is -

forvalues i=1/30 {
replace dx_count = dx_count + 1 if dx`i'!=""
}

as it doesn't work if I leave `dx' in the second line. Is this correct?

Does that look right? Really grateful for any help with this!

Thanks
Hannah

/*
Program call statement: |
| ccc dt_out dx n_dxs pc n_pcs icdv |
| |
| NOTE: The variables containing the ICD codes MUST follow the naming |
| convention of a prefix followed by sequential numbers, i.e. dx1, dx2, dx3 |
| |
| Parameter definitions: |
| |
| dt_out: File name for output data; will be annoted with "_ccc" |
| |
| dx: ICD-9-CM or ICD-10 variable prefix name following naming |
| convention prefix# (i.e. dx1, dx2, ...) |
| |
| n_dxs: Number of ICD-9-CM or ICD-10 variables in data set |
| |
| pc: ICD-9-CM procedure or ICD-10 procedure variable prefix name |
| following naming convention prefix# (i.e. pc1, pc2, ...) |
| |
| n_pcs: Number of ICD-9-CM or ICD-10 procedure variables in data set |
| |
| icdv: ICD revision 9 or 10 |
| |
|************************************************* ****************************|
| Examples: |
| |
| 1. Apply CCC v2 to array of ICD-9-CM diagnostic and procedural codes |
| named dx1-dx5 and px1-px3: |
| |
| ccc output_file_name dx 5 px 3 9 |
| |
| 2. Apply CCC v2 to array of ICD-10 diagnostic and procedural codes |
| named diag1-diag10 and proc1-proc7: |
| |
| ccc output_file_name diag 10 proc 7 10 |
*/