Need help: Check codes truncated
Dear colleagues,
I would apprciate your help in solving check codes truncation proble. I am currently creating one database using epidata. I have one of the check codes of about 600 charecters long(example below), however after applying chk codes, it is automatically truncated to 207 charecters when I open to see next time. Any clues or ways to code alternatively?
*check code:*
IF (Sex=2) AND (Msex=0) OR (Msex=9) OR (Msex=99) AND (Fsex=0) OR(Fsex=9) (Fsex=99) AND (IDU=0) OR (IDU=9) OR (IDU=99) AND (CFac=0) OR (CFac=9) OR (CFac=99) AND(Trans=0) OR (Trans=9) OR (Trans=99) OR (coag=0) OR (coag=9) OR (coag=99) OR(HetSexEND=0) OR (HetSexEND=9) OR (HetSexEND=99) OR (ConSusHIV=0) OR (ConSusHIV=9) OR(ConSusHIV=99) AND (OccuExp=0) OR (OccuExp=9) OR (OccuExp=99) AND (OthMedExp=1) OR(OthMedExp=0) OR (OthMedExp=9) OR (OthMedExp=99) AND (NMNOcc=1) OR (NMNOcc=0) OR(NMNOcc=9) OR (NMNOcc=99) *THEN*
* **Risk="OtherMedExp-10"*
Thank you.
Bijay Adhikari, PhD CD Epiodemiologist Saskatchewean Ministry of Health
You will need to split this up into nested IF blocks. As well, you really should have parentheses to group the conditions between ANDs, to be sure the logic is what you want. You cannot be sure what order the AND and OR operators are applied.
For example, you might try something like this.
if (sex=2 and (msex=0 or msex=9 or msex=99) and (fsex=0 or fsex=9 or fsex=99) then if (idu=0 or idu=9 or idu=99) and (cfac=0 or cfac=9 or cfac=99) then if ... then risk="OtherMedExp-10" endif endif endif
I would put all of the related fields/values in one if. I don't know whether there is a limit to the number of nested IF blocks, but you probably won't have a problem. This works as long as logically you want AND between the IF blocks. I think that is the case here.
Jamie
On 2011-07-11, Bijay wrote:
IF (Sex=2) AND (Msex=0) OR (Msex=9) OR (Msex=99) AND (Fsex=0) OR(Fsex=9) (Fsex=99) AND (IDU=0) OR (IDU=9) OR (IDU=99) AND (CFac=0) OR (CFac=9) OR (CFac=99) AND(Trans=0) OR (Trans=9) OR (Trans=99) OR (coag=0) OR (coag=9) OR (coag=99) OR(HetSexEND=0) OR (HetSexEND=9) OR (HetSexEND=99) OR (ConSusHIV=0) OR (ConSusHIV=9) OR(ConSusHIV=99) AND (OccuExp=0) OR (OccuExp=9) OR (OccuExp=99) AND (OthMedExp=1) OR(OthMedExp=0) OR (OthMedExp=9) OR (OthMedExp=99) AND (NMNOcc=1) OR (NMNOcc=0) OR(NMNOcc=9) OR (NMNOcc=99) *THEN*
* **Risk="OtherMedExp-10"*
The other problem which could influence this is that the built in visual adopt and edit chk files (epidata entry 3.1) is not fully compatible with the possibilities if you open the chk file to edit directly.
Another known problem is the way "backup" command is handled by the visual chk file editor (add/revise button),.
Just avoid using the visual "add/revise" part and edit directly in the editor.
regards Jens Lauritsen EpiData Association
On 2011-07-11 19:40, epidata-list@lists.umanitoba.ca wrote:
You will need to split this up into nested IF blocks. As well, you really should have parentheses to group the conditions between ANDs, to be sure the logic is what you want. You cannot be sure what order the AND and OR operators are applied.
For example, you might try something like this.
if (sex=2 and (msex=0 or msex=9 or msex=99) and (fsex=0 or fsex=9 or fsex=99) then if (idu=0 or idu=9 or idu=99) and (cfac=0 or cfac=9 or cfac=99) then if ... then risk="OtherMedExp-10" endif endif endif
I would put all of the related fields/values in one if. I don't know whether there is a limit to the number of nested IF blocks, but you probably won't have a problem. This works as long as logically you want AND between the IF blocks. I think that is the case here.
Jamie
On 2011-07-11, Bijay wrote:
IF (Sex=2) AND (Msex=0) OR (Msex=9) OR (Msex=99) AND (Fsex=0)
OR(Fsex=9) (Fsex=99) AND (IDU=0) OR (IDU=9) OR (IDU=99) AND (CFac=0) OR (CFac=9) OR (CFac=99) AND(Trans=0) OR (Trans=9) OR (Trans=99) OR (coag=0) OR (coag=9) OR (coag=99) OR(HetSexEND=0) OR (HetSexEND=9) OR (HetSexEND=99) OR (ConSusHIV=0) OR (ConSusHIV=9) OR(ConSusHIV=99) AND (OccuExp=0) OR (OccuExp=9) OR (OccuExp=99) AND (OthMedExp=1) OR(OthMedExp=0) OR (OthMedExp=9) OR (OthMedExp=99) AND (NMNOcc=1) OR (NMNOcc=0) OR(NMNOcc=9) OR (NMNOcc=99) *THEN*
* **Risk="OtherMedExp-10"*
EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
participants (1)
-
epidata-list@lists.umanitoba.ca