r/badcode • u/646c726f576f6c6c6548 • Apr 07 '21
java Apparently Java can only handle 255 parameters in a constructor...
4.0k
Upvotes
r/badcode • u/646c726f576f6c6c6548 • Apr 07 '21
View all comments
Show parent comment
32
u/Lost4468 Apr 07 '21
It sounds like it was originally a paper implementation, in which case this sort of string representation can be incredibly efficient. If I give you a ton of drawers filled with patient details and tell you "find this patient", then if the records were assigned this sort of string, it would be very easy for you to narrow it down to a few records. I don't know how old the system is, but /u/bundabrg maybe it's because of this?
So then when they get digitised people don't want to move to a new system, or more likely you can't even change it because the hospital(s) are running two systems at once for a while. So you end up with weird data structures that make sense for paper records, but make no sense for computers.
I don't know so again maybe /u/bundabrg could chime in. But one of the problems with this sort of thing is there's frequently literally hundreds of exceptions. Because it's a paper system over the years people have said e.g. "oh let's just start this one with 'OUTSIDE' since it comes from outside the country" or all sorts of weird similar exceptions. Well for 'OUTSIDE' it's easy to write an exception, but there's often so many of these exceptions, and no documentation, the people working there don't have a list of the exceptions they've made over the decades. And then once you end up with enough exceptions you realise there are plenty of ambiguous ones you can't possibly decide by writing basic if statements.
And it's medical as well, so you really don't want to risk mixing up records, violating HIPAA, not properly finding a record, etc. So you end up just being stuck with the stupid system. To fix it you need to go through everything manually and change it all out at once, which requires a fuck ton of time and money.