thin is a longitudinal primary care medical records database of over 9 million patients in total , which currently covers around 6% of u.k . thin database contains individual patient information recorded by pcps as part of their routine clinical care such as demographic factors , pcp consultations , referrals , hospitalizations , laboratory test results , and prescriptions written by pcps . letters from specialist visits and hospital admissions ( i.e. , discharge letters ) are also available . prescriptions written by pcps are generated and recorded automatically in the database using a coded drug dictionary ( multilex ) . several validation studies have been conducted in thin database reporting high confirmation rates of recorded diagnoses and completeness of data ( 1316 ) . this primary care database has already been used for studies of diabetes ( 1719 ) . the study research protocol was approved by the uk research ethics committee ( 09/h0305/64 ) . the source population was made up of all individuals aged 184 years between january 2000 and december 2007 who were enrolled at least 2 years with a pcp , with 1 year or more elapsed since the first recorded prescription and with some recorded health care contact in the previous 2 years . only individuals with an enrollment status of  permanent  ( currently enrolled with the pcp ) or start date was the date when an individual met all above eligibility criteria . to select the study population of diabetic patients , all members from the source population were followed from start date until the earliest occurrence of first record of diabetes or antidiabetic treatment , death , or 31 december 2007 . we then excluded all women with gestational diabetes ( because of the specific idiosyncrasy of this diabetes ) , patients with type 1 diabetes without antidiabetic treatment ( considered as possibly misclassified ) , and individuals with a first - ever diagnosis of diabetes within 30 days of death and no treatment ever recorded ( considered as having incomplete information ) . finally , we excluded all those with any diagnosis code for retinopathy or maculopathy recorded until the first diagnosis of diabetes resulting in a final study cohort of 121,834 diabetic patients ( 55% of them were men ) . distribution of this cohort by sex , age , and diabetes type is shown in table 1 . diabetes cohort distribution by sex , age , and diabetes type we followed our study population of diabetic patients from the date of first record of diabetes or antidiabetic treatment in the study period until first recording of dr or dmp including dmo . two separate follow - ups were performed : 1 ) until the earliest occurrence of one of the following end points : dr , 85 years of age , death , or 31 december 2008 ; 2 ) until the earliest occurrence of one of the following end points : dmp , 85 years of age , death , or 31 december 2008 . for dr , we identified patients with a recorded code suggesting an incident diagnosis of retinopathy related to diabetes ( table 2 ) . diagnoses related to age - related macular degeneration or to any other cause of retinopathy not related to diabetes were excluded . read codes used to identify dr and dmp nos , not otherwise specified ; o / e , on examination . for , dmp and dmo , we identified patients with a recorded code suggesting any incident diagnosis of maculopathy related to diabetes including macular edema , exudative maculopathy , or any other nonspecific maculopathy code ( table 2 ) . a two - step validation strategy was used for both outcomes : dr and dmp ( including dmo ) . we identified 20,838 dr patients ( 49.5% had only background / nonproliferative dr codes within the first month , 2.3% had a proliferative dr code , and 48.2% had only unspecific dr codes ) and 4,064 dmp patients , based on automated diagnosis codes . we then requested from thin all anonymized free - text comments recorded by the pcps between 1 month before and 2 months after the recorded diagnosis for a random sample of 500 ( 2.4% ) of dr patients ( automated random numbers were generated to obtain the sample ) and for all dmp patients . in the free - text entries , pcps can provide additional information derived from referral letters , diagnostic procedures , and test results such as visual acuity , intraocular pressure , and fundoscopy , among others . we performed a manual review of computer profiles of patients with dr and assigned the event as probable , possible , doubtful , and non - dr case . we defined probable dr case subjects as patients with an objective diagnosis of retinopathy related to diabetes describing the grade of retinopathy or site affected . possible dr case subjects were all patients with a specific diagnosis but no mention of grade of retinopathy or site affected . doubtful dr case subjects were patients with only screening appointments or conflicting entries between procedure results and recorded diagnosis . non - dr case subjects were patients where the diagnosis was explicitly excluded or the date of first dr diagnosis occurred before the date of diabetes ascertained in the study period . similarly , we reviewed the computerized profiles of patients with dmp and assigned the event as probable , possible , and non - dmp case . we defined probable dmp case subjects as patients with a diagnosis of maculopathy related to diabetes and recording of the type of maculopathy or site affected . when the diagnosis was not specifically mentioned in the read code or confirmed in free text , we categorized them as possible dmp . noncase subjects were patients with an unspecific code and/or confirmation of the absence of maculopathy . we defined the subgroup of probable dmo case subjects as patients with a read code mentioning macular edema or an indication in the free - text comments of the site , the grade of edema , or retinal thickening . then , in a second step , a questionnaire was sent to the pcps of 200 patients randomly sampled from the subgroup of the 500 dr patients whose computer profiles were manually reviewed and to the pcps of a random sample of 200 patients of the 4,064 manually reviewed dmp patients . pcps were requested to confirm the diagnosis of dr or dmp ( and in particular dmo ) and were also asked to send a copy of all records related to the event of interest , including referral letters , diagnostic procedures , test results such as visual acuity , intraocular pressure , or fundoscopy results . the researchers did not contact the practices directly , but did so via the additional information services ( ais ) , which is part of the thin organization . once contacted and having received the questionnaires , each pcp sent the supplementary information and the response to the questionnaire to ais , and ais ensured that all personal data were removed before forwarding the information to the researchers . after the review of all this supplementary information , a final case status of dr or dmp was assigned for the random sample of dr and all dmp patients . additionally , the percentage of confirmed case subjects in each of the categories defined for dr and dmp ( i.e. , probable , possible , and noncase ) was determined . the date of first diagnosis of dr or dmp also was ascertained based on all information available , including that provided by the pcps in their responses to questionnaires and copies of ophthalmology records provided . the confirmation rate of dr and dmp assigned in our first step ( review of computerized patient profiles including free - text comments ) was computed using as numerator the number of final confirmed case subjects based on all information provided by the pcps ( gold standard ) and as denominator the total number of patients considered case subjects after manual review of patient profiles . thin is a longitudinal primary care medical records database of over 9 million patients in total , which currently covers around 6% of u.k . thin database contains individual patient information recorded by pcps as part of their routine clinical care such as demographic factors , pcp consultations , referrals , hospitalizations , laboratory test results , and prescriptions written by pcps . letters from specialist visits and hospital admissions ( i.e. , discharge letters ) are also available . prescriptions written by pcps are generated and recorded automatically in the database using a coded drug dictionary ( multilex ) . several validation studies have been conducted in thin database reporting high confirmation rates of recorded diagnoses and completeness of data ( 1316 ) . this primary care database has already been used for studies of diabetes ( 1719 ) . the study research protocol was approved by the uk research ethics committee ( 09/h0305/64 ) . the source population was made up of all individuals aged 184 years between january 2000 and december 2007 who were enrolled at least 2 years with a pcp , with 1 year or more elapsed since the first recorded prescription and with some recorded health care contact in the previous 2 years . only individuals with an enrollment status of  permanent  ( currently enrolled with the pcp ) or start date was the date when an individual met all above eligibility criteria . to select the study population of diabetic patients , all members from the source population were followed from start date until the earliest occurrence of first record of diabetes or antidiabetic treatment , death , or 31 december 2007 . we then excluded all women with gestational diabetes ( because of the specific idiosyncrasy of this diabetes ) , patients with type 1 diabetes without antidiabetic treatment ( considered as possibly misclassified ) , and individuals with a first - ever diagnosis of diabetes within 30 days of death and no treatment ever recorded ( considered as having incomplete information ) . finally , we excluded all those with any diagnosis code for retinopathy or maculopathy recorded until the first diagnosis of diabetes resulting in a final study cohort of 121,834 diabetic patients ( 55% of them were men ) . distribution of this cohort by sex , age , and diabetes type is shown in table 1 . we followed our study population of diabetic patients from the date of first record of diabetes or antidiabetic treatment in the study period until first recording of dr or dmp including dmo . two separate follow - ups were performed : 1 ) until the earliest occurrence of one of the following end points : dr , 85 years of age , death , or 31 december 2008 ; 2 ) until the earliest occurrence of one of the following end points : dmp , 85 years of age , death , or 31 december 2008 . for dr , we identified patients with a recorded code suggesting an incident diagnosis of retinopathy related to diabetes ( table 2 ) . diagnoses related to age - related macular degeneration or to any other cause of retinopathy not related to diabetes were excluded . read codes used to identify dr and dmp nos , not otherwise specified ; o / e , on examination . for , dmp and dmo , we identified patients with a recorded code suggesting any incident diagnosis of maculopathy related to diabetes including macular edema , exudative maculopathy , or any other nonspecific maculopathy code ( table 2 ) . a two - step validation strategy was used for both outcomes : dr and dmp ( including dmo ) . we identified 20,838 dr patients ( 49.5% had only background / nonproliferative dr codes within the first month , 2.3% had a proliferative dr code , and 48.2% had only unspecific dr codes ) and 4,064 dmp patients , based on automated diagnosis codes . we then requested from thin all anonymized free - text comments recorded by the pcps between 1 month before and 2 months after the recorded diagnosis for a random sample of 500 ( 2.4% ) of dr patients ( automated random numbers were generated to obtain the sample ) and for all dmp patients . in the free - text entries , pcps can provide additional information derived from referral letters , diagnostic procedures , and test results such as visual acuity , intraocular pressure , and fundoscopy , among others . we performed a manual review of computer profiles of patients with dr and assigned the event as probable , possible , doubtful , and non - dr case . we defined probable dr case subjects as patients with an objective diagnosis of retinopathy related to diabetes describing the grade of retinopathy or site affected . possible dr case subjects were all patients with a specific diagnosis but no mention of grade of retinopathy or site affected . doubtful dr case subjects were patients with only screening appointments or conflicting entries between procedure results and recorded diagnosis . non - dr case subjects were patients where the diagnosis was explicitly excluded or the date of first dr diagnosis occurred before the date of diabetes ascertained in the study period . similarly , we reviewed the computerized profiles of patients with dmp and assigned the event as probable , possible , and non - dmp case . we defined probable dmp case subjects as patients with a diagnosis of maculopathy related to diabetes and recording of the type of maculopathy or site affected . when the diagnosis was not specifically mentioned in the read code or confirmed in free text , we categorized them as possible dmp . noncase subjects were patients with an unspecific code and/or confirmation of the absence of maculopathy . we defined the subgroup of probable dmo case subjects as patients with a read code mentioning macular edema or an indication in the free - text comments of the site , the grade of edema , or retinal thickening . then , in a second step , a questionnaire was sent to the pcps of 200 patients randomly sampled from the subgroup of the 500 dr patients whose computer profiles were manually reviewed and to the pcps of a random sample of 200 patients of the 4,064 manually reviewed dmp patients . pcps were requested to confirm the diagnosis of dr or dmp ( and in particular dmo ) and were also asked to send a copy of all records related to the event of interest , including referral letters , diagnostic procedures , test results such as visual acuity , intraocular pressure , or fundoscopy results . the researchers did not contact the practices directly , but did so via the additional information services ( ais ) , which is part of the thin organization . once contacted and having received the questionnaires , each pcp sent the supplementary information and the response to the questionnaire to ais , and ais ensured that all personal data were removed before forwarding the information to the researchers . after the review of all this supplementary information , a final case status of dr or dmp was assigned for the random sample of dr and all dmp patients . additionally , the percentage of confirmed case subjects in each of the categories defined for dr and dmp ( i.e. , probable , possible , and noncase ) was determined . the date of first diagnosis of dr or dmp also was ascertained based on all information available , including that provided by the pcps in their responses to questionnaires and copies of ophthalmology records provided . the confirmation rate of dr and dmp assigned in our first step ( review of computerized patient profiles including free - text comments ) was computed using as numerator the number of final confirmed case subjects based on all information provided by the pcps ( gold standard ) and as denominator the total number of patients considered case subjects after manual review of patient profiles . five hundred dr computerized patient profiles with free - text comments were manually reviewed by one of the authors . we categorized 331 ( 66.2% ) as  probable dr  and 87 ( 17.4% ) as  possible dr .  in addition , 2.8% ( n = 14 ) were categorized as doubtful case subjects  and 13.6% ( n = 68 ) as  noncase subjects . figure 1 shows the results of the review process and resulting categorization of the sample of dr patients reviewed . in the second step , we received 176 valid questionnaires of the 200 requested ( pcp response rate was 88% ) : a majority of them ( 71.5% ) included copies of anonymized records related to the retinopathy . among these , 150 had been classified as probable or possible dr case subjects in the first step and 131 of them were finally assigned a diagnosis of dr based on the questionnaires and additional information received ( confirmation rate of 87.3% ) . among the 131 confirmed dr , 73.3% were background / nonproliferative dr , 2.3% were proliferative dr , and 24.4% had no specification on dr grading . we also received questionnaires for 26 diabetic patients who were originally classified as doubtful or noncase subjects , and the diagnosis of dr was finally confirmed in 30.8% : 50% of doubtful and 25.0% of noncase subjects , respectively . validation chart of dr detected codes during the years 2000 to 2008 in thin database . the final estimated confirmation rate among all initially computer - detected patients was 78.0% , resulting from the confirmation rate weighted by the corresponding percentage in each category ( 87.3% confirmed dr weighted by 83.6% categorized as probable dr  and  possible dr  plus 30.8% confirmed dr weighted by 16.4% categorized as the confirmation rates for patients with background / nonproliferative dr , proliferative dr , and unspecified retinopathy grade within 1 month were 92.0 , 100 , and 65.1% , respectively . we reviewed all 4,064 computerized patient profiles with free - text comments of patients automatically detected with a code of dmp . of these , 2,460 ( 60.5% ) were categorized as  probable dmp ,  1,216 ( 29.9% ) as  possible dmp ,  and 388 ( 9.5% ) as noncases . similar to the process of validation of dr , 200 patients were randomly selected in a second step , and questionnaires were sent to their pcps . of these , 176 valid questionnaires were returned ( response rate of 88% ) , and 73.2% of them enclosed copies of anonymized records related to the maculopathy . among the valid questionnaires returned , there were 172 who had been considered probable or possible case subjects of dmp after the manual review of patient profiles . in this subgroup , 150 patients were assigned a final diagnosis of dmp based on the questionnaires , resulting in a confirmation rate of 87.2% ( 91.9% among probable dmp and 78.7% among possible dmp , respectively ) . we also received questionnaires for four diabetic patients originally considered as noncase subjects , and all of them were confirmed as noncase subjects . validation chart of dmp ( and edema type ) detected codes during the years 2000 to 2008 in thin database . the final estimated confirmation rate among all computer - detected patients was 78.8% , resulting from the confirmation rate weighted by the corresponding percentage in each category ( 87.2% confirmed dmp weighted by 90.4% of categorized as we also performed the validation of dmo . among the 4,064 maculopathies reviewed in the first step , 17.5% ( n = 711 ) were considered as  probable dmo .  in the second step , 36 patients were randomly sampled and questionnaires were sent to the pcps . of these , 31 valid questionnaires were returned ( 86% ) , and 81% of them enclosed copies of anonymized records related to the maculopathy . computer codes that specifically included the term  oedema  in their literal presented a confirmation rate of 86.2% . there also were 33 patients registered as maculopathies without any other specification of type in their code or in free - text comments who were finally confirmed as macular edema in the second step , representing 54% of all finally confirmed dmo case subjects . five hundred dr computerized patient profiles with free - text comments were manually reviewed by one of the authors . we categorized 331 ( 66.2% ) as  probable dr  and 87 ( 17.4% ) as  possible dr .  in addition , 2.8% ( n = 14 ) were categorized as doubtful case subjects  and 13.6% ( n = 68 ) as  noncase subjects . figure 1 shows the results of the review process and resulting categorization of the sample of dr patients reviewed . in the second step , we received 176 valid questionnaires of the 200 requested ( pcp response rate was 88% ) : a majority of them ( 71.5% ) included copies of anonymized records related to the retinopathy . among these , 150 had been classified as probable or possible dr case subjects in the first step and 131 of them were finally assigned a diagnosis of dr based on the questionnaires and additional information received ( confirmation rate of 87.3% ) . among the 131 confirmed dr , 73.3% were background / nonproliferative dr , 2.3% were proliferative dr , and 24.4% had no specification on dr grading . we also received questionnaires for 26 diabetic patients who were originally classified as doubtful or noncase subjects , and the diagnosis of dr was finally confirmed in 30.8% : 50% of doubtful and 25.0% of noncase subjects , respectively . validation chart of dr detected codes during the years 2000 to 2008 in thin database . the final estimated confirmation rate among all initially computer - detected patients was 78.0% , resulting from the confirmation rate weighted by the corresponding percentage in each category ( 87.3% confirmed dr weighted by 83.6% categorized as probable dr  and  possible dr  plus 30.8% confirmed dr weighted by 16.4% categorized as the confirmation rates for patients with background / nonproliferative dr , proliferative dr , and unspecified retinopathy grade within 1 month were 92.0 , 100 , and 65.1% , respectively . we reviewed all 4,064 computerized patient profiles with free - text comments of patients automatically detected with a code of dmp . of these , 2,460 ( 60.5% ) were categorized as  probable dmp ,  1,216 ( 29.9% ) as  possible dmp ,  and 388 ( 9.5% ) as noncases . similar to the process of validation of dr , 200 patients were randomly selected in a second step , and questionnaires were sent to their pcps . of these , 176 valid questionnaires were returned ( response rate of 88% ) , and 73.2% of them enclosed copies of anonymized records related to the maculopathy . among the valid questionnaires returned , there were 172 who had been considered probable or possible case subjects of dmp after the manual review of patient profiles . in this subgroup , 150 patients were assigned a final diagnosis of dmp based on the questionnaires , resulting in a confirmation rate of 87.2% ( 91.9% among probable dmp and 78.7% among possible dmp , respectively ) . we also received questionnaires for four diabetic patients originally considered as noncase subjects , and all of them were confirmed as noncase subjects . validation chart of dmp ( and edema type ) detected codes during the years 2000 to 2008 in thin database . the final estimated confirmation rate among all computer - detected patients was 78.8% , resulting from the confirmation rate weighted by the corresponding percentage in each category ( 87.2% confirmed dmp weighted by 90.4% of categorized as  probable dmp  or we also performed the validation of dmo . among the 4,064 maculopathies reviewed in the first step , 17.5% ( n = 711 ) in the second step , 36 patients were randomly sampled and questionnaires were sent to the pcps . of these , 31 valid questionnaires were returned ( 86% ) , and 81% of them enclosed copies of anonymized records related to the maculopathy . the pcps confirmed 28 as incident dmo ( 90.3% ) . computer codes that specifically included the term  oedema  in their literal presented a confirmation rate of 86.2% . there also were 33 patients registered as maculopathies without any other specification of type in their code or in free - text comments who were finally confirmed as macular edema in the second step , representing 54% of all finally confirmed dmo case subjects . this is the first study to validate dr and dmp diagnoses in a primary care database . the validation strategy was successful thanks to the high proportion of pcps who returned completed validation questionnaires ( i.e. , 90% ) . furthermore , most pcps provided with the completed questionnaire copies original clinical records that usually included specialist notes after ophthalmologic assessment , which was instrumental for the validation of diagnoses . the validation of a sample of automatically identified dr patients showed that the proposed set of computer codes was moderately accurate ( confirmation rate of 78% ) in predicting the actual diagnosis . however , the confirmation rate ( 87% ) increased after the inclusion of free - text comments from the pcp in the computerized patients profiles . the selected set of computer codes predicted the diagnosis with moderate accuracy ( confirmation rate of 79% ) , and this increased to 87% when reviewing the patients profiles after incorporating free - text comments . we showed that specific codes of dmo have a high confirmation rate ( 86% ) . however , a high proportion of true dmo case subjects would not be identified based on the computer codes alone or with the addition of free - text comments ( 54% ) . to ascertain  all  dmo case subjects , additional information from the pcps prior studies conducted using claims data have also assessed recorded diagnosis of diabetic eye complications . one study reported good agreement between incidences of dr estimated using claims data versus population - based studies ( 20 ) , and another one assessed the validity of the diagnoses of dmo and found high sensitivity ( 88% ) and specificity ( 96% ) ( 20,21 ) . nevertheless , our study is the first one to test the validity of registration of ophthalmological complications of diabetes in a primary care database . similar to what has been observed in a previous study with thin database , the validity of the studied outcome increased with the addition of free - text comments to computerized patient profiles ( 15 ) . first , we relied on the existing coding system ( i.e. , read ) in thin . yet , the read dictionary in some instances may not be specific enough to enable the recording of the outcomes of interest , such as the severity scale for retinopathy or the type of maculopathy . however , there were specific codes of dr , dmp , and dmo that pcps could enter to record the specific grade of diagnosis without having to resort to more unspecific ones ( shown in table 2 ) . some diabetic patients also could consult optician practices without having to first go through their pcp , and consequently pcps would not have recorded the relevant information systematically . however , this potential limitation should have had a limited impact in our study because ophthalmologic screening care is offered to all u.k . diabetic patients since it was shown to be more cost - effective to detect cases of sight threatening dr than incidental screening ( 7 ) . all diabetic patients are invited for diabetic eye complication screening , a national screening program . pcps participating in thin database also are encouraged to record results from screening programs as well as information resulting from ophthalmologist referrals , as part of diabetic quality outcomes framework . according to a recent study , around 3% of all patients screened for dr in the national diabetic retinopathy screening committee require referral to ophthalmology department because of positive results and 79% of them are referred for maculopathy ( 22 ) . it is our opinion that this system guarantees that thin database is a rich data source for studies on ophthalmological diseases in patients with diabetes . for feasibility and practical reasons we were not able to validate all dr potential case subjects ( however , it appears sensible to infer the results from our manual review of a random sample to the whole dr computer - detected population . as shown by the current study , recording of read codes for dr , dm , and dmo the validity of these conditions improved with the incorporation of free - text comments to the patient s computerized profile when contrasted with additional information directly provided by the pcp . thin database has proved to be a valuable resource to perform studies of ophthalmological diabetes complications in the general population when supplemented with information present in free - text notes .