Hi Everyone,
I am wanting to create a variable that tells me whether the patient has an ICD10 starting with E11. I am not interested in the numbers after the dots, nor am I interested in any of the other ICD10 codes and I am wanting to drop patients who do not have E11 in one of the ICD10 columns. I have tried playing with foreach, but this side of things is new for me and I just keep getting messages telling me the syntax is incorrect. I would greatly appreciate any hints someone could give me, thank you in advance.
+----------------------------------+
| id icd10_1 icd10_2 icd10_3 |
|----------------------------------|
1. | 1 K61.3 Z86.43 F05.9 |
2. | 2 B95.8 Z06.2 Z86.43 |
3. | 3 E11.69 R40.2 E11.9 |
4. | 4 Z86.43 Z95.8 E87.6 |
5. | 5 K59.0 K59.0 Z93.1 |
|----------------------------------|
6. | 6 E11.65 E11.66 R63.4 |
7. | 7 E11.22 E66.9 E11.23 |
8. | 8 E11.9 E78.0 K63.50 |
9. | 9 E78.0 E11.65 D50.9 |
10. | 10 E11.65 K59.0 Z93.0 |
+----------------------------------+
Cheers,
Bellinda
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/