Hi,
Given that the tools we have to use at work are cheap and therefor not very elegant, I have yet another challenge.
Our electronic presciption system is webbased.
Almost every day I have to paste current medication into a Word document.
That doesn't sound like it's complicated, just past the bullet list as plain text.
No such luck...
Each and every browser puts the contents of the selected text differently on the clipboard (as plain text).
Considering I copied a text like this:
- calciumcarbonaat/colecalciferol 1 dd 1 tablet van 1,25g/800ie
- ciprofloxacine 2 dd 1 tablet van 500mg (= 500 mg)
- koelzalf zo nodig
- lactulose 1 dd 15 milliliter van 670mg/ml
I want to copy that, and paste it as plain text (no bullets).
Here's what I get from the clipboard depending on the browser used:
IE 11.0
calciumcarbonaat/colecalciferol •1 dd 1 tablet van 1,25g/800ie
min
ciprofloxacine •2 dd 1 tablet van 500mg (= 500 mg)
min
koelzalf •zo nodig
min
lactulose •1 dd 15 milliliter van 670mg/ml
min
macrogol/zouten •1 dd 1 stuk
Notice that IE is the only browser that puts "min" in there.
MS Edge
calciumcarbonaat/colecalciferol
1 dd 1 tablet van 1,25g/800ie
ciprofloxacine
2 dd 1 tablet van 500mg (= 500 mg)
koelzalf
zo nodig
lactulose
1 dd 15 milliliter van 670mg/ml
FF 72 (Windows)
calciumcarbonaat/colecalciferol
1 dd 1 tablet van 1,25g/800ie
ciprofloxacine
2 dd 1 tablet van 500mg (= 500 mg)
koelzalf
zo nodig
lactulose
1 dd 15 milliliter van 670mg/ml
IE 11 on Win2012 server under Citrix (this is what I get at work)
(You'll notice it's different prescriptons in this case)
calciumcarbonaat/colecalciferol
•1 dd 1 tabl van 1,25g/800ie
clomipramine
•1 dd 3 tabl van 10mg (= 30 mg)
Notice the copious amount of whitespace and line endings that IE adds.
Can somebody come up with a RegEx that does what I want?
I would like it to also remove the pointless "(= 500 mg)" at the end of a prescription line.
Currently I use 12 consecutive StringReplace calls (order matters here) and then some StringReplace on each line of the resulting stringlist.
If I could use a RegEx then I could simplye store the RegEx in a configuration file and alter that whenever the format of the text changes again (2-4 times a year). Currently I have to adapt the code and rebuild my program (and then manage to secretly put the new executable on the network, which I'm of course not allowed to do).
The bullet signs are #226#128#162 in Utf8.
Needless to say that the provider of this software (FarMedVisie) refuses to offer a view of this actual medication as unformatted text.
Bart