Read about OpenEMR's Response to the COVID-19 Pandemic at https://www.open-emr.org/covid19/

Not able to fetch data for recurrence appointment from backend table name openemr_postcalendar_events

In openemr database Table ‘openemr_postcalendar_events’ store appointment details .
For a single appointment, we can able to see data is there in the column ‘Pc_eventDate’.

But for recurrence appointment it stores data in column ‘pc_recurrtype’,‘pc_recurrspec’ and ‘pc_recurrfreq’.
column pc_recurrfreq its store some json like format given below

1.on recurrence Mon/Tue/wed/Thurs/friday/saturday:

a:6:{s:17:“event_repeat_freq”;s:11:“2,3,4,5,6,7”;s:22:“event_repeat_freq_type”;s:1:“6”;s:19:“event_repeat_on_num”;s:1:“1”;s:19:“event_repeat_on_day”;s:1:“0”;s:20:“event_repeat_on_freq”;s:1:“0”;s:6:“exdate”;s:0:"";}
2. on recurrence each day form select dropdown:
a:6:{s:17:“event_repeat_freq”;s:1:“1”;s:22:“event_repeat_freq_type”;s:1:“0”;s:19:“event_repeat_on_num”;s:1:“1”;s:19:“event_repeat_on_day”;s:1:“0”;s:20:“event_repeat_on_freq”;s:1:“0”;s:6:“exdate”;s:0:"";}

can anyone tell exactly how this recurrence data can fetch from the query .
also refer some git openemr code for the same module, but didn’t able to figure it out.

Thanks in advanced.

Hi @TEJAL,

Once you execute the query on the openemr_postcalendar_events table from php you need to pass that column to the json_decode function into the PHP it will convert that data in object data type of PHP and then you can fields you want or property you want inside the Jason.

Thanks,
Nilesh

Hello Nilesh,

I know about the json parsing process.
I tried with same approach but still its returns me data as NULL.No use .

$sql =“SELECT * FROM openemr_postcalendar_events WHERE pc_eid=15”;
$getstmt = $conn->prepare($sql);
$getstmt->execute();
while($getrow = $getstmt->fetch(PDO::FETCH_ASSOC)){
$jsondata =$getrow[‘pc_recurrspec’];
var_dump( json_decode($jsondata)); //returns null
}

/////////////////////////////
i am looking more for what data exactly it is?meaning of the data that comes in json and how to access it exactly. Because json store in column is not exact json as i give example in attached post.
/////////////////////////////
if any futher details / information let me know.

Regards,
Tejal