Encounter.datetimeShouldBeBeforeCurrent, encounterDateTime Error

Hello, I am testing the app and I wanted to record vitals for a specific patient. When I click safe I get this error “Error saving vitals and biometrics Some of the values entered are invalid” and from the Network Tab I get that the ERROR comes from the encounter:

{
    "error": {
        "message": "Invalid Submission",
        "code": "webservices.rest.error.invalid.submission",
        "globalErrors": [],
        "fieldErrors": {
            "encounterDatetime": [
                {
                    "code": "Encounter.datetimeShouldBeBeforeCurrent",
                    "message": "The encounter datetime should be before the current date."
                }
            ]
        }
    }
}

Steps:

  • Login an open any Patient

  • Click on Record vital signs or on Record biometrics and enter all vitals

Result: Error message “Error saving vitals and biometrics Some of the values entered are invalid”

p.s. I have searched trough documentation and nothing helped

@mksrom / @vasharma05 – does this :point_up: look like what happened to us a couple of times?

Hi @darijach !

Thank you for reporting this issue. Can you please go to https://time.is and share the screenshot of the website, which will show the time difference b/w your system and server time? Thanks!

We have recorded your issue here: [O3-2975] - OpenMRS Issues

1 Like

Hello, we tested the time with the site you have suggested and here is the result.

On my system the time was 2 seconds behind and it works okay when I manage trough the app

But on my collegues system, the time was 4 seconds ahead causing roblems with the requests that use encounterDate time.

After changing the time to be exact everything works fine. I have another question.

  1. What is the encounterDateTime? When should it be used and why?
  2. Which other requests/parts of the app use it and how it will afect the medical workers when using the app?
1 Like

@darijach this field keeps track of the date and time at which the encounter started. In FHIR terms that would be the first of the two items of Encounter.period.

Parts of the app… well, many. Encounters are all over the modeling of medical records data, many OpenMRS entities refer to encounters.