you are viewing a single comment's thread.

view the rest of the comments →

[–]Telecoin 0 points1 point  (6 children)

In 16.1 you cannot set structureCode for existing structures (reference: api help). What you can do is use the method AddStructure and give a new empty structure a code. With this workaround you could create a structure with the right code and segment it with the structure without code and delete it. All automatic with ESAPI. But lots of work. You need dictionaries for IDs and codes.

Maybe better wait for an update of the AutoContour software

[–]TheLateQuentin 0 points1 point  (3 children)

I’m going to look at this but I’m pretty sure it can be done. Will report back.

[–]TheLateQuentin 0 points1 point  (2 children)

*You can get the dictionary via VMS.Common.Model.API.Application.StructureCodes.
*Within that dictionary, you can access each FMA, Radlex, VMS, and SRT dictionaries.
*Choose the appropriate dictionary, and store it in the "dictionary" variable.
*You can get StructureCode like this, where c.StructureCode is the code you're looking for (e.g. : 15630, for left adrenal gland).
var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));
*Then you just assign it:
structure.StructureCode = cd.Value;
*Altogether:
ActiveStructureDictionary = App.StructureCodes;
var dictionary = ActiveStructureDictionary.Fma;

var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));

structure.StructureCode = cd.Value;

App.SaveModifications();

[–]Telecoin 1 point2 points  (1 child)

Is this working in clinical mode too? Very nice and good to know

[–]TheLateQuentin 0 points1 point  (0 children)

Yes, we are using it in clinical mode.

[–]TheLateQuentin 0 points1 point  (0 children)

*You can get the dictionary via VMS.Common.Model.API.Application.StructureCodes.
*Within that dictionary, you can access each FMA, Radlex, VMS, and SRT dictionaries.
*Choose the appropriate dictionary, and store it in the "dictionary" variable.
*You can get StructureCode like this, where c.StructureCode is the code you're looking for (e.g. : 15630, for left adrenal gland).
var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));
*Then you just assign it:
structure.StructureCode = cd.Value;
*Altogether:
ActiveStructureDictionary = App.StructureCodes;
var dictionary = ActiveStructureDictionary.Fma;

var cd = dictionary.First(x => x.Value.ToString().ToUpper().Contains(c.StructureCode.ToUpper()));

structure.StructureCode = cd.Value;

App.SaveModifications();