LEMR Wiki

Incorrect Region Formatting in Office Medic

Problem

Office Medic spirometry may record and display numbers in a format that does not match the system's region settings. 

To confirm the problem, open any Spirometry test from directly within Office Medic and you will see that there are commas instead of full stops in the numbers where the decimal point should go. 

To further confirm, the file at [My Documents]\Diagnostic Test Data\Spiro\SpGraph.txt will also have commas instead of decimal points.

This incorrect region format will trigger an error message in LEMR Client. When LEMR Client attempts to import the spirometry data, the following message is displayed:

Application Information 
----------------------- 
Program: C:\Program Files\LEMR\LEMRClient.exe 
Version: 2023.1.6.1017 
Program ID: 15216 
Exception: System.FormatException: Input string was not in a correct format. 
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) 
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) 
at OfficeMedicInterface.OMSpirometryTest.PopulateFromSpGraph(StreamReader reader) 
at OfficeMedicInterface.OMSpirometryTest.Populate(String exportFileLine, StreamReader spgraphReader) 
at OfficeMedicInterface.OMSpirometry.PopulateTests(StreamReader spTestReader, StreamReader spGraphReader) 
at OfficeMedicInterface.OMSpirometry.Populate(String sessionPath, String testPath, String graphPath) 
at OfficeMedicInterface.OfficeMedic.PerformTest(Test performMe) 
at LEMR.Client.LEMRForm.CefSharp_Patient.d__10.MoveNext() in D:\a\1\s\LEMRClient\LEMRForm.cs:line 1265 

Solution

The cause of the problem is a faulty region setting in the Windows registry. It seems to have only affected the formatting of decimal numbers in legacy applications like Office Medic; all modern Windows apps seem fine (calculator, Microsoft Excel, etc all display decimals fine). The settings in the Control Panel had the correct decimal symbol set also. 

To fix this, follow these steps: 

1. Check the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Language 

Value: Default 
The Data for this entry should be a hexidecimal value. If this key has the name of the region (e.g. en-AU), this will cause the error. 

Faulty Setting

Correct value should be: 
0409 - for US English 
0c09 - for Australian English 

Proper setting: 

Proper Setting

2. To avoid further region errors, it may be good to remove the following key:

Note: The whole international key is not there on our test PC so this may only appear on some PCs. 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\International 
 
If it exists, delete REG_SZ named: sShortDate 
dd/MM/yyyy 
 

Key to Delete

After Deletion

 
 
3. Reboot the computer. This is important as the regional settings are loaded into RAM on windows startup. 

To confirm if the fix worked, open Office Medic and view a Spirometry test. Figures should now have a decimal point, not a comma. Spirometry testing through LEMR should no longer throw an error message. 

 

Need Help? 
LEMR customers can get help by contacting LEMR Support.