c# - Mapping Tables Sorting Conflicts -



c# - Mapping Tables Sorting Conflicts -

i have 2 tables, 1 user select , other 1 system. scheme table mapped user input table.

orderables table:

+-----+-------------------------------+ | key | orderable | +-----+-------------------------------+ | 88 | xray spine cervical | | 91 | xray spine lumbar | | 95 | xray spine thoracic | +-----+-------------------------------+

karisma(system) table:

+---------------------------+-------------+---------------+ | karismaname | karismacode | orderablekeys | +---------------------------+-------------+---------------+ | spine cervical | 310xr | 88 | | spine cervical + lumbar | 302xr | 88|91 | | spine cervical + thoracic | 301xr | 88|95 | | spine lumbosacral | 330xr | 91 | | spine thoracic | 320xr | 95 | | spine thoracic + lumbar | 303xr | 95|91 | +---------------------------+-------------+---------------+

i have these classes:

public class orderable { public int key { set; get; } public string name { set; get; } public string modality { set; get; } public orderable() { key = 0; name = string.empty; } } public class exam { public string karismaname { set; get; } public string karismacode { set; get; } public string orderablekeys { set; get; } public int key { set; get; } public list<orderable> orderables { set; get; } public exam() { karismacode = string.empty; karismaname = string.empty; key = 0; orderables = new list<orderable>(); orderablekeys = string.empty; } } public class conflictexams { public list<exam> examlist { set; get; } public list<int> orderableslist { set; get; } } public class conflictoptions { public list<options> optionslist { set; get; } } public class options { public list<exam> examslist {set; get;} }

this code conflicting exams, i.e. orderables appear in more 1 combination exams:

list<conflictexams> conflictlist = new list<conflictexams>(); foreach (var in duplicatekeys) { list<exam> examslist = new list<exam>(); list<int> orderablelist = new list<int>(); foreach (var ex in comboexamslist) { var split = ex.orderablekeys.split('|'); foreach (var s in split) { if(int.parse(s) == i) { examslist.add(ex); orderablelist.add(i); } } } conflictexams ce = new conflictexams(); ce.examlist = examslist; ce.orderableslist = orderablelist; conflictlist.add(ce); }

the results of code conflictlist =

conflictlist[0].examlist[0] = spine cervical + lumbar conflictlist[0].examlist[1] = spine cervical + thoracic conflictlist[1].examlist[0] = spine cervical + lumbar conflictlist[1].examlist[1] = spine thoracic + lumbar conflictlist[2].examlist[0] = spine cervical + thoracic conflictlist[2].examlist[1] = spine thoracic + lumbar

i don't know how there list of options user chooses want select, ultimate goal:

conflictoptionslist[0].options[0].examslist[0] = spine cervical + lumbar conflictoptionslist[0].options[0].examslist[1] = spine thoracic conflictoptionslist[0].options[1].examslist[0] = spine cervical + thoracic conflictoptionslist[0].options[1].examslist[1] = spine lumbar conflictoptionslist[0].options[2].examslist[0] = spine thoracic + lumbar conflictoptionslist[0].options[2].examslist[1] = spine cervical

i hope makes lot more sense , give thanks looking , comments.

c#

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -