Henry Pereira · Jun 27, 2018 go to post

"So then if I store the Injection element_key (in the case of an array), as a property in the ImageFile object which references the injection, I will be able to get to the various Injection properties from the ImageFile instance? "
Sure, just to pay attention to manage the array key, that will be like your ID

"What would I store in the ImageFile in the case of a list? "

You can use list like a collection, could be of %SerialObjects or other types like %Strings, in the table will be save like $Piece in the column

Henry Pereira · Jun 27, 2018 go to post

Sorry for delay...

You can use both, as a list you will use the insert method like a relationship

Set inj = ##class(PET.Injection).%New(), inj.Desc = "blabla "_i
Do study.Injection.Insert(inj)

It will add a column with the list

You can use an array, but you must use SetAt:

Do study.InjectionArr.SetAt(inj,i)

And it will create another table with the name of the property

Henry Pereira · Jun 26, 2018 go to post

Hi,

You can create Injection as a %SerialObject and add to Study as a list
`` `
Property Injection As list Of PET.Injection;
```

Henry Pereira · May 17, 2017 go to post

Hi @Fabian Haupt

Unfortunately  I didn't do a benchmark... But it's an awesome idea, compare the performance, I'll do and put here the results.
Thanks ;)

Henry Pereira · Dec 7, 2016 go to post

Hello All,

I'd loved to heard more about that,

I was working on something like that, inspired by "action dispatcher" from Rails Framework, but for now I didn't  succeed.

Henry Pereira · Dec 6, 2016 go to post

Another option is to use a regular expression, like this:

ClassMethod ReplaceAccents(ByRef pWord As %String) As %Status
{
  Set tSC = $$$OK
  Try {
      Set dictionary = ##class(%ArrayOfDataTypes).%New()
      Do dictionary.SetAt("ÀÁÂÃÄÅ","A")
      Do dictionary.SetAt("àáâãäå","a")
      Do dictionary.SetAt("ÈÉÊË","E")
      //.... all the rest
   
      While dictionary.GetNext(.key) {
        Set matcher = ##class(%Regex.Matcher).%New("["_ dictionary.GetAt(key) _ "]", pWord)
        Set pWord = matcher.ReplaceAll(key)
      }
  Catch tException {
    Set:$$$ISOK(tSC) tSC = tException.AsStatus()
  }
  Quit tSC
}