Is the os module part of the embedded Lua interpreter within Orthanc?
I ask, because we've had discussions about Lua earlier in this group that indicated that the modules included with the embedded Lua interpreter may be limited.
In my setup, I'm running the Docker installation, which means Orthanc (and its Lua) are running within the context of an Ubuntu container. I find that I can use Ubuntu's package manager to add additional modules (ex. sql modules to do some database communication in my Lua scripts).
Within the same Linux context, I believe there was a change at some point in Orthanc where the embedded Lua interpreter stopped looking at the host system's own Lua modules. I was able to get it working again, but I'd have to do some digging to figure out how I did that. It likely had something to do with declaring an environmental variable on my host pointing to the Lua module installation directories - ie. your typical environmental search path.