Hi Scott &/or Dan,
Below is a complex snippet regarding Family History of Colon Cancer - to be used in a questionnaire.
If there is no known Family History of Colon Cancer -> simple single output of "nil known"
If there is a known Family History of Colon Cancer then the affected members need to identified and categorised. There May be only ONE family member or more (2, 3, 4) - rarely is there more than 4. The above example/snippet can only identify & categorise 3. Too hard and complex for me to build it up to 4 - but preferred if possible?
Once the number of family members is determined (usually it unfolds during questioning of patient), the affected member needs to identified as first degree relative (FDR) or second degree relative (SDR).
If FDR then identified as Father; Mother; Older Brother; Younger Brother; Older Sister; Younger Sister.
If SDR then identified as Grandparent; Maternal Grandfather; Paternal Grandfather; Maternal Grandmother; Paternal Grandmother; Maternal Aunt; Paternal Aunt; Maternal Uncle; Paternal Uncle; Maternal Cousin; Paternal Cousin; Maternal Nephew; Paternal Nephew; Maternal Niece; Paternal Niece
Once the family member is identified, then the age group at the time of diagnosis of the colon cancer - either ≤ 55 years of age at diagnosis or > 55 years of age at diagnosis.
Once an age group is identified then the exact age at diagnosis needs to inputted.
Many times the last 2 input are not known and left out.
If a second family member is affected, all the above happens again and so on for a 3rd affected family member; otherwise remains clear.
The snippet works well apart from the fact that after choosing FDR vs SDR and then identifying the type of family member (eg Father, etc) you cannot change these variables as errors appear in the form of "extra" age inputs - which is confusing and the final output is unusable.
How can I avoid errors using a complex snippet when I need to re-run the snippet because I want to change an initial variable?