EMIS FileRecord Date format

Hi All

Hope your all good, I’ve created a C# API that integrates with EMIS using the using the EMIS EM_PACC com (IPatientAccessEMISWebV4_3) and the below methods.
Everything works locally fine, but when I deploy to our Azure VM IIS server, one call (FileRecord) does not work correctly. Its returning the below error. I’ve sent the same dataset locally and on the Azure server. Locally it sends, but Azure fails. The EMIS integration is working on the server as all the other calls work.
I’ve made sure all the Regions etc on the Server are set to UK and not US, but still not luck. Can someone here help?

Methods used

  • InitializeWithID
  • Logon
  • GetOrganisation
  • GetMatchedPatient
  • GetMedicationIssues
  • FileRecord
    Error
    Method FileRecord. Error = Invalid date format. Requires ‘dd/MM/yyyy’. (outcome: -1)

XML that failed

<?xml version="1.0" encoding="utf-16"?>
<MedicalRecord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" PatientID="2881"
    xmlns="http://www.e-mis.com/emisopen/MedicalRecord">
    <ConsultationList>
        <Consultation>
            <GUID>c9d220a7-367d-4ad1-a2c2-63f1780cda1f</GUID>
            <AssignedDate>09/04/2025</AssignedDate>
            <UserID>
                <RefID>2381</RefID>
                <GUID>2cfefc49-f8a2-4ee8-95e0-812719b3c1f5</GUID>
            </UserID>
            <LocationTypeID>
                <RefID>4884</RefID>
            </LocationTypeID>
            <OriginalAuthor>
                <User>
                    <RefID>2381</RefID>
                    <GUID>2cfefc49-f8a2-4ee8-95e0-812719b3c1f5</GUID>
                </User>
            </OriginalAuthor>
            <ElementList>
                <ConsultationElement>
                    <GUID>95e9d5c5-884d-48e9-a379-08ff40fd5fef</GUID>
                    <DisplayOrder>1</DisplayOrder>
                    <ProblemSection>1</ProblemSection>
                    <Header>
                        <Value>23</Value>
                        <Term>Additional</Term>
                    </Header>
                    <Attachment>
                        <RefID>4884</RefID>
                        <GUID>95e9d5c5-884d-48e9-a379-08ff40fd5fef</GUID>
                        <AssignedDate>09/04/2025</AssignedDate>
                        <AuthorID>
                            <RefID>2381</RefID>
                        </AuthorID>
                        <OriginalAuthor>
                            <User>
                                <RefID>2381</RefID>
                            </User>
                        </OriginalAuthor>
                        <DescriptiveText>LungHealth Initial Review</DescriptiveText>
                        <Title>LungHealth Initial Review</Title>
                        <Address>234ec7f7-e717-4ece-9c58-797b0c6656ef.pdf</Address>
                    </Attachment>
                    <Event>
                        <AuthorID />
                        <OriginalAuthor>
                            <User />
                        </OriginalAuthor>
                        <Code />
                        <TermID />
                        <NumericValue />
                        <EventType>0</EventType>
                    </Event>
                </ConsultationElement>
            </ElementList>
        </Consultation>
    </ConsultationList>
    <PeopleList>
        <Person>
            <RefID>2381</RefID>
            <GUID>2cfefc49-f8a2-4ee8-95e0-812719b3c1f5</GUID>
        </Person>
    </PeopleList>
    <LocationTypeList>
        <LocationType>
            <RefID>4884</RefID>
            <Description>X-on medical centre (demo)</Description>
        </LocationType>
    </LocationTypeList>
</MedicalRecord>

Fixed the issue
It was either one of the below as I did both and then restarted the server

First change

  • Go into Registry Editor (start → run → type regedit).
  • Get into the folder HKEY_USERS → .DEFAULT → Control Panel → International.
  • Look for the key sShortDate, right click → Modify…
  • Change the Value data for d/M/yyyy.

Second

  • Go to Control Panel
  • Click Region and you will see a screen with 3 tabs (Formats, Location and Administrative)
  • Click Formats and choose the settings you prefer
  • Click Location and choose the settings you prefer
  • Click Administrative tab. For “Welcome screen and new user accounts”, click copy settings. From the new window, click both checkboxes for ‘welcome screen and system accounts’ and ‘new user accounts’ (if you skip this step, you will still see the issue because IIS uses system account)
  • Approve all changes for Region by clicking Ok on all open windows

Hi Chris,

Thanks for sharing the analysis and also for posting your solution — really helpful context for the API Developer community users.

From what you’ve described, we agree with your assessment: the Invalid date format. Requires ‘dd/MM/yyyy’ error from the FileRecord method is very likely caused by the regional settings under the system account on your Azure VM, specifically the one used by the IIS Application Pool.

It’s not uncommon for COM components like EMIS EM_PACC to rely on the underlying thread or system locale for date parsing. Even if your XML uses the correct UK format, the component may still interpret the date incorrectly if the system default is MM/dd/yyyy.

Your solution — updating both seems to be the right fix in this scenario:

1. The registry key at HKEY_USERS.DEFAULT\Control Panel\International\sShortDate to d/M/yyyy, and

2. The region settings via Control Panel → Administrative tab → Copy settings to system and new user accounts

These changes ensure the IIS worker process, running under a system account, uses the expected UK date format consistently.

You may also consider explicitly setting the application culture in code to add an extra layer of protection:

CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(“en-GB”);
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(“en-GB”);

Since your other EMIS calls were working fine, and only FileRecord failed, it strongly suggests that FileRecord uniquely performs strict date parsing, unlike the other methods.

Glad to hear the issue is resolved — thanks again for documenting both the problem and solution so clearly.

Thanks,

NHS England API Platform team

Please note: The API Platform team can only address queries relevant to the NHS England API platform, including security, rate limiting, logging, monitoring and alerting. For any API specific queries, please reach out the relevant API teams.