Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buid erros #10

Open
bobred opened this issue May 25, 2023 · 3 comments
Open

Buid erros #10

bobred opened this issue May 25, 2023 · 3 comments

Comments

@bobred
Copy link

bobred commented May 25, 2023

Hi
When trying to build I am getting the following errors in EsappiService.cs,

Error CS1061 'Structure' does not contain a definition for 'StructureCode' and no accessible extension method 'StructureCode' accepting a first argument of type 'Structure' could be found (are you missing a using directive or an assembly reference?) PlanCheck ...\PlanCheck-master\PlanCheck-master\PlanCheck.Script\Esapi\EsapiService.cs 114 Active

I am using v15.6 and have checked that I have v2 of EsapiEssentials, any ideas?
Thanks
James

@mattcschmidt
Copy link
Contributor

Hi bobred,
I would change the following lines (112 - 146) from

foreach (Structure structure in structureSet.Structures)
               {
                   if (structure.StructureCode != null)
                   {
                       if (structure.StructureCode.Code.ToUpper().Contains("BODY"))
                       {
                           body = structure;
                           break;
                       }                                                      
                   }
               }

               if (body == null)
               {
                   foreach (Structure structure in structureSet.Structures)
                   {
                       if (structure.DicomType.ToUpper().Contains("EXTERNAL"))
                       {
                           body = structure;
                           break;
                       }                               
                   }
               }

               foreach (Structure structure in structureSet.Structures)
               {
                   if (structure.StructureCode != null)
                   {
                       if (structure.StructureCode.Code.ToUpper().Contains("SUPPORT"))
                       {
                           couch = structure;
                           break;
                       }                       
                   }
               }

to

 foreach (Structure structure in structureSet.Structures)
                {
                    **if (structure.StructureCodeInfos.Any()l)**
                    {
                        **if (structure.StructureCodeInfos.First().StructureCode.Code.ToUpper().Contains("BODY"))**
                        {
                            body = structure;
                            break;
                        }                                                      
                    }
                }

                if (body == null)
                {
                    foreach (Structure structure in structureSet.Structures)
                    {
                        if (structure.DicomType.ToUpper().Contains("EXTERNAL"))
                        {
                            body = structure;
                            break;
                        }                               
                    }
                }

                foreach (Structure structure in structureSet.Structures)
                {
                    **if (structure.StructureCodeInfos.Any())**
                    {
                        **if (structure.StructureCodeInfos.First().StructureCode.Code.ToUpper().Contains("SUPPORT"))**
                        {
                            couch = structure;
                            break;
                        }                       
                    }
                }

I've bolded the lines I changed to make it easier to see (only 4 of them). Github is only showing them with "**" around them because its formatted inside of the code block. Please just reply back if this doesn't work.

@mattcschmidt
Copy link
Contributor

PS. PLease don't put the "**" that was just for me to show you the lines I changed.

@bobred
Copy link
Author

bobred commented May 31, 2023

Hi, that works, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants