async function getPatientPayload(clinicDetails) { const gracePeriodMinutes = 5; //…
- User
async function getPatientPayload(clinicDetails) { const gracePeriodMinutes = 5; // minutes
let startDate = clinicDetails.lastSyncDateTime ? moment(clinicDetails.lastSyncDateTime) : moment();
// Subtract grace period from the start date startDate = startDate.subtract(gracePeriodMinutes, "minutes");
return { jsonrpc: "2.0", params: { clinic_id: clinicDetails.clinicsId, location_id: clinicDetails.locationID, start_date: startDate.format("YYYY-MM-DD HH:mm:ss"), end_date: moment().format("YYYY-MM-DD HH:mm:ss"), page_size: "500", }, }; }
Have a configuratjon so that start_date and end_date can be date or datetime
- Assistant
- Assistant
It seems like your last message was empty or didn't come through properly. If you have any specific questions, need further clarifications, or have additional requests related to the function I've provided or any other topic, feel free to detail them and I'll be glad to help!
- User
default it should be dateOnly
- Assistant
To set the default date format to
"dateOnly"for thegetPatientPayloadfunction, you can adjust the function to default the format to when no specific configuration is provided in . Here’s an updated version of the function with default behavior: - User
dateTimePlot ?
- Assistant
Apologies for the confusion in my previous responses. It seems there was a typo and some mix-up in variable names. Let me correct and clarify the function with a focus on properly implementing the default
dateOnlybehavior.