suzytamang / clever-rockies

clinical event recognizer for TIU
3 stars 1 forks source link

Review of src\step4\cleverRules.py show potential field misalignment #35

Open dax-westerman opened 3 months ago

dax-westerman commented 3 months ago
          In reviewing the file output in **src\step4\cleverRules.py**, I am seeing a misalignment between the header fields

Example of header creation

print(
    "label|snippetID|term|sta3n|TIUdocumentSID|TIUstandardTitle|visitSID|referenceDateTime|PatientSID|targetClass|targetSubClass|termID|NoteAndSnipOffset|snippet|OpCode",
    file=fout_pos,
)

Example of output generation

sum_out = (
            label[0]
            + "|"
            + cid
            + "|"
            + longseq
            + "|"
            ....
            + "|"
            + snippet
            + "|"
            + upcode
        )

It looks like fields might be misaligned.

position 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Header Row label snippetID term sta3n TIUdocumentSID TIUstandardTitle visitSID referenceDateTime PatientSID targetClass targetSubClass termID NoteAndSnipOffset snippet OpCode
Fields built for "sum_out" label[0] cid longseq tterm pid nid ntype time year tclass tsclass noffset termid snippet upcode

Originally posted by @dax-westerman in https://github.com/suzytamang/clever-rockies/issues/26#issuecomment-2253472656