primarycare-binder 1.1.34 → 1.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs.js +969 -480
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -16604,7 +16604,6 @@ var READ_PERSON = createAsyncThunk("personApiSlice/readPerson", /*#__PURE__*/_as
16604
16604
  _data$4,
16605
16605
  _data$4$,
16606
16606
  _data$4$$names,
16607
- _data$4$$names$,
16608
16607
  _data$5,
16609
16608
  _data$5$,
16610
16609
  _data$5$$Patientname,
@@ -16663,7 +16662,7 @@ var READ_PERSON = createAsyncThunk("personApiSlice/readPerson", /*#__PURE__*/_as
16663
16662
  id: (data === null || data === void 0 ? void 0 : (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : (_data$$ = _data$[0]) === null || _data$$ === void 0 ? void 0 : _data$$.Id) || 0,
16664
16663
  birthDay: (data === null || data === void 0 ? void 0 : (_data$2 = data[0]) === null || _data$2 === void 0 ? void 0 : (_data$2$ = _data$2[0]) === null || _data$2$ === void 0 ? void 0 : _data$2$.birthDay) || "",
16665
16664
  gender: (data === null || data === void 0 ? void 0 : (_data$3 = data[0]) === null || _data$3 === void 0 ? void 0 : (_data$3$ = _data$3[0]) === null || _data$3$ === void 0 ? void 0 : _data$3$.gender) || "",
16666
- name: (data === null || data === void 0 ? void 0 : (_data$4 = data[0]) === null || _data$4 === void 0 ? void 0 : (_data$4$ = _data$4[0]) === null || _data$4$ === void 0 ? void 0 : (_data$4$$names = _data$4$.names) === null || _data$4$$names === void 0 ? void 0 : (_data$4$$names$ = _data$4$$names[0]) === null || _data$4$$names$ === void 0 ? void 0 : _data$4$$names$.given) || "",
16665
+ name: makeName(data === null || data === void 0 ? void 0 : (_data$4 = data[0]) === null || _data$4 === void 0 ? void 0 : (_data$4$ = _data$4[0]) === null || _data$4$ === void 0 ? void 0 : (_data$4$$names = _data$4$.names) === null || _data$4$$names === void 0 ? void 0 : _data$4$$names[0]) || "",
16667
16666
  pid: (data === null || data === void 0 ? void 0 : (_data$5 = data[0]) === null || _data$5 === void 0 ? void 0 : (_data$5$ = _data$5[0]) === null || _data$5$ === void 0 ? void 0 : (_data$5$$Patientname = _data$5$.Patientname) === null || _data$5$$Patientname === void 0 ? void 0 : (_data$5$$Patientname$ = _data$5$$Patientname[0]) === null || _data$5$$Patientname$ === void 0 ? void 0 : _data$5$$Patientname$._id) || "",
16668
16667
  mrn: (data === null || data === void 0 ? void 0 : (_data$6 = data[0]) === null || _data$6 === void 0 ? void 0 : (_data$6$ = _data$6[0]) === null || _data$6$ === void 0 ? void 0 : (_data$6$$Patientname = _data$6$.Patientname) === null || _data$6$$Patientname === void 0 ? void 0 : (_data$6$$Patientname$ = _data$6$$Patientname[0]) === null || _data$6$$Patientname$ === void 0 ? void 0 : _data$6$$Patientname$.alias) || "",
16669
16668
  username: phone,
@@ -37980,12 +37979,13 @@ var query$4 = {
37980
37979
  getAppointments: function getAppointments(data) {
37981
37980
  return {
37982
37981
  db_name: dbName,
37983
- entity: "Appointment,Encounter",
37982
+ entity: "Appointment",
37984
37983
  filter: {
37985
- Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && lower(Appointment.appointmentType)!='cancelled' && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
37986
- Encounter: "Appointment.id in Encounter.appointmentId && lower(first(document(Encounter.statushistory[*].status)[*].display))=='checked-in'"
37984
+ Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && lower(Appointment.appointmentType)!='cancelled' && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'") // Encounter:
37985
+ // "Appointment.id in Encounter.appointmentId && lower(first(document(Encounter.statushistory[*].status)[*].display))=='checked-in'",
37986
+
37987
37987
  },
37988
- return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
37988
+ "return_fields": "{Appointment:merge(Appointment,{orgid:document(Appointment.orgid)},{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)},{telecom:document(per.telecom)},{MRN:(for pat in Patient filter pat.personID==per.Id return pat.alias)},{age:(for pat in Patient filter pat.personID==per.Id return pat.age)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))})}"
37989
37989
  };
37990
37990
  },
37991
37991
  getFirstVisits: function getFirstVisits(data) {
@@ -37996,7 +37996,7 @@ var query$4 = {
37996
37996
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
37997
37997
  Encounter: "Appointment.id in Encounter.appointmentId && lower(Encounter.visit_type)==lower('First Visit')"
37998
37998
  },
37999
- return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
37999
+ return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
38000
38000
  };
38001
38001
  },
38002
38002
  getOtherVisits: function getOtherVisits(data) {
@@ -38007,7 +38007,7 @@ var query$4 = {
38007
38007
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38008
38008
  Encounter: "Appointment.id in Encounter.appointmentId && lower(Encounter.visit_type)==lower('Other Visits')"
38009
38009
  },
38010
- return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
38010
+ return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
38011
38011
  };
38012
38012
  },
38013
38013
  getWalkIns: function getWalkIns(data) {
@@ -38018,7 +38018,7 @@ var query$4 = {
38018
38018
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38019
38019
  Encounter: "Appointment.id in Encounter.appointmentId && lower(Encounter.visit_type)==lower('Walkin')"
38020
38020
  },
38021
- return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
38021
+ return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
38022
38022
  };
38023
38023
  },
38024
38024
  getNewPatients: function getNewPatients(data) {
@@ -38029,7 +38029,7 @@ var query$4 = {
38029
38029
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38030
38030
  Encounter: "Appointment.id in Encounter.appointmentId && lower(Encounter.visit_type)==lower('New Patient')"
38031
38031
  },
38032
- return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
38032
+ return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
38033
38033
  };
38034
38034
  },
38035
38035
  getTodayVisits: function getTodayVisits(data) {
@@ -38040,20 +38040,31 @@ var query$4 = {
38040
38040
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38041
38041
  Encounter: "Appointment.id in Encounter.appointmentId && lower(first(document(Encounter.statushistory[*].status)[*].display))=='checked-in' "
38042
38042
  },
38043
- return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
38043
+ return_fields: "{Appointment:merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}),Encounter:merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))})}"
38044
38044
  };
38045
38045
  },
38046
38046
  // NURSE
38047
38047
  getAppointmentsNurse: function getAppointmentsNurse(data) {
38048
+ // return {
38049
+ // db_name: dbName,
38050
+ // entity: "Practitioner,Appointment,Encounter",
38051
+ // filter: {
38052
+ // Practitioner: `Practitioner.activestatus==true && DOCUMENT(DOCUMENT(DOCUMENT(Practitioner.practitioner_role[*])[*].role)[0].coding)[*].code ANY =='PR023' && Practitioner.id==${data?.practionerID} && DOCUMENT(Practitioner.practitioner_role[*])[*].OrgID ANY =='${data?.orgID}'`,
38053
+ // Appointment: `Appointment.activestatus==true && Appointment.orgid=='${data?.orgID}' && Appointment.start>=${data?.startDate} && Appointment.end<=${data?.endDate} && lower(Appointment.appointmentType)!='cancelled' && document(DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID)[*].id ANY IN Appointment.SpecialtyID`,
38054
+ // Encounter:
38055
+ // "Appointment.id in Encounter.appointmentId && lower(first(document(Encounter.statushistory[*].status)[*].display))=='checked-in'",
38056
+ // },
38057
+ // return_fields:
38058
+ // "merge(Encounter,{status:document(Encounter.status),appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:document(document(Appointment.resourcecode).name)}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))})),patient_id:(for pati in Patient filter pati.id == Encounter.patient_id return merge(pati,{name:document(pati.name)}))})",
38059
+ // };
38048
38060
  return {
38049
- db_name: dbName,
38050
- entity: "Practitioner,Appointment,Encounter",
38051
- filter: {
38061
+ "db_name": "primarycare",
38062
+ "entity": "Practitioner,Appointment",
38063
+ "filter": {
38052
38064
  Practitioner: "Practitioner.activestatus==true && DOCUMENT(DOCUMENT(DOCUMENT(Practitioner.practitioner_role[*])[*].role)[0].coding)[*].code ANY =='PR023' && Practitioner.id==".concat(data === null || data === void 0 ? void 0 : data.practionerID, " && DOCUMENT(Practitioner.practitioner_role[*])[*].OrgID ANY =='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38053
- Appointment: "Appointment.activestatus==true && Appointment.orgid=='".concat(data === null || data === void 0 ? void 0 : data.orgID, "' && Appointment.start>=").concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && lower(Appointment.appointmentType)!='cancelled' && document(DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID)[*].id ANY IN Appointment.SpecialtyID"),
38054
- Encounter: "Appointment.id in Encounter.appointmentId && lower(first(document(Encounter.statushistory[*].status)[*].display))=='checked-in'"
38065
+ Appointment: "Appointment.activestatus==true && Appointment.orgid=='".concat(data === null || data === void 0 ? void 0 : data.orgID, "' && Appointment.start>=").concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && lower(Appointment.appointmentType)!='cancelled' && document(DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID)[*].id ANY IN Appointment.SpecialtyID")
38055
38066
  },
38056
- return_fields: "merge(Encounter,{status:document(Encounter.status),appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:document(document(Appointment.resourcecode).name)}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))})),patient_id:(for pati in Patient filter pati.id == Encounter.patient_id return merge(pati,{name:document(pati.name)}))})"
38067
+ "return_fields": "{Appointment:merge(Appointment,{orgid:document(Appointment.orgid)},{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)},{telecom:document(per.telecom)},{MRN:(for pat in Patient filter pat.personID==per.Id return pat.alias)},{age:(for pat in Patient filter pat.personID==per.Id return pat.age)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))})}"
38057
38068
  };
38058
38069
  },
38059
38070
  getFirstVisitsNurse: function getFirstVisitsNurse(data) {
@@ -38100,7 +38111,7 @@ var query$4 = {
38100
38111
  Practitioner: "DOCUMENT(DOCUMENT(DOCUMENT(Practitioner.practitioner_role[*])[*].role)[0].coding)[*].code ANY =='PR023' && Practitioner.id==".concat(data === null || data === void 0 ? void 0 : data.practionerID, " && DOCUMENT(Practitioner.practitioner_role[*])[*].OrgID ANY =='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38101
38112
  Encounter: "Encounter.activestatus == true && Encounter.Organization_id == ".concat(data === null || data === void 0 ? void 0 : data.orgIDInt, " && DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID ANY IN Encounter.practitioner_details[*].speciality AND Encounter.encounterdate>=").concat(data === null || data === void 0 ? void 0 : data.startDate, " && Encounter.encounterdate<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && lower(first(document(Encounter.statushistory[*].status)[*].display))=='checked-in'")
38102
38113
  },
38103
- return_fields: "merge(Encounter,{status:document(Encounter.status),patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(for Appointment in Appointment filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38114
+ return_fields: "merge(Encounter,{status:document(Encounter.status),patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(for Appointment in Appointment filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38104
38115
  };
38105
38116
  },
38106
38117
  getWalkInsNurse: function getWalkInsNurse(data) {
@@ -38119,12 +38130,13 @@ var query$4 = {
38119
38130
  getAppointmentsDoctor: function getAppointmentsDoctor(data) {
38120
38131
  return {
38121
38132
  db_name: dbName,
38122
- entity: "Appointment,Encounter",
38133
+ entity: "Appointment",
38123
38134
  filter: {
38124
- Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && lower(Appointment.appointmentType)!='cancelled' && document(Appointment.resourcecode).id ==").concat(data === null || data === void 0 ? void 0 : data.practionerID, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38125
- Encounter: "Appointment.id in Encounter.appointmentId && lower(first(document(Encounter.statushistory[*].status)[*].display))=='checked-in'"
38135
+ Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && lower(Appointment.appointmentType)!='cancelled' && document(Appointment.resourcecode).id ==").concat(data === null || data === void 0 ? void 0 : data.practionerID, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'") // Encounter:
38136
+ // "Appointment.id in Encounter.appointmentId && lower(first(document(Encounter.statushistory[*].status)[*].display))=='checked-in'",
38137
+
38126
38138
  },
38127
- return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38139
+ "return_fields": "{Appointment:merge(Appointment,{orgid:document(Appointment.orgid)},{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)},{telecom:document(per.telecom)},{MRN:(for pat in Patient filter pat.personID==per.Id return pat.alias)},{age:(for pat in Patient filter pat.personID==per.Id return pat.age)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))})}"
38128
38140
  };
38129
38141
  },
38130
38142
  getFirstVisitsDoctor: function getFirstVisitsDoctor(data) {
@@ -38135,7 +38147,7 @@ var query$4 = {
38135
38147
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && document(Appointment.resourcecode).id ==").concat(data === null || data === void 0 ? void 0 : data.practionerID, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38136
38148
  Encounter: "Appointment.id in Encounter.appointmentId && lower(Encounter.visit_type)==lower('First Visit')"
38137
38149
  },
38138
- return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38150
+ return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38139
38151
  };
38140
38152
  },
38141
38153
  getNewPatientsDoctor: function getNewPatientsDoctor(data) {
@@ -38146,7 +38158,7 @@ var query$4 = {
38146
38158
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && document(Appointment.resourcecode).id ==").concat(data === null || data === void 0 ? void 0 : data.practionerID, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38147
38159
  Encounter: "Appointment.id in Encounter.appointmentId && lower(Encounter.visit_type)==lower('New Patient')"
38148
38160
  },
38149
- return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38161
+ return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38150
38162
  };
38151
38163
  },
38152
38164
  getOtherVisitsDoctor: function getOtherVisitsDoctor(data) {
@@ -38157,7 +38169,7 @@ var query$4 = {
38157
38169
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && document(Appointment.resourcecode).id ==").concat(data === null || data === void 0 ? void 0 : data.practionerID, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38158
38170
  Encounter: "Appointment.id in Encounter.appointmentId && lower(Encounter.visit_type)==lower('Other Visits')"
38159
38171
  },
38160
- return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38172
+ return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38161
38173
  };
38162
38174
  },
38163
38175
  getTodayVisitsDoctor: function getTodayVisitsDoctor(data) {
@@ -38168,7 +38180,7 @@ var query$4 = {
38168
38180
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && document(Appointment.resourcecode).id ==").concat(data === null || data === void 0 ? void 0 : data.practionerID, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "' "),
38169
38181
  Encounter: "Appointment.id in Encounter.appointmentId && lower(first(document(Encounter.statushistory[*].status)[*].display))=='checked-in'"
38170
38182
  },
38171
- return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38183
+ return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38172
38184
  };
38173
38185
  },
38174
38186
  getWalkInsDoctor: function getWalkInsDoctor(data) {
@@ -38179,7 +38191,7 @@ var query$4 = {
38179
38191
  Appointment: "Appointment.activestatus==true && Appointment.start>=".concat(data === null || data === void 0 ? void 0 : data.startDate, " && Appointment.end<=").concat(data === null || data === void 0 ? void 0 : data.endDate, " && document(Appointment.resourcecode).id ==").concat(data === null || data === void 0 ? void 0 : data.practionerID, " && Appointment.orgid=='").concat(data === null || data === void 0 ? void 0 : data.orgID, "'"),
38180
38192
  Encounter: "Appointment.id in Encounter.appointmentId && lower(Encounter.visit_type)==lower('Walkin')"
38181
38193
  },
38182
- return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38194
+ return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return {id : pat.id, _id : pat._id,name:(for hn in HumanNameMaster filter hn._id in pat.name return merge(hn,{use:document(hn.use),prefix:document(hn.prefix),suffix:document(hn.suffix)})),telecom:document(pat.telecom),gender:document(pat.gender),MRN:pat.alias,age:pat.age}),status:document(Encounter.status),practitioner_details:(for prac in Encounter.practitioner_details return merge(prac,{speciality:(for cod in CodeableConceptMaster filter cod._id==prac.speciality return document(cod.coding))}))},{appointmentId:(filter Appointment.id in Encounter.appointmentId return merge(Appointment,{PersonID:(for per in Person filter per.Id in Appointment.PersonID return merge(per,{name:(for nam in HumanNameMaster filter nam._id in per.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))},{gender:document(per.gender)},{photo:document(per.photo)})),resourcecode:merge(document(Appointment.resourcecode),{name:merge(document(document(Appointment.resourcecode).name))}),SpecialtyID:(for spe in CodeableConceptMaster filter Appointment.SpecialtyID any == spe.id return merge(spe,{coding:document(spe.coding)}))}))})"
38183
38195
  };
38184
38196
  }
38185
38197
  };
@@ -38210,34 +38222,48 @@ var GET_APPOINTMENTS = createAsyncThunk("appointmentStatsApiSlice/getAppointment
38210
38222
  case 5:
38211
38223
  data = _context.sent;
38212
38224
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result = data.result) === null || _data$result === void 0 ? void 0 : _data$result.map(function (_) {
38213
- var _$Appointment, _$Appointment$PersonI, _$Appointment$PersonI2, _$Appointment$PersonI3, _$Appointment$PersonI4, _$Appointment2, _$Appointment2$Person, _$Appointment2$Person2, _$Appointment2$Person3, _$Appointment2$Person4, _$Encounter, _$Encounter$patient_i, _$Encounter$patient_i2, _$Encounter$patient_i3, _$Encounter2, _$Encounter2$patient_, _$Encounter2$patient_2, _$Appointment3, _$Appointment3$Person, _$Appointment3$Person2, _$Appointment4, _$Appointment5, _$Appointment6, _$Appointment7, _$Appointment8, _$Appointment8$Specia, _$Encounter3, _$Encounter3$practiti, _$Encounter3$practiti2, _$Appointment9, _$Appointment9$Person, _$Appointment9$Person2, _$Appointment10, _$Appointment10$Perso, _$Appointment10$Perso2, _$Encounter4, _$Encounter4$patient_, _$Encounter4$patient_2, _$Encounter4$patient_3, _$Encounter4$patient_4, _$Encounter5, _$Encounter6, _$Encounter6$status, _$Encounter$appointme, _$Encounter7, _$Encounter7$appointm;
38225
+ var _$Appointment, _$Appointment$PersonI, _$Appointment$PersonI2, _$Appointment$PersonI3, _$Appointment2, _$Appointment2$Person, _$Appointment2$Person2, _$Appointment2$Person3, _$Appointment3, _$Appointment3$Person, _$Appointment3$Person2, _$Appointment4, _$Appointment5, _$Appointment6, _$Appointment7, _$Appointment$PersonI4, _$Appointment8, _$Appointment8$Person, _$Appointment8$Person2, _$Appointment8$Person3, _$Appointment8$Person4, _$Appointment$appoint, _$Appointment9, _$Appointment10, _$Appointment11;
38214
38226
 
38215
38227
  return {
38216
- img: (_ === null || _ === void 0 ? void 0 : (_$Appointment = _.Appointment) === null || _$Appointment === void 0 ? void 0 : (_$Appointment$PersonI = _$Appointment.PersonID) === null || _$Appointment$PersonI === void 0 ? void 0 : (_$Appointment$PersonI2 = _$Appointment$PersonI[0]) === null || _$Appointment$PersonI2 === void 0 ? void 0 : (_$Appointment$PersonI3 = _$Appointment$PersonI2.photo) === null || _$Appointment$PersonI3 === void 0 ? void 0 : (_$Appointment$PersonI4 = _$Appointment$PersonI3[0]) === null || _$Appointment$PersonI4 === void 0 ? void 0 : _$Appointment$PersonI4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$Appointment2 = _.Appointment) === null || _$Appointment2 === void 0 ? void 0 : (_$Appointment2$Person = _$Appointment2.PersonID) === null || _$Appointment2$Person === void 0 ? void 0 : (_$Appointment2$Person2 = _$Appointment2$Person[0]) === null || _$Appointment2$Person2 === void 0 ? void 0 : (_$Appointment2$Person3 = _$Appointment2$Person2.photo) === null || _$Appointment2$Person3 === void 0 ? void 0 : (_$Appointment2$Person4 = _$Appointment2$Person3[0]) === null || _$Appointment2$Person4 === void 0 ? void 0 : _$Appointment2$Person4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38217
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter = _.Encounter) === null || _$Encounter === void 0 ? void 0 : (_$Encounter$patient_i = _$Encounter.patient_id) === null || _$Encounter$patient_i === void 0 ? void 0 : (_$Encounter$patient_i2 = _$Encounter$patient_i[0]) === null || _$Encounter$patient_i2 === void 0 ? void 0 : (_$Encounter$patient_i3 = _$Encounter$patient_i2.name) === null || _$Encounter$patient_i3 === void 0 ? void 0 : _$Encounter$patient_i3[0]) || {}),
38218
- mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter2 = _.Encounter) === null || _$Encounter2 === void 0 ? void 0 : (_$Encounter2$patient_ = _$Encounter2.patient_id) === null || _$Encounter2$patient_ === void 0 ? void 0 : (_$Encounter2$patient_2 = _$Encounter2$patient_[0]) === null || _$Encounter2$patient_2 === void 0 ? void 0 : _$Encounter2$patient_2.MRN,
38219
- enId: _.Encounter.id,
38228
+ // img: _?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid
38229
+ // ? getImgUrl(_?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid)
38230
+ // : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38231
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$Appointment = _.Appointment) === null || _$Appointment === void 0 ? void 0 : (_$Appointment$PersonI = _$Appointment.PersonID) === null || _$Appointment$PersonI === void 0 ? void 0 : (_$Appointment$PersonI2 = _$Appointment$PersonI[0]) === null || _$Appointment$PersonI2 === void 0 ? void 0 : (_$Appointment$PersonI3 = _$Appointment$PersonI2.name) === null || _$Appointment$PersonI3 === void 0 ? void 0 : _$Appointment$PersonI3[0]) || {}),
38232
+ mrn: (_$Appointment2 = _.Appointment) === null || _$Appointment2 === void 0 ? void 0 : (_$Appointment2$Person = _$Appointment2.PersonID) === null || _$Appointment2$Person === void 0 ? void 0 : (_$Appointment2$Person2 = _$Appointment2$Person[0]) === null || _$Appointment2$Person2 === void 0 ? void 0 : (_$Appointment2$Person3 = _$Appointment2$Person2.MRN) === null || _$Appointment2$Person3 === void 0 ? void 0 : _$Appointment2$Person3[0],
38233
+ // enId: _.Encounter.id,
38220
38234
  age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment3 = _.Appointment) === null || _$Appointment3 === void 0 ? void 0 : (_$Appointment3$Person = _$Appointment3.PersonID) === null || _$Appointment3$Person === void 0 ? void 0 : (_$Appointment3$Person2 = _$Appointment3$Person[0]) === null || _$Appointment3$Person2 === void 0 ? void 0 : _$Appointment3$Person2.birthDay),
38221
- date: (_ === null || _ === void 0 ? void 0 : (_$Appointment4 = _.Appointment) === null || _$Appointment4 === void 0 ? void 0 : _$Appointment4.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment5 = _.Appointment) === null || _$Appointment5 === void 0 ? void 0 : _$Appointment5.start, "DD MMM,YYYY") : "",
38222
- time: (_ === null || _ === void 0 ? void 0 : (_$Appointment6 = _.Appointment) === null || _$Appointment6 === void 0 ? void 0 : _$Appointment6.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment7 = _.Appointment) === null || _$Appointment7 === void 0 ? void 0 : _$Appointment7.start, "hh:mm A") : "",
38223
- speciality: _ === null || _ === void 0 ? void 0 : (_$Appointment8 = _.Appointment) === null || _$Appointment8 === void 0 ? void 0 : (_$Appointment8$Specia = _$Appointment8.SpecialtyID) === null || _$Appointment8$Specia === void 0 ? void 0 : _$Appointment8$Specia.map(function (spl) {
38224
- var _spl$coding, _spl$coding$;
38225
-
38226
- return spl === null || spl === void 0 ? void 0 : (_spl$coding = spl.coding) === null || _spl$coding === void 0 ? void 0 : (_spl$coding$ = _spl$coding[0]) === null || _spl$coding$ === void 0 ? void 0 : _spl$coding$.display;
38227
- }).join(", "),
38228
- clinic: _ === null || _ === void 0 ? void 0 : (_$Encounter3 = _.Encounter) === null || _$Encounter3 === void 0 ? void 0 : (_$Encounter3$practiti = _$Encounter3.practitioner_details) === null || _$Encounter3$practiti === void 0 ? void 0 : (_$Encounter3$practiti2 = _$Encounter3$practiti[0]) === null || _$Encounter3$practiti2 === void 0 ? void 0 : _$Encounter3$practiti2.clinic,
38229
- dob: _ === null || _ === void 0 ? void 0 : (_$Appointment9 = _.Appointment) === null || _$Appointment9 === void 0 ? void 0 : (_$Appointment9$Person = _$Appointment9.PersonID) === null || _$Appointment9$Person === void 0 ? void 0 : (_$Appointment9$Person2 = _$Appointment9$Person[0]) === null || _$Appointment9$Person2 === void 0 ? void 0 : _$Appointment9$Person2.birthDay,
38230
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment10 = _.Appointment) === null || _$Appointment10 === void 0 ? void 0 : (_$Appointment10$Perso = _$Appointment10.PersonID) === null || _$Appointment10$Perso === void 0 ? void 0 : (_$Appointment10$Perso2 = _$Appointment10$Perso[0]) === null || _$Appointment10$Perso2 === void 0 ? void 0 : _$Appointment10$Perso2.gender,
38231
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter4 = _.Encounter) === null || _$Encounter4 === void 0 ? void 0 : (_$Encounter4$patient_ = _$Encounter4.patient_id) === null || _$Encounter4$patient_ === void 0 ? void 0 : (_$Encounter4$patient_2 = _$Encounter4$patient_[0]) === null || _$Encounter4$patient_2 === void 0 ? void 0 : (_$Encounter4$patient_3 = _$Encounter4$patient_2.telecom) === null || _$Encounter4$patient_3 === void 0 ? void 0 : (_$Encounter4$patient_4 = _$Encounter4$patient_3[0]) === null || _$Encounter4$patient_4 === void 0 ? void 0 : _$Encounter4$patient_4.value,
38232
- visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter5 = _.Encounter) === null || _$Encounter5 === void 0 ? void 0 : _$Encounter5.visit_type,
38233
- appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter6 = _.Encounter) === null || _$Encounter6 === void 0 ? void 0 : (_$Encounter6$status = _$Encounter6.status) === null || _$Encounter6$status === void 0 ? void 0 : _$Encounter6$status.display,
38234
- appNo: (_$Encounter$appointme = _ === null || _ === void 0 ? void 0 : (_$Encounter7 = _.Encounter) === null || _$Encounter7 === void 0 ? void 0 : (_$Encounter7$appointm = _$Encounter7.appointmentId) === null || _$Encounter7$appointm === void 0 ? void 0 : _$Encounter7$appointm[0]) !== null && _$Encounter$appointme !== void 0 ? _$Encounter$appointme : "",
38235
- type: "OP",
38236
- "Register Visit": true,
38237
- "Modify Appointment": true,
38238
- "Cancel Appointment": true,
38239
- "View Profile": true,
38240
- data: _
38235
+ // date: _?.Appointment?.start
38236
+ // ? utcTOLocal(_?.Appointment?.start, "DD MMM,YYYY")
38237
+ // : "",
38238
+ // time: _?.Appointment?.start
38239
+ // ? utcTOLocal(_?.Appointment?.start, "hh:mm A")
38240
+ // : "",
38241
+ date: "".concat((_ === null || _ === void 0 ? void 0 : (_$Appointment4 = _.Appointment) === null || _$Appointment4 === void 0 ? void 0 : _$Appointment4.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment5 = _.Appointment) === null || _$Appointment5 === void 0 ? void 0 : _$Appointment5.start, "DD MMM,YYYY") : "", ",").concat((_ === null || _ === void 0 ? void 0 : (_$Appointment6 = _.Appointment) === null || _$Appointment6 === void 0 ? void 0 : _$Appointment6.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment7 = _.Appointment) === null || _$Appointment7 === void 0 ? void 0 : _$Appointment7.start, "hh:mm A") : ""),
38242
+ // speciality: _?.Appointment?.SpecialtyID?.map((spl) => {
38243
+ // return spl?.coding?.[0]?.display;
38244
+ // }).join(", "),
38245
+ // clinic: _?.Encounter?.practitioner_details?.[0]?.clinic,
38246
+ // dob: _?.Appointment?.PersonID?.[0]?.birthDay,
38247
+ // gender: _?.Appointment?.PersonID?.[0]?.gender,
38248
+ contact: (_$Appointment$PersonI4 = _ === null || _ === void 0 ? void 0 : (_$Appointment8 = _.Appointment) === null || _$Appointment8 === void 0 ? void 0 : (_$Appointment8$Person = _$Appointment8.PersonID) === null || _$Appointment8$Person === void 0 ? void 0 : (_$Appointment8$Person2 = _$Appointment8$Person[0]) === null || _$Appointment8$Person2 === void 0 ? void 0 : (_$Appointment8$Person3 = _$Appointment8$Person2.telecom) === null || _$Appointment8$Person3 === void 0 ? void 0 : (_$Appointment8$Person4 = _$Appointment8$Person3[0]) === null || _$Appointment8$Person4 === void 0 ? void 0 : _$Appointment8$Person4.value) !== null && _$Appointment$PersonI4 !== void 0 ? _$Appointment$PersonI4 : "",
38249
+ visitType: (_$Appointment$appoint = _ === null || _ === void 0 ? void 0 : (_$Appointment9 = _.Appointment) === null || _$Appointment9 === void 0 ? void 0 : _$Appointment9.appointmentType) !== null && _$Appointment$appoint !== void 0 ? _$Appointment$appoint : "",
38250
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$Appointment10 = _.Appointment) === null || _$Appointment10 === void 0 ? void 0 : _$Appointment10.appstatus) || "",
38251
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$Appointment11 = _.Appointment) === null || _$Appointment11 === void 0 ? void 0 : _$Appointment11.appno) || "",
38252
+ // type: "OP",
38253
+ // "Register Visit": true,
38254
+ // "Modify Appointment": true,
38255
+ // "Cancel Appointment": true,
38256
+ // "View Profile": true,
38257
+ // data: _,
38258
+ viewaction: JSON.stringify({
38259
+ appNo: _.Appointment.id
38260
+ }),
38261
+ modifyaction: JSON.stringify({
38262
+ appNo: _.Appointment.id
38263
+ }),
38264
+ cancelaction: JSON.stringify({
38265
+ appNo: _.Appointment.id
38266
+ })
38241
38267
  };
38242
38268
  }) : [];
38243
38269
  return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -38282,34 +38308,64 @@ var GET_FIRST_VISITS = createAsyncThunk("appointmentStatsApiSlice/getFirstVisits
38282
38308
  case 5:
38283
38309
  data = _context2.sent;
38284
38310
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result2 = data.result) === null || _data$result2 === void 0 ? void 0 : _data$result2.map(function (_) {
38285
- var _$Appointment11, _$Appointment11$Perso, _$Appointment11$Perso2, _$Appointment11$Perso3, _$Appointment11$Perso4, _$Appointment12, _$Appointment12$Perso, _$Appointment12$Perso2, _$Appointment12$Perso3, _$Appointment12$Perso4, _$Encounter8, _$Encounter8$patient_, _$Encounter8$patient_2, _$Encounter8$patient_3, _$Encounter9, _$Encounter9$patient_, _$Encounter9$patient_2, _$Appointment13, _$Appointment14, _$Appointment15, _$Appointment16, _$Appointment17, _$Appointment17$Speci, _$Encounter10, _$Encounter10$practit, _$Encounter10$practit2, _$Appointment18, _$Appointment18$Perso, _$Appointment18$Perso2, _$Encounter11, _$Encounter11$patient, _$Encounter11$patient2, _$Encounter11$patient3, _$Encounter11$patient4, _$Encounter12, _$Encounter13, _$Encounter13$status, _$Encounter$appointme2, _$Encounter14, _$Encounter14$appoint, _$Appointment19, _$Appointment19$Perso, _$Appointment19$Perso2, _$Appointment20, _$Appointment20$Perso, _$Appointment20$Perso2;
38311
+ var _$Appointment12, _$Appointment12$Perso, _$Appointment12$Perso2, _$Appointment12$Perso3, _$Appointment12$Perso4, _$Appointment13, _$Appointment13$Perso, _$Appointment13$Perso2, _$Appointment13$Perso3, _$Appointment13$Perso4, _$Encounter, _$Encounter$patient_i, _$Encounter$patient_i2, _$Encounter$patient_i3, _$Encounter2, _$Encounter2$patient_, _$Encounter2$patient_2, _$Appointment14, _$Appointment14$Perso, _$Appointment14$Perso2, _$Appointment15, _$Appointment16, _$Appointment17, _$Appointment18, _$Encounter3, _$Encounter4, _$Encounter4$status, _$Encounter$appointme, _$Encounter5, _$Encounter5$appointm, _$Encounter$appointme2, _$Encounter6, _$Encounter6$appointm, _$Encounter7, _$Encounter7$patient_, _$Encounter7$patient_2, _$Encounter7$patient_3, _$Encounter7$patient_4, _$Appointment$PersonI5, _$Appointment19, _$Appointment19$Perso, _$Appointment19$Perso2, _$Encounter$patient_i4, _$Encounter8, _$Encounter8$patient_, _$Encounter8$patient_2, _$Encounter$appointme3, _$Encounter9, _$Encounter9$appointm, _$Encounter10, _$Encounter10$patient, _$Encounter10$patient2, _$Encounter10$patient3, _$Encounter10$patient4, _$Appointment$PersonI6, _$Appointment20, _$Appointment20$Perso, _$Appointment20$Perso2, _$Encounter$patient_i5, _$Encounter11, _$Encounter11$patient, _$Encounter11$patient2, _$Encounter$appointme4, _$Encounter12, _$Encounter12$appoint, _$Encounter13, _$Encounter13$patient, _$Encounter13$patient2, _$Encounter13$patient3, _$Encounter13$patient4, _$Appointment$PersonI7, _$Appointment21, _$Appointment21$Perso, _$Appointment21$Perso2, _$Encounter$patient_i6, _$Encounter14, _$Encounter14$patient, _$Encounter14$patient2;
38286
38312
 
38287
38313
  return {
38288
- img: (_ === null || _ === void 0 ? void 0 : (_$Appointment11 = _.Appointment) === null || _$Appointment11 === void 0 ? void 0 : (_$Appointment11$Perso = _$Appointment11.PersonID) === null || _$Appointment11$Perso === void 0 ? void 0 : (_$Appointment11$Perso2 = _$Appointment11$Perso[0]) === null || _$Appointment11$Perso2 === void 0 ? void 0 : (_$Appointment11$Perso3 = _$Appointment11$Perso2.photo) === null || _$Appointment11$Perso3 === void 0 ? void 0 : (_$Appointment11$Perso4 = _$Appointment11$Perso3[0]) === null || _$Appointment11$Perso4 === void 0 ? void 0 : _$Appointment11$Perso4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$Appointment12 = _.Appointment) === null || _$Appointment12 === void 0 ? void 0 : (_$Appointment12$Perso = _$Appointment12.PersonID) === null || _$Appointment12$Perso === void 0 ? void 0 : (_$Appointment12$Perso2 = _$Appointment12$Perso[0]) === null || _$Appointment12$Perso2 === void 0 ? void 0 : (_$Appointment12$Perso3 = _$Appointment12$Perso2.photo) === null || _$Appointment12$Perso3 === void 0 ? void 0 : (_$Appointment12$Perso4 = _$Appointment12$Perso3[0]) === null || _$Appointment12$Perso4 === void 0 ? void 0 : _$Appointment12$Perso4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38289
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter8 = _.Encounter) === null || _$Encounter8 === void 0 ? void 0 : (_$Encounter8$patient_ = _$Encounter8.patient_id) === null || _$Encounter8$patient_ === void 0 ? void 0 : (_$Encounter8$patient_2 = _$Encounter8$patient_[0]) === null || _$Encounter8$patient_2 === void 0 ? void 0 : (_$Encounter8$patient_3 = _$Encounter8$patient_2.name) === null || _$Encounter8$patient_3 === void 0 ? void 0 : _$Encounter8$patient_3[0]) || {}),
38290
- mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter9 = _.Encounter) === null || _$Encounter9 === void 0 ? void 0 : (_$Encounter9$patient_ = _$Encounter9.patient_id) === null || _$Encounter9$patient_ === void 0 ? void 0 : (_$Encounter9$patient_2 = _$Encounter9$patient_[0]) === null || _$Encounter9$patient_2 === void 0 ? void 0 : _$Encounter9$patient_2.MRN,
38291
- date: (_ === null || _ === void 0 ? void 0 : (_$Appointment13 = _.Appointment) === null || _$Appointment13 === void 0 ? void 0 : _$Appointment13.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment14 = _.Appointment) === null || _$Appointment14 === void 0 ? void 0 : _$Appointment14.start, "DD MMM,YYYY") : "",
38292
- time: (_ === null || _ === void 0 ? void 0 : (_$Appointment15 = _.Appointment) === null || _$Appointment15 === void 0 ? void 0 : _$Appointment15.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment16 = _.Appointment) === null || _$Appointment16 === void 0 ? void 0 : _$Appointment16.start, "hh:mm A") : "",
38293
- speciality: _ === null || _ === void 0 ? void 0 : (_$Appointment17 = _.Appointment) === null || _$Appointment17 === void 0 ? void 0 : (_$Appointment17$Speci = _$Appointment17.SpecialtyID) === null || _$Appointment17$Speci === void 0 ? void 0 : _$Appointment17$Speci.map(function (spl) {
38294
- var _spl$coding2, _spl$coding2$;
38295
-
38296
- return spl === null || spl === void 0 ? void 0 : (_spl$coding2 = spl.coding) === null || _spl$coding2 === void 0 ? void 0 : (_spl$coding2$ = _spl$coding2[0]) === null || _spl$coding2$ === void 0 ? void 0 : _spl$coding2$.display;
38297
- }).join(", "),
38298
- clinic: _ === null || _ === void 0 ? void 0 : (_$Encounter10 = _.Encounter) === null || _$Encounter10 === void 0 ? void 0 : (_$Encounter10$practit = _$Encounter10.practitioner_details) === null || _$Encounter10$practit === void 0 ? void 0 : (_$Encounter10$practit2 = _$Encounter10$practit[0]) === null || _$Encounter10$practit2 === void 0 ? void 0 : _$Encounter10$practit2.clinic,
38299
- dob: _ === null || _ === void 0 ? void 0 : (_$Appointment18 = _.Appointment) === null || _$Appointment18 === void 0 ? void 0 : (_$Appointment18$Perso = _$Appointment18.PersonID) === null || _$Appointment18$Perso === void 0 ? void 0 : (_$Appointment18$Perso2 = _$Appointment18$Perso[0]) === null || _$Appointment18$Perso2 === void 0 ? void 0 : _$Appointment18$Perso2.birthDay,
38300
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter11 = _.Encounter) === null || _$Encounter11 === void 0 ? void 0 : (_$Encounter11$patient = _$Encounter11.patient_id) === null || _$Encounter11$patient === void 0 ? void 0 : (_$Encounter11$patient2 = _$Encounter11$patient[0]) === null || _$Encounter11$patient2 === void 0 ? void 0 : (_$Encounter11$patient3 = _$Encounter11$patient2.telecom) === null || _$Encounter11$patient3 === void 0 ? void 0 : (_$Encounter11$patient4 = _$Encounter11$patient3[0]) === null || _$Encounter11$patient4 === void 0 ? void 0 : _$Encounter11$patient4.value,
38301
- visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter12 = _.Encounter) === null || _$Encounter12 === void 0 ? void 0 : _$Encounter12.visit_type,
38302
- appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter13 = _.Encounter) === null || _$Encounter13 === void 0 ? void 0 : (_$Encounter13$status = _$Encounter13.status) === null || _$Encounter13$status === void 0 ? void 0 : _$Encounter13$status.display,
38303
- type: "OP",
38304
- appNo: (_$Encounter$appointme2 = _ === null || _ === void 0 ? void 0 : (_$Encounter14 = _.Encounter) === null || _$Encounter14 === void 0 ? void 0 : (_$Encounter14$appoint = _$Encounter14.appointmentId) === null || _$Encounter14$appoint === void 0 ? void 0 : _$Encounter14$appoint[0]) !== null && _$Encounter$appointme2 !== void 0 ? _$Encounter$appointme2 : "",
38305
- data: _,
38306
- enId: _.Encounter.id,
38307
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment19 = _.Appointment) === null || _$Appointment19 === void 0 ? void 0 : (_$Appointment19$Perso = _$Appointment19.PersonID) === null || _$Appointment19$Perso === void 0 ? void 0 : (_$Appointment19$Perso2 = _$Appointment19$Perso[0]) === null || _$Appointment19$Perso2 === void 0 ? void 0 : _$Appointment19$Perso2.birthDay),
38308
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment20 = _.Appointment) === null || _$Appointment20 === void 0 ? void 0 : (_$Appointment20$Perso = _$Appointment20.PersonID) === null || _$Appointment20$Perso === void 0 ? void 0 : (_$Appointment20$Perso2 = _$Appointment20$Perso[0]) === null || _$Appointment20$Perso2 === void 0 ? void 0 : _$Appointment20$Perso2.gender,
38309
- "Register Visit": true,
38310
- "Modify Appointment": true,
38311
- "Cancel Appointment": true,
38312
- "View Profile": true
38314
+ img: (_ === null || _ === void 0 ? void 0 : (_$Appointment12 = _.Appointment) === null || _$Appointment12 === void 0 ? void 0 : (_$Appointment12$Perso = _$Appointment12.PersonID) === null || _$Appointment12$Perso === void 0 ? void 0 : (_$Appointment12$Perso2 = _$Appointment12$Perso[0]) === null || _$Appointment12$Perso2 === void 0 ? void 0 : (_$Appointment12$Perso3 = _$Appointment12$Perso2.photo) === null || _$Appointment12$Perso3 === void 0 ? void 0 : (_$Appointment12$Perso4 = _$Appointment12$Perso3[0]) === null || _$Appointment12$Perso4 === void 0 ? void 0 : _$Appointment12$Perso4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$Appointment13 = _.Appointment) === null || _$Appointment13 === void 0 ? void 0 : (_$Appointment13$Perso = _$Appointment13.PersonID) === null || _$Appointment13$Perso === void 0 ? void 0 : (_$Appointment13$Perso2 = _$Appointment13$Perso[0]) === null || _$Appointment13$Perso2 === void 0 ? void 0 : (_$Appointment13$Perso3 = _$Appointment13$Perso2.photo) === null || _$Appointment13$Perso3 === void 0 ? void 0 : (_$Appointment13$Perso4 = _$Appointment13$Perso3[0]) === null || _$Appointment13$Perso4 === void 0 ? void 0 : _$Appointment13$Perso4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38315
+ // name: makeName(_?.Encounter?.patient_id?.[0]?.name?.[0] || {}),
38316
+ // mrn: _?.Encounter?.patient_id?.[0]?.MRN,
38317
+ // date: _?.Appointment?.start
38318
+ // ? utcTOLocal(_?.Appointment?.start, "DD MMM,YYYY")
38319
+ // : "",
38320
+ // time: _?.Appointment?.start
38321
+ // ? utcTOLocal(_?.Appointment?.start, "hh:mm A")
38322
+ // : "",
38323
+ // speciality: _?.Appointment?.SpecialtyID?.map((spl) => {
38324
+ // return spl?.coding?.[0]?.display;
38325
+ // }).join(", "),
38326
+ // clinic: _?.Encounter?.practitioner_details?.[0]?.clinic,
38327
+ // dob: _?.Appointment?.PersonID?.[0]?.birthDay,
38328
+ // contact: _?.Encounter?.patient_id?.[0]?.telecom?.[0]?.value,
38329
+ // visitType: _?.Encounter?.visit_type,
38330
+ // appointmentStatus: _?.Encounter?.status?.display,
38331
+ // type: "OP",
38332
+ // appNo: _?.Encounter?.appointmentId?.[0] ?? "",
38333
+ // data: _,
38334
+ // enId: _.Encounter.id,
38335
+ // age: getAge(_?.Appointment?.PersonID?.[0]?.birthDay),
38336
+ // gender: _?.Appointment?.PersonID?.[0]?.gender,
38337
+ // "Register Visit": true,
38338
+ // "Modify Appointment": true,
38339
+ // "Cancel Appointment": true,
38340
+ // "View Profile": true,
38341
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter = _.Encounter) === null || _$Encounter === void 0 ? void 0 : (_$Encounter$patient_i = _$Encounter.patient_id) === null || _$Encounter$patient_i === void 0 ? void 0 : (_$Encounter$patient_i2 = _$Encounter$patient_i[0]) === null || _$Encounter$patient_i2 === void 0 ? void 0 : (_$Encounter$patient_i3 = _$Encounter$patient_i2.name) === null || _$Encounter$patient_i3 === void 0 ? void 0 : _$Encounter$patient_i3[0]) || {}),
38342
+ mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter2 = _.Encounter) === null || _$Encounter2 === void 0 ? void 0 : (_$Encounter2$patient_ = _$Encounter2.patient_id) === null || _$Encounter2$patient_ === void 0 ? void 0 : (_$Encounter2$patient_2 = _$Encounter2$patient_[0]) === null || _$Encounter2$patient_2 === void 0 ? void 0 : _$Encounter2$patient_2.MRN,
38343
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment14 = _.Appointment) === null || _$Appointment14 === void 0 ? void 0 : (_$Appointment14$Perso = _$Appointment14.PersonID) === null || _$Appointment14$Perso === void 0 ? void 0 : (_$Appointment14$Perso2 = _$Appointment14$Perso[0]) === null || _$Appointment14$Perso2 === void 0 ? void 0 : _$Appointment14$Perso2.birthDay),
38344
+ date: "".concat((_ === null || _ === void 0 ? void 0 : (_$Appointment15 = _.Appointment) === null || _$Appointment15 === void 0 ? void 0 : _$Appointment15.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment16 = _.Appointment) === null || _$Appointment16 === void 0 ? void 0 : _$Appointment16.start, "DD MMM,YYYY") : "", ",").concat((_ === null || _ === void 0 ? void 0 : (_$Appointment17 = _.Appointment) === null || _$Appointment17 === void 0 ? void 0 : _$Appointment17.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment18 = _.Appointment) === null || _$Appointment18 === void 0 ? void 0 : _$Appointment18.start, "hh:mm A") : ""),
38345
+ visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter3 = _.Encounter) === null || _$Encounter3 === void 0 ? void 0 : _$Encounter3.visit_type,
38346
+ appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter4 = _.Encounter) === null || _$Encounter4 === void 0 ? void 0 : (_$Encounter4$status = _$Encounter4.status) === null || _$Encounter4$status === void 0 ? void 0 : _$Encounter4$status.display,
38347
+ refNo: (_$Encounter$appointme = _ === null || _ === void 0 ? void 0 : (_$Encounter5 = _.Encounter) === null || _$Encounter5 === void 0 ? void 0 : (_$Encounter5$appointm = _$Encounter5.appointmentId) === null || _$Encounter5$appointm === void 0 ? void 0 : _$Encounter5$appointm[0]) !== null && _$Encounter$appointme !== void 0 ? _$Encounter$appointme : "",
38348
+ viewaction: JSON.stringify({
38349
+ appNo: (_$Encounter$appointme2 = _ === null || _ === void 0 ? void 0 : (_$Encounter6 = _.Encounter) === null || _$Encounter6 === void 0 ? void 0 : (_$Encounter6$appointm = _$Encounter6.appointmentId) === null || _$Encounter6$appointm === void 0 ? void 0 : _$Encounter6$appointm[0]) !== null && _$Encounter$appointme2 !== void 0 ? _$Encounter$appointme2 : "",
38350
+ enId: _.Encounter.id,
38351
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter7 = _.Encounter) === null || _$Encounter7 === void 0 ? void 0 : (_$Encounter7$patient_ = _$Encounter7.patient_id) === null || _$Encounter7$patient_ === void 0 ? void 0 : (_$Encounter7$patient_2 = _$Encounter7$patient_[0]) === null || _$Encounter7$patient_2 === void 0 ? void 0 : (_$Encounter7$patient_3 = _$Encounter7$patient_2.telecom) === null || _$Encounter7$patient_3 === void 0 ? void 0 : (_$Encounter7$patient_4 = _$Encounter7$patient_3[0]) === null || _$Encounter7$patient_4 === void 0 ? void 0 : _$Encounter7$patient_4.value,
38352
+ personId: (_$Appointment$PersonI5 = _ === null || _ === void 0 ? void 0 : (_$Appointment19 = _.Appointment) === null || _$Appointment19 === void 0 ? void 0 : (_$Appointment19$Perso = _$Appointment19.PersonID) === null || _$Appointment19$Perso === void 0 ? void 0 : (_$Appointment19$Perso2 = _$Appointment19$Perso[0]) === null || _$Appointment19$Perso2 === void 0 ? void 0 : _$Appointment19$Perso2.Id) !== null && _$Appointment$PersonI5 !== void 0 ? _$Appointment$PersonI5 : null,
38353
+ patientId: (_$Encounter$patient_i4 = _ === null || _ === void 0 ? void 0 : (_$Encounter8 = _.Encounter) === null || _$Encounter8 === void 0 ? void 0 : (_$Encounter8$patient_ = _$Encounter8.patient_id) === null || _$Encounter8$patient_ === void 0 ? void 0 : (_$Encounter8$patient_2 = _$Encounter8$patient_[0]) === null || _$Encounter8$patient_2 === void 0 ? void 0 : _$Encounter8$patient_2.id) !== null && _$Encounter$patient_i4 !== void 0 ? _$Encounter$patient_i4 : null
38354
+ }),
38355
+ modifyaction: JSON.stringify({
38356
+ appNo: (_$Encounter$appointme3 = _ === null || _ === void 0 ? void 0 : (_$Encounter9 = _.Encounter) === null || _$Encounter9 === void 0 ? void 0 : (_$Encounter9$appointm = _$Encounter9.appointmentId) === null || _$Encounter9$appointm === void 0 ? void 0 : _$Encounter9$appointm[0]) !== null && _$Encounter$appointme3 !== void 0 ? _$Encounter$appointme3 : "",
38357
+ enId: _.Encounter.id,
38358
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter10 = _.Encounter) === null || _$Encounter10 === void 0 ? void 0 : (_$Encounter10$patient = _$Encounter10.patient_id) === null || _$Encounter10$patient === void 0 ? void 0 : (_$Encounter10$patient2 = _$Encounter10$patient[0]) === null || _$Encounter10$patient2 === void 0 ? void 0 : (_$Encounter10$patient3 = _$Encounter10$patient2.telecom) === null || _$Encounter10$patient3 === void 0 ? void 0 : (_$Encounter10$patient4 = _$Encounter10$patient3[0]) === null || _$Encounter10$patient4 === void 0 ? void 0 : _$Encounter10$patient4.value,
38359
+ personId: (_$Appointment$PersonI6 = _ === null || _ === void 0 ? void 0 : (_$Appointment20 = _.Appointment) === null || _$Appointment20 === void 0 ? void 0 : (_$Appointment20$Perso = _$Appointment20.PersonID) === null || _$Appointment20$Perso === void 0 ? void 0 : (_$Appointment20$Perso2 = _$Appointment20$Perso[0]) === null || _$Appointment20$Perso2 === void 0 ? void 0 : _$Appointment20$Perso2.Id) !== null && _$Appointment$PersonI6 !== void 0 ? _$Appointment$PersonI6 : null,
38360
+ patientId: (_$Encounter$patient_i5 = _ === null || _ === void 0 ? void 0 : (_$Encounter11 = _.Encounter) === null || _$Encounter11 === void 0 ? void 0 : (_$Encounter11$patient = _$Encounter11.patient_id) === null || _$Encounter11$patient === void 0 ? void 0 : (_$Encounter11$patient2 = _$Encounter11$patient[0]) === null || _$Encounter11$patient2 === void 0 ? void 0 : _$Encounter11$patient2.id) !== null && _$Encounter$patient_i5 !== void 0 ? _$Encounter$patient_i5 : null
38361
+ }),
38362
+ cancelaction: JSON.stringify({
38363
+ appNo: (_$Encounter$appointme4 = _ === null || _ === void 0 ? void 0 : (_$Encounter12 = _.Encounter) === null || _$Encounter12 === void 0 ? void 0 : (_$Encounter12$appoint = _$Encounter12.appointmentId) === null || _$Encounter12$appoint === void 0 ? void 0 : _$Encounter12$appoint[0]) !== null && _$Encounter$appointme4 !== void 0 ? _$Encounter$appointme4 : "",
38364
+ enId: _.Encounter.id,
38365
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter13 = _.Encounter) === null || _$Encounter13 === void 0 ? void 0 : (_$Encounter13$patient = _$Encounter13.patient_id) === null || _$Encounter13$patient === void 0 ? void 0 : (_$Encounter13$patient2 = _$Encounter13$patient[0]) === null || _$Encounter13$patient2 === void 0 ? void 0 : (_$Encounter13$patient3 = _$Encounter13$patient2.telecom) === null || _$Encounter13$patient3 === void 0 ? void 0 : (_$Encounter13$patient4 = _$Encounter13$patient3[0]) === null || _$Encounter13$patient4 === void 0 ? void 0 : _$Encounter13$patient4.value,
38366
+ personId: (_$Appointment$PersonI7 = _ === null || _ === void 0 ? void 0 : (_$Appointment21 = _.Appointment) === null || _$Appointment21 === void 0 ? void 0 : (_$Appointment21$Perso = _$Appointment21.PersonID) === null || _$Appointment21$Perso === void 0 ? void 0 : (_$Appointment21$Perso2 = _$Appointment21$Perso[0]) === null || _$Appointment21$Perso2 === void 0 ? void 0 : _$Appointment21$Perso2.Id) !== null && _$Appointment$PersonI7 !== void 0 ? _$Appointment$PersonI7 : null,
38367
+ patientId: (_$Encounter$patient_i6 = _ === null || _ === void 0 ? void 0 : (_$Encounter14 = _.Encounter) === null || _$Encounter14 === void 0 ? void 0 : (_$Encounter14$patient = _$Encounter14.patient_id) === null || _$Encounter14$patient === void 0 ? void 0 : (_$Encounter14$patient2 = _$Encounter14$patient[0]) === null || _$Encounter14$patient2 === void 0 ? void 0 : _$Encounter14$patient2.id) !== null && _$Encounter$patient_i6 !== void 0 ? _$Encounter$patient_i6 : null
38368
+ })
38313
38369
  };
38314
38370
  }) : [];
38315
38371
  return _context2.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -38354,34 +38410,66 @@ var GET_OTHER_VISITS = createAsyncThunk("appointmentStatsApiSlice/getOtherVisits
38354
38410
  case 5:
38355
38411
  data = _context3.sent;
38356
38412
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result3 = data.result) === null || _data$result3 === void 0 ? void 0 : _data$result3.map(function (_) {
38357
- var _$Appointment21, _$Appointment21$Perso, _$Appointment21$Perso2, _$Appointment21$Perso3, _$Appointment21$Perso4, _$Appointment22, _$Appointment22$Perso, _$Appointment22$Perso2, _$Appointment22$Perso3, _$Appointment22$Perso4, _$Encounter15, _$Encounter15$patient, _$Encounter15$patient2, _$Encounter15$patient3, _$Encounter16, _$Encounter16$patient, _$Encounter16$patient2, _$Appointment23, _$Appointment24, _$Appointment25, _$Appointment26, _$Appointment27, _$Appointment27$Speci, _$Encounter17, _$Encounter17$practit, _$Encounter17$practit2, _$Appointment28, _$Appointment28$Perso, _$Appointment28$Perso2, _$Encounter$appointme3, _$Encounter18, _$Encounter18$appoint, _$Appointment29, _$Appointment29$Perso, _$Appointment29$Perso2, _$Appointment30, _$Appointment30$Perso, _$Appointment30$Perso2, _$Encounter19, _$Encounter19$patient, _$Encounter19$patient2, _$Encounter19$patient3, _$Encounter19$patient4, _$Encounter20, _$Encounter21, _$Encounter21$status;
38413
+ var _$Encounter15, _$Encounter15$patient, _$Encounter15$patient2, _$Encounter15$patient3, _$Encounter16, _$Encounter16$patient, _$Encounter16$patient2, _$Appointment22, _$Appointment22$Perso, _$Appointment22$Perso2, _$Appointment23, _$Appointment24, _$Appointment25, _$Appointment26, _$Encounter17, _$Encounter18, _$Encounter18$status, _$Encounter$appointme5, _$Encounter19, _$Encounter19$appoint, _$Encounter$appointme6, _$Encounter20, _$Encounter20$appoint, _$Encounter21, _$Encounter21$patient, _$Encounter21$patient2, _$Encounter21$patient3, _$Encounter21$patient4, _$Appointment$PersonI8, _$Appointment27, _$Appointment27$Perso, _$Appointment27$Perso2, _$Encounter$patient_i7, _$Encounter22, _$Encounter22$patient, _$Encounter22$patient2, _$Encounter$appointme7, _$Encounter23, _$Encounter23$appoint, _$Encounter24, _$Encounter24$patient, _$Encounter24$patient2, _$Encounter24$patient3, _$Encounter24$patient4, _$Appointment$PersonI9, _$Appointment28, _$Appointment28$Perso, _$Appointment28$Perso2, _$Encounter$patient_i8, _$Encounter25, _$Encounter25$patient, _$Encounter25$patient2, _$Encounter$appointme8, _$Encounter26, _$Encounter26$appoint, _$Encounter27, _$Encounter27$patient, _$Encounter27$patient2, _$Encounter27$patient3, _$Encounter27$patient4, _$Appointment$PersonI10, _$Appointment29, _$Appointment29$Perso, _$Appointment29$Perso2, _$Encounter$patient_i9, _$Encounter28, _$Encounter28$patient, _$Encounter28$patient2;
38358
38414
 
38359
38415
  return {
38360
- img: (_ === null || _ === void 0 ? void 0 : (_$Appointment21 = _.Appointment) === null || _$Appointment21 === void 0 ? void 0 : (_$Appointment21$Perso = _$Appointment21.PersonID) === null || _$Appointment21$Perso === void 0 ? void 0 : (_$Appointment21$Perso2 = _$Appointment21$Perso[0]) === null || _$Appointment21$Perso2 === void 0 ? void 0 : (_$Appointment21$Perso3 = _$Appointment21$Perso2.photo) === null || _$Appointment21$Perso3 === void 0 ? void 0 : (_$Appointment21$Perso4 = _$Appointment21$Perso3[0]) === null || _$Appointment21$Perso4 === void 0 ? void 0 : _$Appointment21$Perso4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$Appointment22 = _.Appointment) === null || _$Appointment22 === void 0 ? void 0 : (_$Appointment22$Perso = _$Appointment22.PersonID) === null || _$Appointment22$Perso === void 0 ? void 0 : (_$Appointment22$Perso2 = _$Appointment22$Perso[0]) === null || _$Appointment22$Perso2 === void 0 ? void 0 : (_$Appointment22$Perso3 = _$Appointment22$Perso2.photo) === null || _$Appointment22$Perso3 === void 0 ? void 0 : (_$Appointment22$Perso4 = _$Appointment22$Perso3[0]) === null || _$Appointment22$Perso4 === void 0 ? void 0 : _$Appointment22$Perso4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38416
+ // img: _?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid
38417
+ // ? getImgUrl(_?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid)
38418
+ // : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38419
+ // name: makeName(_?.Encounter?.patient_id?.[0]?.name?.[0] || {}),
38420
+ // mrn: _?.Encounter?.patient_id?.[0]?.MRN,
38421
+ // date: _?.Appointment?.start
38422
+ // ? utcTOLocal(_?.Appointment?.start, "DD MMM,YYYY")
38423
+ // : "",
38424
+ // time: _?.Appointment?.start
38425
+ // ? utcTOLocal(_?.Appointment?.start, "hh:mm A")
38426
+ // : "",
38427
+ // speciality: _?.Appointment?.SpecialtyID?.map((spl) => {
38428
+ // return spl?.coding?.[0]?.display;
38429
+ // }).join(", "),
38430
+ // clinic: _?.Encounter?.practitioner_details?.[0]?.clinic,
38431
+ // dob: _?.Appointment?.PersonID?.[0]?.birthDay,
38432
+ // type: "OP",
38433
+ // appNo: _?.Encounter?.appointmentId?.[0] ?? "",
38434
+ // data: _,
38435
+ // enId: _.Encounter.id,
38436
+ // age: getAge(_?.Appointment?.PersonID?.[0]?.birthDay),
38437
+ // gender: _?.Appointment?.PersonID?.[0]?.gender,
38438
+ // contact: _?.Encounter?.patient_id?.[0]?.telecom?.[0]?.value,
38439
+ // visitType: _?.Encounter?.visit_type,
38440
+ // appointmentStatus: _?.Encounter?.status?.display,
38441
+ // "Register Visit": true,
38442
+ // "Modify Appointment": true,
38443
+ // "Cancel Appointment": true,
38444
+ // "View Profile": true,
38361
38445
  name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter15 = _.Encounter) === null || _$Encounter15 === void 0 ? void 0 : (_$Encounter15$patient = _$Encounter15.patient_id) === null || _$Encounter15$patient === void 0 ? void 0 : (_$Encounter15$patient2 = _$Encounter15$patient[0]) === null || _$Encounter15$patient2 === void 0 ? void 0 : (_$Encounter15$patient3 = _$Encounter15$patient2.name) === null || _$Encounter15$patient3 === void 0 ? void 0 : _$Encounter15$patient3[0]) || {}),
38362
38446
  mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter16 = _.Encounter) === null || _$Encounter16 === void 0 ? void 0 : (_$Encounter16$patient = _$Encounter16.patient_id) === null || _$Encounter16$patient === void 0 ? void 0 : (_$Encounter16$patient2 = _$Encounter16$patient[0]) === null || _$Encounter16$patient2 === void 0 ? void 0 : _$Encounter16$patient2.MRN,
38363
- date: (_ === null || _ === void 0 ? void 0 : (_$Appointment23 = _.Appointment) === null || _$Appointment23 === void 0 ? void 0 : _$Appointment23.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment24 = _.Appointment) === null || _$Appointment24 === void 0 ? void 0 : _$Appointment24.start, "DD MMM,YYYY") : "",
38364
- time: (_ === null || _ === void 0 ? void 0 : (_$Appointment25 = _.Appointment) === null || _$Appointment25 === void 0 ? void 0 : _$Appointment25.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment26 = _.Appointment) === null || _$Appointment26 === void 0 ? void 0 : _$Appointment26.start, "hh:mm A") : "",
38365
- speciality: _ === null || _ === void 0 ? void 0 : (_$Appointment27 = _.Appointment) === null || _$Appointment27 === void 0 ? void 0 : (_$Appointment27$Speci = _$Appointment27.SpecialtyID) === null || _$Appointment27$Speci === void 0 ? void 0 : _$Appointment27$Speci.map(function (spl) {
38366
- var _spl$coding3, _spl$coding3$;
38367
-
38368
- return spl === null || spl === void 0 ? void 0 : (_spl$coding3 = spl.coding) === null || _spl$coding3 === void 0 ? void 0 : (_spl$coding3$ = _spl$coding3[0]) === null || _spl$coding3$ === void 0 ? void 0 : _spl$coding3$.display;
38369
- }).join(", "),
38370
- clinic: _ === null || _ === void 0 ? void 0 : (_$Encounter17 = _.Encounter) === null || _$Encounter17 === void 0 ? void 0 : (_$Encounter17$practit = _$Encounter17.practitioner_details) === null || _$Encounter17$practit === void 0 ? void 0 : (_$Encounter17$practit2 = _$Encounter17$practit[0]) === null || _$Encounter17$practit2 === void 0 ? void 0 : _$Encounter17$practit2.clinic,
38371
- dob: _ === null || _ === void 0 ? void 0 : (_$Appointment28 = _.Appointment) === null || _$Appointment28 === void 0 ? void 0 : (_$Appointment28$Perso = _$Appointment28.PersonID) === null || _$Appointment28$Perso === void 0 ? void 0 : (_$Appointment28$Perso2 = _$Appointment28$Perso[0]) === null || _$Appointment28$Perso2 === void 0 ? void 0 : _$Appointment28$Perso2.birthDay,
38372
- type: "OP",
38373
- appNo: (_$Encounter$appointme3 = _ === null || _ === void 0 ? void 0 : (_$Encounter18 = _.Encounter) === null || _$Encounter18 === void 0 ? void 0 : (_$Encounter18$appoint = _$Encounter18.appointmentId) === null || _$Encounter18$appoint === void 0 ? void 0 : _$Encounter18$appoint[0]) !== null && _$Encounter$appointme3 !== void 0 ? _$Encounter$appointme3 : "",
38374
- data: _,
38375
- enId: _.Encounter.id,
38376
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment29 = _.Appointment) === null || _$Appointment29 === void 0 ? void 0 : (_$Appointment29$Perso = _$Appointment29.PersonID) === null || _$Appointment29$Perso === void 0 ? void 0 : (_$Appointment29$Perso2 = _$Appointment29$Perso[0]) === null || _$Appointment29$Perso2 === void 0 ? void 0 : _$Appointment29$Perso2.birthDay),
38377
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment30 = _.Appointment) === null || _$Appointment30 === void 0 ? void 0 : (_$Appointment30$Perso = _$Appointment30.PersonID) === null || _$Appointment30$Perso === void 0 ? void 0 : (_$Appointment30$Perso2 = _$Appointment30$Perso[0]) === null || _$Appointment30$Perso2 === void 0 ? void 0 : _$Appointment30$Perso2.gender,
38378
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter19 = _.Encounter) === null || _$Encounter19 === void 0 ? void 0 : (_$Encounter19$patient = _$Encounter19.patient_id) === null || _$Encounter19$patient === void 0 ? void 0 : (_$Encounter19$patient2 = _$Encounter19$patient[0]) === null || _$Encounter19$patient2 === void 0 ? void 0 : (_$Encounter19$patient3 = _$Encounter19$patient2.telecom) === null || _$Encounter19$patient3 === void 0 ? void 0 : (_$Encounter19$patient4 = _$Encounter19$patient3[0]) === null || _$Encounter19$patient4 === void 0 ? void 0 : _$Encounter19$patient4.value,
38379
- visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter20 = _.Encounter) === null || _$Encounter20 === void 0 ? void 0 : _$Encounter20.visit_type,
38380
- appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter21 = _.Encounter) === null || _$Encounter21 === void 0 ? void 0 : (_$Encounter21$status = _$Encounter21.status) === null || _$Encounter21$status === void 0 ? void 0 : _$Encounter21$status.display,
38381
- "Register Visit": true,
38382
- "Modify Appointment": true,
38383
- "Cancel Appointment": true,
38384
- "View Profile": true
38447
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment22 = _.Appointment) === null || _$Appointment22 === void 0 ? void 0 : (_$Appointment22$Perso = _$Appointment22.PersonID) === null || _$Appointment22$Perso === void 0 ? void 0 : (_$Appointment22$Perso2 = _$Appointment22$Perso[0]) === null || _$Appointment22$Perso2 === void 0 ? void 0 : _$Appointment22$Perso2.birthDay),
38448
+ date: "".concat((_ === null || _ === void 0 ? void 0 : (_$Appointment23 = _.Appointment) === null || _$Appointment23 === void 0 ? void 0 : _$Appointment23.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment24 = _.Appointment) === null || _$Appointment24 === void 0 ? void 0 : _$Appointment24.start, "DD MMM,YYYY") : "", ",").concat((_ === null || _ === void 0 ? void 0 : (_$Appointment25 = _.Appointment) === null || _$Appointment25 === void 0 ? void 0 : _$Appointment25.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment26 = _.Appointment) === null || _$Appointment26 === void 0 ? void 0 : _$Appointment26.start, "hh:mm A") : ""),
38449
+ visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter17 = _.Encounter) === null || _$Encounter17 === void 0 ? void 0 : _$Encounter17.visit_type,
38450
+ appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter18 = _.Encounter) === null || _$Encounter18 === void 0 ? void 0 : (_$Encounter18$status = _$Encounter18.status) === null || _$Encounter18$status === void 0 ? void 0 : _$Encounter18$status.display,
38451
+ refNo: (_$Encounter$appointme5 = _ === null || _ === void 0 ? void 0 : (_$Encounter19 = _.Encounter) === null || _$Encounter19 === void 0 ? void 0 : (_$Encounter19$appoint = _$Encounter19.appointmentId) === null || _$Encounter19$appoint === void 0 ? void 0 : _$Encounter19$appoint[0]) !== null && _$Encounter$appointme5 !== void 0 ? _$Encounter$appointme5 : "",
38452
+ viewaction: JSON.stringify({
38453
+ appNo: (_$Encounter$appointme6 = _ === null || _ === void 0 ? void 0 : (_$Encounter20 = _.Encounter) === null || _$Encounter20 === void 0 ? void 0 : (_$Encounter20$appoint = _$Encounter20.appointmentId) === null || _$Encounter20$appoint === void 0 ? void 0 : _$Encounter20$appoint[0]) !== null && _$Encounter$appointme6 !== void 0 ? _$Encounter$appointme6 : "",
38454
+ enId: _.Encounter.id,
38455
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter21 = _.Encounter) === null || _$Encounter21 === void 0 ? void 0 : (_$Encounter21$patient = _$Encounter21.patient_id) === null || _$Encounter21$patient === void 0 ? void 0 : (_$Encounter21$patient2 = _$Encounter21$patient[0]) === null || _$Encounter21$patient2 === void 0 ? void 0 : (_$Encounter21$patient3 = _$Encounter21$patient2.telecom) === null || _$Encounter21$patient3 === void 0 ? void 0 : (_$Encounter21$patient4 = _$Encounter21$patient3[0]) === null || _$Encounter21$patient4 === void 0 ? void 0 : _$Encounter21$patient4.value,
38456
+ personId: (_$Appointment$PersonI8 = _ === null || _ === void 0 ? void 0 : (_$Appointment27 = _.Appointment) === null || _$Appointment27 === void 0 ? void 0 : (_$Appointment27$Perso = _$Appointment27.PersonID) === null || _$Appointment27$Perso === void 0 ? void 0 : (_$Appointment27$Perso2 = _$Appointment27$Perso[0]) === null || _$Appointment27$Perso2 === void 0 ? void 0 : _$Appointment27$Perso2.Id) !== null && _$Appointment$PersonI8 !== void 0 ? _$Appointment$PersonI8 : null,
38457
+ patientId: (_$Encounter$patient_i7 = _ === null || _ === void 0 ? void 0 : (_$Encounter22 = _.Encounter) === null || _$Encounter22 === void 0 ? void 0 : (_$Encounter22$patient = _$Encounter22.patient_id) === null || _$Encounter22$patient === void 0 ? void 0 : (_$Encounter22$patient2 = _$Encounter22$patient[0]) === null || _$Encounter22$patient2 === void 0 ? void 0 : _$Encounter22$patient2.id) !== null && _$Encounter$patient_i7 !== void 0 ? _$Encounter$patient_i7 : null
38458
+ }),
38459
+ modifyaction: JSON.stringify({
38460
+ appNo: (_$Encounter$appointme7 = _ === null || _ === void 0 ? void 0 : (_$Encounter23 = _.Encounter) === null || _$Encounter23 === void 0 ? void 0 : (_$Encounter23$appoint = _$Encounter23.appointmentId) === null || _$Encounter23$appoint === void 0 ? void 0 : _$Encounter23$appoint[0]) !== null && _$Encounter$appointme7 !== void 0 ? _$Encounter$appointme7 : "",
38461
+ enId: _.Encounter.id,
38462
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter24 = _.Encounter) === null || _$Encounter24 === void 0 ? void 0 : (_$Encounter24$patient = _$Encounter24.patient_id) === null || _$Encounter24$patient === void 0 ? void 0 : (_$Encounter24$patient2 = _$Encounter24$patient[0]) === null || _$Encounter24$patient2 === void 0 ? void 0 : (_$Encounter24$patient3 = _$Encounter24$patient2.telecom) === null || _$Encounter24$patient3 === void 0 ? void 0 : (_$Encounter24$patient4 = _$Encounter24$patient3[0]) === null || _$Encounter24$patient4 === void 0 ? void 0 : _$Encounter24$patient4.value,
38463
+ personId: (_$Appointment$PersonI9 = _ === null || _ === void 0 ? void 0 : (_$Appointment28 = _.Appointment) === null || _$Appointment28 === void 0 ? void 0 : (_$Appointment28$Perso = _$Appointment28.PersonID) === null || _$Appointment28$Perso === void 0 ? void 0 : (_$Appointment28$Perso2 = _$Appointment28$Perso[0]) === null || _$Appointment28$Perso2 === void 0 ? void 0 : _$Appointment28$Perso2.Id) !== null && _$Appointment$PersonI9 !== void 0 ? _$Appointment$PersonI9 : null,
38464
+ patientId: (_$Encounter$patient_i8 = _ === null || _ === void 0 ? void 0 : (_$Encounter25 = _.Encounter) === null || _$Encounter25 === void 0 ? void 0 : (_$Encounter25$patient = _$Encounter25.patient_id) === null || _$Encounter25$patient === void 0 ? void 0 : (_$Encounter25$patient2 = _$Encounter25$patient[0]) === null || _$Encounter25$patient2 === void 0 ? void 0 : _$Encounter25$patient2.id) !== null && _$Encounter$patient_i8 !== void 0 ? _$Encounter$patient_i8 : null
38465
+ }),
38466
+ cancelaction: JSON.stringify({
38467
+ appNo: (_$Encounter$appointme8 = _ === null || _ === void 0 ? void 0 : (_$Encounter26 = _.Encounter) === null || _$Encounter26 === void 0 ? void 0 : (_$Encounter26$appoint = _$Encounter26.appointmentId) === null || _$Encounter26$appoint === void 0 ? void 0 : _$Encounter26$appoint[0]) !== null && _$Encounter$appointme8 !== void 0 ? _$Encounter$appointme8 : "",
38468
+ enId: _.Encounter.id,
38469
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter27 = _.Encounter) === null || _$Encounter27 === void 0 ? void 0 : (_$Encounter27$patient = _$Encounter27.patient_id) === null || _$Encounter27$patient === void 0 ? void 0 : (_$Encounter27$patient2 = _$Encounter27$patient[0]) === null || _$Encounter27$patient2 === void 0 ? void 0 : (_$Encounter27$patient3 = _$Encounter27$patient2.telecom) === null || _$Encounter27$patient3 === void 0 ? void 0 : (_$Encounter27$patient4 = _$Encounter27$patient3[0]) === null || _$Encounter27$patient4 === void 0 ? void 0 : _$Encounter27$patient4.value,
38470
+ personId: (_$Appointment$PersonI10 = _ === null || _ === void 0 ? void 0 : (_$Appointment29 = _.Appointment) === null || _$Appointment29 === void 0 ? void 0 : (_$Appointment29$Perso = _$Appointment29.PersonID) === null || _$Appointment29$Perso === void 0 ? void 0 : (_$Appointment29$Perso2 = _$Appointment29$Perso[0]) === null || _$Appointment29$Perso2 === void 0 ? void 0 : _$Appointment29$Perso2.Id) !== null && _$Appointment$PersonI10 !== void 0 ? _$Appointment$PersonI10 : null,
38471
+ patientId: (_$Encounter$patient_i9 = _ === null || _ === void 0 ? void 0 : (_$Encounter28 = _.Encounter) === null || _$Encounter28 === void 0 ? void 0 : (_$Encounter28$patient = _$Encounter28.patient_id) === null || _$Encounter28$patient === void 0 ? void 0 : (_$Encounter28$patient2 = _$Encounter28$patient[0]) === null || _$Encounter28$patient2 === void 0 ? void 0 : _$Encounter28$patient2.id) !== null && _$Encounter$patient_i9 !== void 0 ? _$Encounter$patient_i9 : null
38472
+ })
38385
38473
  };
38386
38474
  }) : [];
38387
38475
  return _context3.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -38426,34 +38514,66 @@ var GET_WALK_INS = createAsyncThunk("appointmentStatsApiSlice/getWalkIns", /*#__
38426
38514
  case 5:
38427
38515
  data = _context4.sent;
38428
38516
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result4 = data.result) === null || _data$result4 === void 0 ? void 0 : _data$result4.map(function (_) {
38429
- var _$Appointment31, _$Appointment31$Perso, _$Appointment31$Perso2, _$Appointment31$Perso3, _$Appointment31$Perso4, _$Appointment32, _$Appointment32$Perso, _$Appointment32$Perso2, _$Appointment32$Perso3, _$Appointment32$Perso4, _$Encounter22, _$Encounter22$patient, _$Encounter22$patient2, _$Encounter22$patient3, _$Encounter23, _$Encounter23$patient, _$Encounter23$patient2, _$Appointment33, _$Appointment34, _$Appointment35, _$Appointment36, _$Appointment37, _$Appointment37$Speci, _$Encounter24, _$Encounter24$practit, _$Encounter24$practit2, _$Appointment38, _$Appointment38$Perso, _$Appointment38$Perso2, _$Encounter$appointme4, _$Encounter25, _$Encounter25$appoint, _$Appointment39, _$Appointment39$Perso, _$Appointment39$Perso2, _$Appointment40, _$Appointment40$Perso, _$Appointment40$Perso2, _$Encounter26, _$Encounter26$patient, _$Encounter26$patient2, _$Encounter26$patient3, _$Encounter26$patient4, _$Encounter27, _$Encounter28, _$Encounter28$status;
38517
+ var _$Encounter29, _$Encounter29$patient, _$Encounter29$patient2, _$Encounter29$patient3, _$Encounter30, _$Encounter30$patient, _$Encounter30$patient2, _$Appointment30, _$Appointment30$Perso, _$Appointment30$Perso2, _$Appointment31, _$Appointment32, _$Appointment33, _$Appointment34, _$Encounter31, _$Encounter32, _$Encounter32$status, _$Encounter$appointme9, _$Encounter33, _$Encounter33$appoint, _$Encounter$appointme10, _$Encounter34, _$Encounter34$appoint, _$Encounter35, _$Encounter35$patient, _$Encounter35$patient2, _$Encounter35$patient3, _$Encounter35$patient4, _$Appointment$PersonI11, _$Appointment35, _$Appointment35$Perso, _$Appointment35$Perso2, _$Encounter$patient_i10, _$Encounter36, _$Encounter36$patient, _$Encounter36$patient2, _$Encounter$appointme11, _$Encounter37, _$Encounter37$appoint, _$Encounter38, _$Encounter38$patient, _$Encounter38$patient2, _$Encounter38$patient3, _$Encounter38$patient4, _$Appointment$PersonI12, _$Appointment36, _$Appointment36$Perso, _$Appointment36$Perso2, _$Encounter$patient_i11, _$Encounter39, _$Encounter39$patient, _$Encounter39$patient2, _$Encounter$appointme12, _$Encounter40, _$Encounter40$appoint, _$Encounter41, _$Encounter41$patient, _$Encounter41$patient2, _$Encounter41$patient3, _$Encounter41$patient4, _$Appointment$PersonI13, _$Appointment37, _$Appointment37$Perso, _$Appointment37$Perso2, _$Encounter$patient_i12, _$Encounter42, _$Encounter42$patient, _$Encounter42$patient2;
38430
38518
 
38431
38519
  return {
38432
- img: (_ === null || _ === void 0 ? void 0 : (_$Appointment31 = _.Appointment) === null || _$Appointment31 === void 0 ? void 0 : (_$Appointment31$Perso = _$Appointment31.PersonID) === null || _$Appointment31$Perso === void 0 ? void 0 : (_$Appointment31$Perso2 = _$Appointment31$Perso[0]) === null || _$Appointment31$Perso2 === void 0 ? void 0 : (_$Appointment31$Perso3 = _$Appointment31$Perso2.photo) === null || _$Appointment31$Perso3 === void 0 ? void 0 : (_$Appointment31$Perso4 = _$Appointment31$Perso3[0]) === null || _$Appointment31$Perso4 === void 0 ? void 0 : _$Appointment31$Perso4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$Appointment32 = _.Appointment) === null || _$Appointment32 === void 0 ? void 0 : (_$Appointment32$Perso = _$Appointment32.PersonID) === null || _$Appointment32$Perso === void 0 ? void 0 : (_$Appointment32$Perso2 = _$Appointment32$Perso[0]) === null || _$Appointment32$Perso2 === void 0 ? void 0 : (_$Appointment32$Perso3 = _$Appointment32$Perso2.photo) === null || _$Appointment32$Perso3 === void 0 ? void 0 : (_$Appointment32$Perso4 = _$Appointment32$Perso3[0]) === null || _$Appointment32$Perso4 === void 0 ? void 0 : _$Appointment32$Perso4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38433
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter22 = _.Encounter) === null || _$Encounter22 === void 0 ? void 0 : (_$Encounter22$patient = _$Encounter22.patient_id) === null || _$Encounter22$patient === void 0 ? void 0 : (_$Encounter22$patient2 = _$Encounter22$patient[0]) === null || _$Encounter22$patient2 === void 0 ? void 0 : (_$Encounter22$patient3 = _$Encounter22$patient2.name) === null || _$Encounter22$patient3 === void 0 ? void 0 : _$Encounter22$patient3[0]) || {}),
38434
- mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter23 = _.Encounter) === null || _$Encounter23 === void 0 ? void 0 : (_$Encounter23$patient = _$Encounter23.patient_id) === null || _$Encounter23$patient === void 0 ? void 0 : (_$Encounter23$patient2 = _$Encounter23$patient[0]) === null || _$Encounter23$patient2 === void 0 ? void 0 : _$Encounter23$patient2.MRN,
38435
- date: (_ === null || _ === void 0 ? void 0 : (_$Appointment33 = _.Appointment) === null || _$Appointment33 === void 0 ? void 0 : _$Appointment33.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment34 = _.Appointment) === null || _$Appointment34 === void 0 ? void 0 : _$Appointment34.start, "DD MMM,YYYY") : "",
38436
- time: (_ === null || _ === void 0 ? void 0 : (_$Appointment35 = _.Appointment) === null || _$Appointment35 === void 0 ? void 0 : _$Appointment35.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment36 = _.Appointment) === null || _$Appointment36 === void 0 ? void 0 : _$Appointment36.start, "hh:mm A") : "",
38437
- speciality: _ === null || _ === void 0 ? void 0 : (_$Appointment37 = _.Appointment) === null || _$Appointment37 === void 0 ? void 0 : (_$Appointment37$Speci = _$Appointment37.SpecialtyID) === null || _$Appointment37$Speci === void 0 ? void 0 : _$Appointment37$Speci.map(function (spl) {
38438
- var _spl$coding4, _spl$coding4$;
38439
-
38440
- return spl === null || spl === void 0 ? void 0 : (_spl$coding4 = spl.coding) === null || _spl$coding4 === void 0 ? void 0 : (_spl$coding4$ = _spl$coding4[0]) === null || _spl$coding4$ === void 0 ? void 0 : _spl$coding4$.display;
38441
- }).join(", "),
38442
- clinic: _ === null || _ === void 0 ? void 0 : (_$Encounter24 = _.Encounter) === null || _$Encounter24 === void 0 ? void 0 : (_$Encounter24$practit = _$Encounter24.practitioner_details) === null || _$Encounter24$practit === void 0 ? void 0 : (_$Encounter24$practit2 = _$Encounter24$practit[0]) === null || _$Encounter24$practit2 === void 0 ? void 0 : _$Encounter24$practit2.clinic,
38443
- dob: _ === null || _ === void 0 ? void 0 : (_$Appointment38 = _.Appointment) === null || _$Appointment38 === void 0 ? void 0 : (_$Appointment38$Perso = _$Appointment38.PersonID) === null || _$Appointment38$Perso === void 0 ? void 0 : (_$Appointment38$Perso2 = _$Appointment38$Perso[0]) === null || _$Appointment38$Perso2 === void 0 ? void 0 : _$Appointment38$Perso2.birthDay,
38444
- type: "OP",
38445
- appNo: (_$Encounter$appointme4 = _ === null || _ === void 0 ? void 0 : (_$Encounter25 = _.Encounter) === null || _$Encounter25 === void 0 ? void 0 : (_$Encounter25$appoint = _$Encounter25.appointmentId) === null || _$Encounter25$appoint === void 0 ? void 0 : _$Encounter25$appoint[0]) !== null && _$Encounter$appointme4 !== void 0 ? _$Encounter$appointme4 : "",
38446
- data: _,
38447
- enId: _.Encounter.id,
38448
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment39 = _.Appointment) === null || _$Appointment39 === void 0 ? void 0 : (_$Appointment39$Perso = _$Appointment39.PersonID) === null || _$Appointment39$Perso === void 0 ? void 0 : (_$Appointment39$Perso2 = _$Appointment39$Perso[0]) === null || _$Appointment39$Perso2 === void 0 ? void 0 : _$Appointment39$Perso2.birthDay),
38449
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment40 = _.Appointment) === null || _$Appointment40 === void 0 ? void 0 : (_$Appointment40$Perso = _$Appointment40.PersonID) === null || _$Appointment40$Perso === void 0 ? void 0 : (_$Appointment40$Perso2 = _$Appointment40$Perso[0]) === null || _$Appointment40$Perso2 === void 0 ? void 0 : _$Appointment40$Perso2.gender,
38450
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter26 = _.Encounter) === null || _$Encounter26 === void 0 ? void 0 : (_$Encounter26$patient = _$Encounter26.patient_id) === null || _$Encounter26$patient === void 0 ? void 0 : (_$Encounter26$patient2 = _$Encounter26$patient[0]) === null || _$Encounter26$patient2 === void 0 ? void 0 : (_$Encounter26$patient3 = _$Encounter26$patient2.telecom) === null || _$Encounter26$patient3 === void 0 ? void 0 : (_$Encounter26$patient4 = _$Encounter26$patient3[0]) === null || _$Encounter26$patient4 === void 0 ? void 0 : _$Encounter26$patient4.value,
38451
- visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter27 = _.Encounter) === null || _$Encounter27 === void 0 ? void 0 : _$Encounter27.visit_type,
38452
- appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter28 = _.Encounter) === null || _$Encounter28 === void 0 ? void 0 : (_$Encounter28$status = _$Encounter28.status) === null || _$Encounter28$status === void 0 ? void 0 : _$Encounter28$status.display,
38453
- "Register Visit": true,
38454
- "Modify Appointment": true,
38455
- "Cancel Appointment": true,
38456
- "View Profile": true
38520
+ // img: _?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid
38521
+ // ? getImgUrl(_?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid)
38522
+ // : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38523
+ // name: makeName(_?.Encounter?.patient_id?.[0]?.name?.[0] || {}),
38524
+ // mrn: _?.Encounter?.patient_id?.[0]?.MRN,
38525
+ // date: _?.Appointment?.start
38526
+ // ? utcTOLocal(_?.Appointment?.start, "DD MMM,YYYY")
38527
+ // : "",
38528
+ // time: _?.Appointment?.start
38529
+ // ? utcTOLocal(_?.Appointment?.start, "hh:mm A")
38530
+ // : "",
38531
+ // speciality: _?.Appointment?.SpecialtyID?.map((spl) => {
38532
+ // return spl?.coding?.[0]?.display;
38533
+ // }).join(", "),
38534
+ // clinic: _?.Encounter?.practitioner_details?.[0]?.clinic,
38535
+ // dob: _?.Appointment?.PersonID?.[0]?.birthDay,
38536
+ // type: "OP",
38537
+ // appNo: _?.Encounter?.appointmentId?.[0] ?? "",
38538
+ // data: _,
38539
+ // enId: _.Encounter.id,
38540
+ // age: getAge(_?.Appointment?.PersonID?.[0]?.birthDay),
38541
+ // gender: _?.Appointment?.PersonID?.[0]?.gender,
38542
+ // contact: _?.Encounter?.patient_id?.[0]?.telecom?.[0]?.value,
38543
+ // visitType: _?.Encounter?.visit_type,
38544
+ // appointmentStatus: _?.Encounter?.status?.display,
38545
+ // "Register Visit": true,
38546
+ // "Modify Appointment": true,
38547
+ // "Cancel Appointment": true,
38548
+ // "View Profile": true,
38549
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter29 = _.Encounter) === null || _$Encounter29 === void 0 ? void 0 : (_$Encounter29$patient = _$Encounter29.patient_id) === null || _$Encounter29$patient === void 0 ? void 0 : (_$Encounter29$patient2 = _$Encounter29$patient[0]) === null || _$Encounter29$patient2 === void 0 ? void 0 : (_$Encounter29$patient3 = _$Encounter29$patient2.name) === null || _$Encounter29$patient3 === void 0 ? void 0 : _$Encounter29$patient3[0]) || {}),
38550
+ mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter30 = _.Encounter) === null || _$Encounter30 === void 0 ? void 0 : (_$Encounter30$patient = _$Encounter30.patient_id) === null || _$Encounter30$patient === void 0 ? void 0 : (_$Encounter30$patient2 = _$Encounter30$patient[0]) === null || _$Encounter30$patient2 === void 0 ? void 0 : _$Encounter30$patient2.MRN,
38551
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment30 = _.Appointment) === null || _$Appointment30 === void 0 ? void 0 : (_$Appointment30$Perso = _$Appointment30.PersonID) === null || _$Appointment30$Perso === void 0 ? void 0 : (_$Appointment30$Perso2 = _$Appointment30$Perso[0]) === null || _$Appointment30$Perso2 === void 0 ? void 0 : _$Appointment30$Perso2.birthDay),
38552
+ date: "".concat((_ === null || _ === void 0 ? void 0 : (_$Appointment31 = _.Appointment) === null || _$Appointment31 === void 0 ? void 0 : _$Appointment31.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment32 = _.Appointment) === null || _$Appointment32 === void 0 ? void 0 : _$Appointment32.start, "DD MMM,YYYY") : "", ",").concat((_ === null || _ === void 0 ? void 0 : (_$Appointment33 = _.Appointment) === null || _$Appointment33 === void 0 ? void 0 : _$Appointment33.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment34 = _.Appointment) === null || _$Appointment34 === void 0 ? void 0 : _$Appointment34.start, "hh:mm A") : ""),
38553
+ visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter31 = _.Encounter) === null || _$Encounter31 === void 0 ? void 0 : _$Encounter31.visit_type,
38554
+ appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter32 = _.Encounter) === null || _$Encounter32 === void 0 ? void 0 : (_$Encounter32$status = _$Encounter32.status) === null || _$Encounter32$status === void 0 ? void 0 : _$Encounter32$status.display,
38555
+ refNo: (_$Encounter$appointme9 = _ === null || _ === void 0 ? void 0 : (_$Encounter33 = _.Encounter) === null || _$Encounter33 === void 0 ? void 0 : (_$Encounter33$appoint = _$Encounter33.appointmentId) === null || _$Encounter33$appoint === void 0 ? void 0 : _$Encounter33$appoint[0]) !== null && _$Encounter$appointme9 !== void 0 ? _$Encounter$appointme9 : "",
38556
+ viewaction: JSON.stringify({
38557
+ appNo: (_$Encounter$appointme10 = _ === null || _ === void 0 ? void 0 : (_$Encounter34 = _.Encounter) === null || _$Encounter34 === void 0 ? void 0 : (_$Encounter34$appoint = _$Encounter34.appointmentId) === null || _$Encounter34$appoint === void 0 ? void 0 : _$Encounter34$appoint[0]) !== null && _$Encounter$appointme10 !== void 0 ? _$Encounter$appointme10 : "",
38558
+ enId: _.Encounter.id,
38559
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter35 = _.Encounter) === null || _$Encounter35 === void 0 ? void 0 : (_$Encounter35$patient = _$Encounter35.patient_id) === null || _$Encounter35$patient === void 0 ? void 0 : (_$Encounter35$patient2 = _$Encounter35$patient[0]) === null || _$Encounter35$patient2 === void 0 ? void 0 : (_$Encounter35$patient3 = _$Encounter35$patient2.telecom) === null || _$Encounter35$patient3 === void 0 ? void 0 : (_$Encounter35$patient4 = _$Encounter35$patient3[0]) === null || _$Encounter35$patient4 === void 0 ? void 0 : _$Encounter35$patient4.value,
38560
+ personId: (_$Appointment$PersonI11 = _ === null || _ === void 0 ? void 0 : (_$Appointment35 = _.Appointment) === null || _$Appointment35 === void 0 ? void 0 : (_$Appointment35$Perso = _$Appointment35.PersonID) === null || _$Appointment35$Perso === void 0 ? void 0 : (_$Appointment35$Perso2 = _$Appointment35$Perso[0]) === null || _$Appointment35$Perso2 === void 0 ? void 0 : _$Appointment35$Perso2.Id) !== null && _$Appointment$PersonI11 !== void 0 ? _$Appointment$PersonI11 : null,
38561
+ patientId: (_$Encounter$patient_i10 = _ === null || _ === void 0 ? void 0 : (_$Encounter36 = _.Encounter) === null || _$Encounter36 === void 0 ? void 0 : (_$Encounter36$patient = _$Encounter36.patient_id) === null || _$Encounter36$patient === void 0 ? void 0 : (_$Encounter36$patient2 = _$Encounter36$patient[0]) === null || _$Encounter36$patient2 === void 0 ? void 0 : _$Encounter36$patient2.id) !== null && _$Encounter$patient_i10 !== void 0 ? _$Encounter$patient_i10 : null
38562
+ }),
38563
+ modifyaction: JSON.stringify({
38564
+ appNo: (_$Encounter$appointme11 = _ === null || _ === void 0 ? void 0 : (_$Encounter37 = _.Encounter) === null || _$Encounter37 === void 0 ? void 0 : (_$Encounter37$appoint = _$Encounter37.appointmentId) === null || _$Encounter37$appoint === void 0 ? void 0 : _$Encounter37$appoint[0]) !== null && _$Encounter$appointme11 !== void 0 ? _$Encounter$appointme11 : "",
38565
+ enId: _.Encounter.id,
38566
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter38 = _.Encounter) === null || _$Encounter38 === void 0 ? void 0 : (_$Encounter38$patient = _$Encounter38.patient_id) === null || _$Encounter38$patient === void 0 ? void 0 : (_$Encounter38$patient2 = _$Encounter38$patient[0]) === null || _$Encounter38$patient2 === void 0 ? void 0 : (_$Encounter38$patient3 = _$Encounter38$patient2.telecom) === null || _$Encounter38$patient3 === void 0 ? void 0 : (_$Encounter38$patient4 = _$Encounter38$patient3[0]) === null || _$Encounter38$patient4 === void 0 ? void 0 : _$Encounter38$patient4.value,
38567
+ personId: (_$Appointment$PersonI12 = _ === null || _ === void 0 ? void 0 : (_$Appointment36 = _.Appointment) === null || _$Appointment36 === void 0 ? void 0 : (_$Appointment36$Perso = _$Appointment36.PersonID) === null || _$Appointment36$Perso === void 0 ? void 0 : (_$Appointment36$Perso2 = _$Appointment36$Perso[0]) === null || _$Appointment36$Perso2 === void 0 ? void 0 : _$Appointment36$Perso2.Id) !== null && _$Appointment$PersonI12 !== void 0 ? _$Appointment$PersonI12 : null,
38568
+ patientId: (_$Encounter$patient_i11 = _ === null || _ === void 0 ? void 0 : (_$Encounter39 = _.Encounter) === null || _$Encounter39 === void 0 ? void 0 : (_$Encounter39$patient = _$Encounter39.patient_id) === null || _$Encounter39$patient === void 0 ? void 0 : (_$Encounter39$patient2 = _$Encounter39$patient[0]) === null || _$Encounter39$patient2 === void 0 ? void 0 : _$Encounter39$patient2.id) !== null && _$Encounter$patient_i11 !== void 0 ? _$Encounter$patient_i11 : null
38569
+ }),
38570
+ cancelaction: JSON.stringify({
38571
+ appNo: (_$Encounter$appointme12 = _ === null || _ === void 0 ? void 0 : (_$Encounter40 = _.Encounter) === null || _$Encounter40 === void 0 ? void 0 : (_$Encounter40$appoint = _$Encounter40.appointmentId) === null || _$Encounter40$appoint === void 0 ? void 0 : _$Encounter40$appoint[0]) !== null && _$Encounter$appointme12 !== void 0 ? _$Encounter$appointme12 : "",
38572
+ enId: _.Encounter.id,
38573
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter41 = _.Encounter) === null || _$Encounter41 === void 0 ? void 0 : (_$Encounter41$patient = _$Encounter41.patient_id) === null || _$Encounter41$patient === void 0 ? void 0 : (_$Encounter41$patient2 = _$Encounter41$patient[0]) === null || _$Encounter41$patient2 === void 0 ? void 0 : (_$Encounter41$patient3 = _$Encounter41$patient2.telecom) === null || _$Encounter41$patient3 === void 0 ? void 0 : (_$Encounter41$patient4 = _$Encounter41$patient3[0]) === null || _$Encounter41$patient4 === void 0 ? void 0 : _$Encounter41$patient4.value,
38574
+ personId: (_$Appointment$PersonI13 = _ === null || _ === void 0 ? void 0 : (_$Appointment37 = _.Appointment) === null || _$Appointment37 === void 0 ? void 0 : (_$Appointment37$Perso = _$Appointment37.PersonID) === null || _$Appointment37$Perso === void 0 ? void 0 : (_$Appointment37$Perso2 = _$Appointment37$Perso[0]) === null || _$Appointment37$Perso2 === void 0 ? void 0 : _$Appointment37$Perso2.Id) !== null && _$Appointment$PersonI13 !== void 0 ? _$Appointment$PersonI13 : null,
38575
+ patientId: (_$Encounter$patient_i12 = _ === null || _ === void 0 ? void 0 : (_$Encounter42 = _.Encounter) === null || _$Encounter42 === void 0 ? void 0 : (_$Encounter42$patient = _$Encounter42.patient_id) === null || _$Encounter42$patient === void 0 ? void 0 : (_$Encounter42$patient2 = _$Encounter42$patient[0]) === null || _$Encounter42$patient2 === void 0 ? void 0 : _$Encounter42$patient2.id) !== null && _$Encounter$patient_i12 !== void 0 ? _$Encounter$patient_i12 : null
38576
+ })
38457
38577
  };
38458
38578
  }) : [];
38459
38579
  return _context4.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -38498,34 +38618,66 @@ var GET_NEW_PATIENTS = createAsyncThunk("appointmentStatsApiSlice/getNewPatients
38498
38618
  case 5:
38499
38619
  data = _context5.sent;
38500
38620
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result5 = data.result) === null || _data$result5 === void 0 ? void 0 : _data$result5.map(function (_) {
38501
- var _$Appointment41, _$Appointment41$Perso, _$Appointment41$Perso2, _$Appointment41$Perso3, _$Appointment41$Perso4, _$Appointment42, _$Appointment42$Perso, _$Appointment42$Perso2, _$Appointment42$Perso3, _$Appointment42$Perso4, _$Encounter29, _$Encounter29$patient, _$Encounter29$patient2, _$Encounter29$patient3, _$Encounter30, _$Encounter30$patient, _$Encounter30$patient2, _$Appointment43, _$Appointment44, _$Appointment45, _$Appointment46, _$Appointment47, _$Appointment47$Speci, _$Encounter31, _$Encounter31$practit, _$Encounter31$practit2, _$Appointment48, _$Appointment48$Perso, _$Appointment48$Perso2, _$Encounter$appointme5, _$Encounter32, _$Encounter32$appoint, _$Appointment49, _$Appointment49$Perso, _$Appointment49$Perso2, _$Appointment50, _$Appointment50$Perso, _$Appointment50$Perso2, _$Encounter33, _$Encounter33$patient, _$Encounter33$patient2, _$Encounter33$patient3, _$Encounter33$patient4, _$Encounter34, _$Encounter35, _$Encounter35$status;
38621
+ var _$Encounter43, _$Encounter43$patient, _$Encounter43$patient2, _$Encounter43$patient3, _$Encounter44, _$Encounter44$patient, _$Encounter44$patient2, _$Appointment38, _$Appointment38$Perso, _$Appointment38$Perso2, _$Appointment39, _$Appointment40, _$Appointment41, _$Appointment42, _$Encounter45, _$Encounter46, _$Encounter46$status, _$Encounter$appointme13, _$Encounter47, _$Encounter47$appoint, _$Encounter$appointme14, _$Encounter48, _$Encounter48$appoint, _$Encounter49, _$Encounter49$patient, _$Encounter49$patient2, _$Encounter49$patient3, _$Encounter49$patient4, _$Appointment$PersonI14, _$Appointment43, _$Appointment43$Perso, _$Appointment43$Perso2, _$Encounter$patient_i13, _$Encounter50, _$Encounter50$patient, _$Encounter50$patient2, _$Encounter$appointme15, _$Encounter51, _$Encounter51$appoint, _$Encounter52, _$Encounter52$patient, _$Encounter52$patient2, _$Encounter52$patient3, _$Encounter52$patient4, _$Appointment$PersonI15, _$Appointment44, _$Appointment44$Perso, _$Appointment44$Perso2, _$Encounter$patient_i14, _$Encounter53, _$Encounter53$patient, _$Encounter53$patient2, _$Encounter$appointme16, _$Encounter54, _$Encounter54$appoint, _$Encounter55, _$Encounter55$patient, _$Encounter55$patient2, _$Encounter55$patient3, _$Encounter55$patient4, _$Appointment$PersonI16, _$Appointment45, _$Appointment45$Perso, _$Appointment45$Perso2, _$Encounter$patient_i15, _$Encounter56, _$Encounter56$patient, _$Encounter56$patient2;
38502
38622
 
38503
38623
  return {
38504
- img: (_ === null || _ === void 0 ? void 0 : (_$Appointment41 = _.Appointment) === null || _$Appointment41 === void 0 ? void 0 : (_$Appointment41$Perso = _$Appointment41.PersonID) === null || _$Appointment41$Perso === void 0 ? void 0 : (_$Appointment41$Perso2 = _$Appointment41$Perso[0]) === null || _$Appointment41$Perso2 === void 0 ? void 0 : (_$Appointment41$Perso3 = _$Appointment41$Perso2.photo) === null || _$Appointment41$Perso3 === void 0 ? void 0 : (_$Appointment41$Perso4 = _$Appointment41$Perso3[0]) === null || _$Appointment41$Perso4 === void 0 ? void 0 : _$Appointment41$Perso4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$Appointment42 = _.Appointment) === null || _$Appointment42 === void 0 ? void 0 : (_$Appointment42$Perso = _$Appointment42.PersonID) === null || _$Appointment42$Perso === void 0 ? void 0 : (_$Appointment42$Perso2 = _$Appointment42$Perso[0]) === null || _$Appointment42$Perso2 === void 0 ? void 0 : (_$Appointment42$Perso3 = _$Appointment42$Perso2.photo) === null || _$Appointment42$Perso3 === void 0 ? void 0 : (_$Appointment42$Perso4 = _$Appointment42$Perso3[0]) === null || _$Appointment42$Perso4 === void 0 ? void 0 : _$Appointment42$Perso4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38505
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter29 = _.Encounter) === null || _$Encounter29 === void 0 ? void 0 : (_$Encounter29$patient = _$Encounter29.patient_id) === null || _$Encounter29$patient === void 0 ? void 0 : (_$Encounter29$patient2 = _$Encounter29$patient[0]) === null || _$Encounter29$patient2 === void 0 ? void 0 : (_$Encounter29$patient3 = _$Encounter29$patient2.name) === null || _$Encounter29$patient3 === void 0 ? void 0 : _$Encounter29$patient3[0]) || {}),
38506
- mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter30 = _.Encounter) === null || _$Encounter30 === void 0 ? void 0 : (_$Encounter30$patient = _$Encounter30.patient_id) === null || _$Encounter30$patient === void 0 ? void 0 : (_$Encounter30$patient2 = _$Encounter30$patient[0]) === null || _$Encounter30$patient2 === void 0 ? void 0 : _$Encounter30$patient2.MRN,
38507
- date: (_ === null || _ === void 0 ? void 0 : (_$Appointment43 = _.Appointment) === null || _$Appointment43 === void 0 ? void 0 : _$Appointment43.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment44 = _.Appointment) === null || _$Appointment44 === void 0 ? void 0 : _$Appointment44.start, "DD MMM,YYYY") : "",
38508
- time: (_ === null || _ === void 0 ? void 0 : (_$Appointment45 = _.Appointment) === null || _$Appointment45 === void 0 ? void 0 : _$Appointment45.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment46 = _.Appointment) === null || _$Appointment46 === void 0 ? void 0 : _$Appointment46.start, "hh:mm A") : "",
38509
- speciality: _ === null || _ === void 0 ? void 0 : (_$Appointment47 = _.Appointment) === null || _$Appointment47 === void 0 ? void 0 : (_$Appointment47$Speci = _$Appointment47.SpecialtyID) === null || _$Appointment47$Speci === void 0 ? void 0 : _$Appointment47$Speci.map(function (spl) {
38510
- var _spl$coding5, _spl$coding5$;
38511
-
38512
- return spl === null || spl === void 0 ? void 0 : (_spl$coding5 = spl.coding) === null || _spl$coding5 === void 0 ? void 0 : (_spl$coding5$ = _spl$coding5[0]) === null || _spl$coding5$ === void 0 ? void 0 : _spl$coding5$.display;
38513
- }).join(", "),
38514
- clinic: _ === null || _ === void 0 ? void 0 : (_$Encounter31 = _.Encounter) === null || _$Encounter31 === void 0 ? void 0 : (_$Encounter31$practit = _$Encounter31.practitioner_details) === null || _$Encounter31$practit === void 0 ? void 0 : (_$Encounter31$practit2 = _$Encounter31$practit[0]) === null || _$Encounter31$practit2 === void 0 ? void 0 : _$Encounter31$practit2.clinic,
38515
- dob: _ === null || _ === void 0 ? void 0 : (_$Appointment48 = _.Appointment) === null || _$Appointment48 === void 0 ? void 0 : (_$Appointment48$Perso = _$Appointment48.PersonID) === null || _$Appointment48$Perso === void 0 ? void 0 : (_$Appointment48$Perso2 = _$Appointment48$Perso[0]) === null || _$Appointment48$Perso2 === void 0 ? void 0 : _$Appointment48$Perso2.birthDay,
38516
- type: "OP",
38517
- appNo: (_$Encounter$appointme5 = _ === null || _ === void 0 ? void 0 : (_$Encounter32 = _.Encounter) === null || _$Encounter32 === void 0 ? void 0 : (_$Encounter32$appoint = _$Encounter32.appointmentId) === null || _$Encounter32$appoint === void 0 ? void 0 : _$Encounter32$appoint[0]) !== null && _$Encounter$appointme5 !== void 0 ? _$Encounter$appointme5 : "",
38518
- data: _,
38519
- enId: _.Encounter.id,
38520
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment49 = _.Appointment) === null || _$Appointment49 === void 0 ? void 0 : (_$Appointment49$Perso = _$Appointment49.PersonID) === null || _$Appointment49$Perso === void 0 ? void 0 : (_$Appointment49$Perso2 = _$Appointment49$Perso[0]) === null || _$Appointment49$Perso2 === void 0 ? void 0 : _$Appointment49$Perso2.birthDay),
38521
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment50 = _.Appointment) === null || _$Appointment50 === void 0 ? void 0 : (_$Appointment50$Perso = _$Appointment50.PersonID) === null || _$Appointment50$Perso === void 0 ? void 0 : (_$Appointment50$Perso2 = _$Appointment50$Perso[0]) === null || _$Appointment50$Perso2 === void 0 ? void 0 : _$Appointment50$Perso2.gender,
38522
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter33 = _.Encounter) === null || _$Encounter33 === void 0 ? void 0 : (_$Encounter33$patient = _$Encounter33.patient_id) === null || _$Encounter33$patient === void 0 ? void 0 : (_$Encounter33$patient2 = _$Encounter33$patient[0]) === null || _$Encounter33$patient2 === void 0 ? void 0 : (_$Encounter33$patient3 = _$Encounter33$patient2.telecom) === null || _$Encounter33$patient3 === void 0 ? void 0 : (_$Encounter33$patient4 = _$Encounter33$patient3[0]) === null || _$Encounter33$patient4 === void 0 ? void 0 : _$Encounter33$patient4.value,
38523
- visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter34 = _.Encounter) === null || _$Encounter34 === void 0 ? void 0 : _$Encounter34.visit_type,
38524
- appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter35 = _.Encounter) === null || _$Encounter35 === void 0 ? void 0 : (_$Encounter35$status = _$Encounter35.status) === null || _$Encounter35$status === void 0 ? void 0 : _$Encounter35$status.display,
38525
- "Register Visit": true,
38526
- "Modify Appointment": true,
38527
- "Cancel Appointment": true,
38528
- "View Profile": true
38624
+ // img: _?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid
38625
+ // ? getImgUrl(_?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid)
38626
+ // : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38627
+ // name: makeName(_?.Encounter?.patient_id?.[0]?.name?.[0] || {}),
38628
+ // mrn: _?.Encounter?.patient_id?.[0]?.MRN,
38629
+ // date: _?.Appointment?.start
38630
+ // ? utcTOLocal(_?.Appointment?.start, "DD MMM,YYYY")
38631
+ // : "",
38632
+ // time: _?.Appointment?.start
38633
+ // ? utcTOLocal(_?.Appointment?.start, "hh:mm A")
38634
+ // : "",
38635
+ // speciality: _?.Appointment?.SpecialtyID?.map((spl) => {
38636
+ // return spl?.coding?.[0]?.display;
38637
+ // }).join(", "),
38638
+ // clinic: _?.Encounter?.practitioner_details?.[0]?.clinic,
38639
+ // dob: _?.Appointment?.PersonID?.[0]?.birthDay,
38640
+ // type: "OP",
38641
+ // appNo: _?.Encounter?.appointmentId?.[0] ?? "",
38642
+ // data: _,
38643
+ // enId: _.Encounter.id,
38644
+ // age: getAge(_?.Appointment?.PersonID?.[0]?.birthDay),
38645
+ // gender: _?.Appointment?.PersonID?.[0]?.gender,
38646
+ // contact: _?.Encounter?.patient_id?.[0]?.telecom?.[0]?.value,
38647
+ // visitType: _?.Encounter?.visit_type,
38648
+ // appointmentStatus: _?.Encounter?.status?.display,
38649
+ // "Register Visit": true,
38650
+ // "Modify Appointment": true,
38651
+ // "Cancel Appointment": true,
38652
+ // "View Profile": true,
38653
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter43 = _.Encounter) === null || _$Encounter43 === void 0 ? void 0 : (_$Encounter43$patient = _$Encounter43.patient_id) === null || _$Encounter43$patient === void 0 ? void 0 : (_$Encounter43$patient2 = _$Encounter43$patient[0]) === null || _$Encounter43$patient2 === void 0 ? void 0 : (_$Encounter43$patient3 = _$Encounter43$patient2.name) === null || _$Encounter43$patient3 === void 0 ? void 0 : _$Encounter43$patient3[0]) || {}),
38654
+ mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter44 = _.Encounter) === null || _$Encounter44 === void 0 ? void 0 : (_$Encounter44$patient = _$Encounter44.patient_id) === null || _$Encounter44$patient === void 0 ? void 0 : (_$Encounter44$patient2 = _$Encounter44$patient[0]) === null || _$Encounter44$patient2 === void 0 ? void 0 : _$Encounter44$patient2.MRN,
38655
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment38 = _.Appointment) === null || _$Appointment38 === void 0 ? void 0 : (_$Appointment38$Perso = _$Appointment38.PersonID) === null || _$Appointment38$Perso === void 0 ? void 0 : (_$Appointment38$Perso2 = _$Appointment38$Perso[0]) === null || _$Appointment38$Perso2 === void 0 ? void 0 : _$Appointment38$Perso2.birthDay),
38656
+ date: "".concat((_ === null || _ === void 0 ? void 0 : (_$Appointment39 = _.Appointment) === null || _$Appointment39 === void 0 ? void 0 : _$Appointment39.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment40 = _.Appointment) === null || _$Appointment40 === void 0 ? void 0 : _$Appointment40.start, "DD MMM,YYYY") : "", ",").concat((_ === null || _ === void 0 ? void 0 : (_$Appointment41 = _.Appointment) === null || _$Appointment41 === void 0 ? void 0 : _$Appointment41.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment42 = _.Appointment) === null || _$Appointment42 === void 0 ? void 0 : _$Appointment42.start, "hh:mm A") : ""),
38657
+ visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter45 = _.Encounter) === null || _$Encounter45 === void 0 ? void 0 : _$Encounter45.visit_type,
38658
+ appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter46 = _.Encounter) === null || _$Encounter46 === void 0 ? void 0 : (_$Encounter46$status = _$Encounter46.status) === null || _$Encounter46$status === void 0 ? void 0 : _$Encounter46$status.display,
38659
+ refNo: (_$Encounter$appointme13 = _ === null || _ === void 0 ? void 0 : (_$Encounter47 = _.Encounter) === null || _$Encounter47 === void 0 ? void 0 : (_$Encounter47$appoint = _$Encounter47.appointmentId) === null || _$Encounter47$appoint === void 0 ? void 0 : _$Encounter47$appoint[0]) !== null && _$Encounter$appointme13 !== void 0 ? _$Encounter$appointme13 : "",
38660
+ viewaction: JSON.stringify({
38661
+ appNo: (_$Encounter$appointme14 = _ === null || _ === void 0 ? void 0 : (_$Encounter48 = _.Encounter) === null || _$Encounter48 === void 0 ? void 0 : (_$Encounter48$appoint = _$Encounter48.appointmentId) === null || _$Encounter48$appoint === void 0 ? void 0 : _$Encounter48$appoint[0]) !== null && _$Encounter$appointme14 !== void 0 ? _$Encounter$appointme14 : "",
38662
+ enId: _.Encounter.id,
38663
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter49 = _.Encounter) === null || _$Encounter49 === void 0 ? void 0 : (_$Encounter49$patient = _$Encounter49.patient_id) === null || _$Encounter49$patient === void 0 ? void 0 : (_$Encounter49$patient2 = _$Encounter49$patient[0]) === null || _$Encounter49$patient2 === void 0 ? void 0 : (_$Encounter49$patient3 = _$Encounter49$patient2.telecom) === null || _$Encounter49$patient3 === void 0 ? void 0 : (_$Encounter49$patient4 = _$Encounter49$patient3[0]) === null || _$Encounter49$patient4 === void 0 ? void 0 : _$Encounter49$patient4.value,
38664
+ personId: (_$Appointment$PersonI14 = _ === null || _ === void 0 ? void 0 : (_$Appointment43 = _.Appointment) === null || _$Appointment43 === void 0 ? void 0 : (_$Appointment43$Perso = _$Appointment43.PersonID) === null || _$Appointment43$Perso === void 0 ? void 0 : (_$Appointment43$Perso2 = _$Appointment43$Perso[0]) === null || _$Appointment43$Perso2 === void 0 ? void 0 : _$Appointment43$Perso2.Id) !== null && _$Appointment$PersonI14 !== void 0 ? _$Appointment$PersonI14 : null,
38665
+ patientId: (_$Encounter$patient_i13 = _ === null || _ === void 0 ? void 0 : (_$Encounter50 = _.Encounter) === null || _$Encounter50 === void 0 ? void 0 : (_$Encounter50$patient = _$Encounter50.patient_id) === null || _$Encounter50$patient === void 0 ? void 0 : (_$Encounter50$patient2 = _$Encounter50$patient[0]) === null || _$Encounter50$patient2 === void 0 ? void 0 : _$Encounter50$patient2.id) !== null && _$Encounter$patient_i13 !== void 0 ? _$Encounter$patient_i13 : null
38666
+ }),
38667
+ modifyaction: JSON.stringify({
38668
+ appNo: (_$Encounter$appointme15 = _ === null || _ === void 0 ? void 0 : (_$Encounter51 = _.Encounter) === null || _$Encounter51 === void 0 ? void 0 : (_$Encounter51$appoint = _$Encounter51.appointmentId) === null || _$Encounter51$appoint === void 0 ? void 0 : _$Encounter51$appoint[0]) !== null && _$Encounter$appointme15 !== void 0 ? _$Encounter$appointme15 : "",
38669
+ enId: _.Encounter.id,
38670
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter52 = _.Encounter) === null || _$Encounter52 === void 0 ? void 0 : (_$Encounter52$patient = _$Encounter52.patient_id) === null || _$Encounter52$patient === void 0 ? void 0 : (_$Encounter52$patient2 = _$Encounter52$patient[0]) === null || _$Encounter52$patient2 === void 0 ? void 0 : (_$Encounter52$patient3 = _$Encounter52$patient2.telecom) === null || _$Encounter52$patient3 === void 0 ? void 0 : (_$Encounter52$patient4 = _$Encounter52$patient3[0]) === null || _$Encounter52$patient4 === void 0 ? void 0 : _$Encounter52$patient4.value,
38671
+ personId: (_$Appointment$PersonI15 = _ === null || _ === void 0 ? void 0 : (_$Appointment44 = _.Appointment) === null || _$Appointment44 === void 0 ? void 0 : (_$Appointment44$Perso = _$Appointment44.PersonID) === null || _$Appointment44$Perso === void 0 ? void 0 : (_$Appointment44$Perso2 = _$Appointment44$Perso[0]) === null || _$Appointment44$Perso2 === void 0 ? void 0 : _$Appointment44$Perso2.Id) !== null && _$Appointment$PersonI15 !== void 0 ? _$Appointment$PersonI15 : null,
38672
+ patientId: (_$Encounter$patient_i14 = _ === null || _ === void 0 ? void 0 : (_$Encounter53 = _.Encounter) === null || _$Encounter53 === void 0 ? void 0 : (_$Encounter53$patient = _$Encounter53.patient_id) === null || _$Encounter53$patient === void 0 ? void 0 : (_$Encounter53$patient2 = _$Encounter53$patient[0]) === null || _$Encounter53$patient2 === void 0 ? void 0 : _$Encounter53$patient2.id) !== null && _$Encounter$patient_i14 !== void 0 ? _$Encounter$patient_i14 : null
38673
+ }),
38674
+ cancelaction: JSON.stringify({
38675
+ appNo: (_$Encounter$appointme16 = _ === null || _ === void 0 ? void 0 : (_$Encounter54 = _.Encounter) === null || _$Encounter54 === void 0 ? void 0 : (_$Encounter54$appoint = _$Encounter54.appointmentId) === null || _$Encounter54$appoint === void 0 ? void 0 : _$Encounter54$appoint[0]) !== null && _$Encounter$appointme16 !== void 0 ? _$Encounter$appointme16 : "",
38676
+ enId: _.Encounter.id,
38677
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter55 = _.Encounter) === null || _$Encounter55 === void 0 ? void 0 : (_$Encounter55$patient = _$Encounter55.patient_id) === null || _$Encounter55$patient === void 0 ? void 0 : (_$Encounter55$patient2 = _$Encounter55$patient[0]) === null || _$Encounter55$patient2 === void 0 ? void 0 : (_$Encounter55$patient3 = _$Encounter55$patient2.telecom) === null || _$Encounter55$patient3 === void 0 ? void 0 : (_$Encounter55$patient4 = _$Encounter55$patient3[0]) === null || _$Encounter55$patient4 === void 0 ? void 0 : _$Encounter55$patient4.value,
38678
+ personId: (_$Appointment$PersonI16 = _ === null || _ === void 0 ? void 0 : (_$Appointment45 = _.Appointment) === null || _$Appointment45 === void 0 ? void 0 : (_$Appointment45$Perso = _$Appointment45.PersonID) === null || _$Appointment45$Perso === void 0 ? void 0 : (_$Appointment45$Perso2 = _$Appointment45$Perso[0]) === null || _$Appointment45$Perso2 === void 0 ? void 0 : _$Appointment45$Perso2.Id) !== null && _$Appointment$PersonI16 !== void 0 ? _$Appointment$PersonI16 : null,
38679
+ patientId: (_$Encounter$patient_i15 = _ === null || _ === void 0 ? void 0 : (_$Encounter56 = _.Encounter) === null || _$Encounter56 === void 0 ? void 0 : (_$Encounter56$patient = _$Encounter56.patient_id) === null || _$Encounter56$patient === void 0 ? void 0 : (_$Encounter56$patient2 = _$Encounter56$patient[0]) === null || _$Encounter56$patient2 === void 0 ? void 0 : _$Encounter56$patient2.id) !== null && _$Encounter$patient_i15 !== void 0 ? _$Encounter$patient_i15 : null
38680
+ })
38529
38681
  };
38530
38682
  }) : [];
38531
38683
  return _context5.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -38570,34 +38722,66 @@ var GET_TODAY_VISITS = createAsyncThunk("appointmentStatsApiSlice/getTodayVisits
38570
38722
  case 5:
38571
38723
  data = _context6.sent;
38572
38724
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result6 = data.result) === null || _data$result6 === void 0 ? void 0 : _data$result6.map(function (_) {
38573
- var _$Appointment51, _$Appointment51$Perso, _$Appointment51$Perso2, _$Appointment51$Perso3, _$Appointment51$Perso4, _$Appointment52, _$Appointment52$Perso, _$Appointment52$Perso2, _$Appointment52$Perso3, _$Appointment52$Perso4, _$Encounter36, _$Encounter36$patient, _$Encounter36$patient2, _$Encounter36$patient3, _$Encounter37, _$Encounter37$patient, _$Encounter37$patient2, _$Appointment53, _$Appointment54, _$Appointment55, _$Appointment56, _$Appointment57, _$Appointment57$Speci, _$Encounter38, _$Encounter38$practit, _$Encounter38$practit2, _$Appointment58, _$Appointment58$Perso, _$Appointment58$Perso2, _$Encounter$appointme6, _$Encounter39, _$Encounter39$appoint, _$Appointment59, _$Appointment59$Perso, _$Appointment59$Perso2, _$Appointment60, _$Appointment60$Perso, _$Appointment60$Perso2, _$Encounter40, _$Encounter40$patient, _$Encounter40$patient2, _$Encounter40$patient3, _$Encounter40$patient4, _$Encounter41, _$Encounter42, _$Encounter42$status;
38725
+ var _$Encounter57, _$Encounter57$patient, _$Encounter57$patient2, _$Encounter57$patient3, _$Encounter58, _$Encounter58$patient, _$Encounter58$patient2, _$Appointment46, _$Appointment46$Perso, _$Appointment46$Perso2, _$Appointment47, _$Appointment48, _$Appointment49, _$Appointment50, _$Encounter59, _$Encounter60, _$Encounter60$status, _$Encounter$appointme17, _$Encounter61, _$Encounter61$appoint, _$Encounter$appointme18, _$Encounter62, _$Encounter62$appoint, _$Encounter63, _$Encounter63$patient, _$Encounter63$patient2, _$Encounter63$patient3, _$Encounter63$patient4, _$Appointment$PersonI17, _$Appointment51, _$Appointment51$Perso, _$Appointment51$Perso2, _$Encounter$patient_i16, _$Encounter64, _$Encounter64$patient, _$Encounter64$patient2, _$Encounter$appointme19, _$Encounter65, _$Encounter65$appoint, _$Encounter66, _$Encounter66$patient, _$Encounter66$patient2, _$Encounter66$patient3, _$Encounter66$patient4, _$Appointment$PersonI18, _$Appointment52, _$Appointment52$Perso, _$Appointment52$Perso2, _$Encounter$patient_i17, _$Encounter67, _$Encounter67$patient, _$Encounter67$patient2, _$Encounter$appointme20, _$Encounter68, _$Encounter68$appoint, _$Encounter69, _$Encounter69$patient, _$Encounter69$patient2, _$Encounter69$patient3, _$Encounter69$patient4, _$Appointment$PersonI19, _$Appointment53, _$Appointment53$Perso, _$Appointment53$Perso2, _$Encounter$patient_i18, _$Encounter70, _$Encounter70$patient, _$Encounter70$patient2;
38574
38726
 
38575
38727
  return {
38576
- img: (_ === null || _ === void 0 ? void 0 : (_$Appointment51 = _.Appointment) === null || _$Appointment51 === void 0 ? void 0 : (_$Appointment51$Perso = _$Appointment51.PersonID) === null || _$Appointment51$Perso === void 0 ? void 0 : (_$Appointment51$Perso2 = _$Appointment51$Perso[0]) === null || _$Appointment51$Perso2 === void 0 ? void 0 : (_$Appointment51$Perso3 = _$Appointment51$Perso2.photo) === null || _$Appointment51$Perso3 === void 0 ? void 0 : (_$Appointment51$Perso4 = _$Appointment51$Perso3[0]) === null || _$Appointment51$Perso4 === void 0 ? void 0 : _$Appointment51$Perso4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$Appointment52 = _.Appointment) === null || _$Appointment52 === void 0 ? void 0 : (_$Appointment52$Perso = _$Appointment52.PersonID) === null || _$Appointment52$Perso === void 0 ? void 0 : (_$Appointment52$Perso2 = _$Appointment52$Perso[0]) === null || _$Appointment52$Perso2 === void 0 ? void 0 : (_$Appointment52$Perso3 = _$Appointment52$Perso2.photo) === null || _$Appointment52$Perso3 === void 0 ? void 0 : (_$Appointment52$Perso4 = _$Appointment52$Perso3[0]) === null || _$Appointment52$Perso4 === void 0 ? void 0 : _$Appointment52$Perso4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38577
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter36 = _.Encounter) === null || _$Encounter36 === void 0 ? void 0 : (_$Encounter36$patient = _$Encounter36.patient_id) === null || _$Encounter36$patient === void 0 ? void 0 : (_$Encounter36$patient2 = _$Encounter36$patient[0]) === null || _$Encounter36$patient2 === void 0 ? void 0 : (_$Encounter36$patient3 = _$Encounter36$patient2.name) === null || _$Encounter36$patient3 === void 0 ? void 0 : _$Encounter36$patient3[0]) || {}),
38578
- mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter37 = _.Encounter) === null || _$Encounter37 === void 0 ? void 0 : (_$Encounter37$patient = _$Encounter37.patient_id) === null || _$Encounter37$patient === void 0 ? void 0 : (_$Encounter37$patient2 = _$Encounter37$patient[0]) === null || _$Encounter37$patient2 === void 0 ? void 0 : _$Encounter37$patient2.MRN,
38579
- date: (_ === null || _ === void 0 ? void 0 : (_$Appointment53 = _.Appointment) === null || _$Appointment53 === void 0 ? void 0 : _$Appointment53.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment54 = _.Appointment) === null || _$Appointment54 === void 0 ? void 0 : _$Appointment54.start, "DD MMM,YYYY") : "",
38580
- time: (_ === null || _ === void 0 ? void 0 : (_$Appointment55 = _.Appointment) === null || _$Appointment55 === void 0 ? void 0 : _$Appointment55.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment56 = _.Appointment) === null || _$Appointment56 === void 0 ? void 0 : _$Appointment56.start, "hh:mm A") : "",
38581
- speciality: _ === null || _ === void 0 ? void 0 : (_$Appointment57 = _.Appointment) === null || _$Appointment57 === void 0 ? void 0 : (_$Appointment57$Speci = _$Appointment57.SpecialtyID) === null || _$Appointment57$Speci === void 0 ? void 0 : _$Appointment57$Speci.map(function (spl) {
38582
- var _spl$coding6, _spl$coding6$;
38583
-
38584
- return spl === null || spl === void 0 ? void 0 : (_spl$coding6 = spl.coding) === null || _spl$coding6 === void 0 ? void 0 : (_spl$coding6$ = _spl$coding6[0]) === null || _spl$coding6$ === void 0 ? void 0 : _spl$coding6$.display;
38585
- }).join(", "),
38586
- clinic: _ === null || _ === void 0 ? void 0 : (_$Encounter38 = _.Encounter) === null || _$Encounter38 === void 0 ? void 0 : (_$Encounter38$practit = _$Encounter38.practitioner_details) === null || _$Encounter38$practit === void 0 ? void 0 : (_$Encounter38$practit2 = _$Encounter38$practit[0]) === null || _$Encounter38$practit2 === void 0 ? void 0 : _$Encounter38$practit2.clinic,
38587
- dob: _ === null || _ === void 0 ? void 0 : (_$Appointment58 = _.Appointment) === null || _$Appointment58 === void 0 ? void 0 : (_$Appointment58$Perso = _$Appointment58.PersonID) === null || _$Appointment58$Perso === void 0 ? void 0 : (_$Appointment58$Perso2 = _$Appointment58$Perso[0]) === null || _$Appointment58$Perso2 === void 0 ? void 0 : _$Appointment58$Perso2.birthDay,
38588
- type: "OP",
38589
- appNo: (_$Encounter$appointme6 = _ === null || _ === void 0 ? void 0 : (_$Encounter39 = _.Encounter) === null || _$Encounter39 === void 0 ? void 0 : (_$Encounter39$appoint = _$Encounter39.appointmentId) === null || _$Encounter39$appoint === void 0 ? void 0 : _$Encounter39$appoint[0]) !== null && _$Encounter$appointme6 !== void 0 ? _$Encounter$appointme6 : "",
38590
- data: _,
38591
- enId: _.Encounter.id,
38592
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment59 = _.Appointment) === null || _$Appointment59 === void 0 ? void 0 : (_$Appointment59$Perso = _$Appointment59.PersonID) === null || _$Appointment59$Perso === void 0 ? void 0 : (_$Appointment59$Perso2 = _$Appointment59$Perso[0]) === null || _$Appointment59$Perso2 === void 0 ? void 0 : _$Appointment59$Perso2.birthDay),
38593
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment60 = _.Appointment) === null || _$Appointment60 === void 0 ? void 0 : (_$Appointment60$Perso = _$Appointment60.PersonID) === null || _$Appointment60$Perso === void 0 ? void 0 : (_$Appointment60$Perso2 = _$Appointment60$Perso[0]) === null || _$Appointment60$Perso2 === void 0 ? void 0 : _$Appointment60$Perso2.gender,
38594
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter40 = _.Encounter) === null || _$Encounter40 === void 0 ? void 0 : (_$Encounter40$patient = _$Encounter40.patient_id) === null || _$Encounter40$patient === void 0 ? void 0 : (_$Encounter40$patient2 = _$Encounter40$patient[0]) === null || _$Encounter40$patient2 === void 0 ? void 0 : (_$Encounter40$patient3 = _$Encounter40$patient2.telecom) === null || _$Encounter40$patient3 === void 0 ? void 0 : (_$Encounter40$patient4 = _$Encounter40$patient3[0]) === null || _$Encounter40$patient4 === void 0 ? void 0 : _$Encounter40$patient4.value,
38595
- visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter41 = _.Encounter) === null || _$Encounter41 === void 0 ? void 0 : _$Encounter41.visit_type,
38596
- appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter42 = _.Encounter) === null || _$Encounter42 === void 0 ? void 0 : (_$Encounter42$status = _$Encounter42.status) === null || _$Encounter42$status === void 0 ? void 0 : _$Encounter42$status.display,
38597
- "Register Visit": true,
38598
- "Modify Appointment": true,
38599
- "Cancel Appointment": true,
38600
- "View Profile": true
38728
+ // img: _?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid
38729
+ // ? getImgUrl(_?.Appointment?.PersonID?.[0]?.photo?.[0]?.fileid)
38730
+ // : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38731
+ // name: makeName(_?.Encounter?.patient_id?.[0]?.name?.[0] || {}),
38732
+ // mrn: _?.Encounter?.patient_id?.[0]?.MRN,
38733
+ // date: _?.Appointment?.start
38734
+ // ? utcTOLocal(_?.Appointment?.start, "DD MMM,YYYY")
38735
+ // : "",
38736
+ // time: _?.Appointment?.start
38737
+ // ? utcTOLocal(_?.Appointment?.start, "hh:mm A")
38738
+ // : "",
38739
+ // speciality: _?.Appointment?.SpecialtyID?.map((spl) => {
38740
+ // return spl?.coding?.[0]?.display;
38741
+ // }).join(", "),
38742
+ // clinic: _?.Encounter?.practitioner_details?.[0]?.clinic,
38743
+ // dob: _?.Appointment?.PersonID?.[0]?.birthDay,
38744
+ // type: "OP",
38745
+ // appNo: _?.Encounter?.appointmentId?.[0] ?? "",
38746
+ // data: _,
38747
+ // enId: _.Encounter.id,
38748
+ // age: getAge(_?.Appointment?.PersonID?.[0]?.birthDay),
38749
+ // gender: _?.Appointment?.PersonID?.[0]?.gender,
38750
+ // contact: _?.Encounter?.patient_id?.[0]?.telecom?.[0]?.value,
38751
+ // visitType: _?.Encounter?.visit_type,
38752
+ // appointmentStatus: _?.Encounter?.status?.display,
38753
+ // "Register Visit": true,
38754
+ // "Modify Appointment": true,
38755
+ // "Cancel Appointment": true,
38756
+ // "View Profile": true,
38757
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$Encounter57 = _.Encounter) === null || _$Encounter57 === void 0 ? void 0 : (_$Encounter57$patient = _$Encounter57.patient_id) === null || _$Encounter57$patient === void 0 ? void 0 : (_$Encounter57$patient2 = _$Encounter57$patient[0]) === null || _$Encounter57$patient2 === void 0 ? void 0 : (_$Encounter57$patient3 = _$Encounter57$patient2.name) === null || _$Encounter57$patient3 === void 0 ? void 0 : _$Encounter57$patient3[0]) || {}),
38758
+ mrn: _ === null || _ === void 0 ? void 0 : (_$Encounter58 = _.Encounter) === null || _$Encounter58 === void 0 ? void 0 : (_$Encounter58$patient = _$Encounter58.patient_id) === null || _$Encounter58$patient === void 0 ? void 0 : (_$Encounter58$patient2 = _$Encounter58$patient[0]) === null || _$Encounter58$patient2 === void 0 ? void 0 : _$Encounter58$patient2.MRN,
38759
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment46 = _.Appointment) === null || _$Appointment46 === void 0 ? void 0 : (_$Appointment46$Perso = _$Appointment46.PersonID) === null || _$Appointment46$Perso === void 0 ? void 0 : (_$Appointment46$Perso2 = _$Appointment46$Perso[0]) === null || _$Appointment46$Perso2 === void 0 ? void 0 : _$Appointment46$Perso2.birthDay),
38760
+ date: "".concat((_ === null || _ === void 0 ? void 0 : (_$Appointment47 = _.Appointment) === null || _$Appointment47 === void 0 ? void 0 : _$Appointment47.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment48 = _.Appointment) === null || _$Appointment48 === void 0 ? void 0 : _$Appointment48.start, "DD MMM,YYYY") : "", ",").concat((_ === null || _ === void 0 ? void 0 : (_$Appointment49 = _.Appointment) === null || _$Appointment49 === void 0 ? void 0 : _$Appointment49.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment50 = _.Appointment) === null || _$Appointment50 === void 0 ? void 0 : _$Appointment50.start, "hh:mm A") : ""),
38761
+ visitType: _ === null || _ === void 0 ? void 0 : (_$Encounter59 = _.Encounter) === null || _$Encounter59 === void 0 ? void 0 : _$Encounter59.visit_type,
38762
+ appointmentStatus: _ === null || _ === void 0 ? void 0 : (_$Encounter60 = _.Encounter) === null || _$Encounter60 === void 0 ? void 0 : (_$Encounter60$status = _$Encounter60.status) === null || _$Encounter60$status === void 0 ? void 0 : _$Encounter60$status.display,
38763
+ refNo: (_$Encounter$appointme17 = _ === null || _ === void 0 ? void 0 : (_$Encounter61 = _.Encounter) === null || _$Encounter61 === void 0 ? void 0 : (_$Encounter61$appoint = _$Encounter61.appointmentId) === null || _$Encounter61$appoint === void 0 ? void 0 : _$Encounter61$appoint[0]) !== null && _$Encounter$appointme17 !== void 0 ? _$Encounter$appointme17 : "",
38764
+ viewaction: JSON.stringify({
38765
+ appNo: (_$Encounter$appointme18 = _ === null || _ === void 0 ? void 0 : (_$Encounter62 = _.Encounter) === null || _$Encounter62 === void 0 ? void 0 : (_$Encounter62$appoint = _$Encounter62.appointmentId) === null || _$Encounter62$appoint === void 0 ? void 0 : _$Encounter62$appoint[0]) !== null && _$Encounter$appointme18 !== void 0 ? _$Encounter$appointme18 : "",
38766
+ enId: _.Encounter.id,
38767
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter63 = _.Encounter) === null || _$Encounter63 === void 0 ? void 0 : (_$Encounter63$patient = _$Encounter63.patient_id) === null || _$Encounter63$patient === void 0 ? void 0 : (_$Encounter63$patient2 = _$Encounter63$patient[0]) === null || _$Encounter63$patient2 === void 0 ? void 0 : (_$Encounter63$patient3 = _$Encounter63$patient2.telecom) === null || _$Encounter63$patient3 === void 0 ? void 0 : (_$Encounter63$patient4 = _$Encounter63$patient3[0]) === null || _$Encounter63$patient4 === void 0 ? void 0 : _$Encounter63$patient4.value,
38768
+ personId: (_$Appointment$PersonI17 = _ === null || _ === void 0 ? void 0 : (_$Appointment51 = _.Appointment) === null || _$Appointment51 === void 0 ? void 0 : (_$Appointment51$Perso = _$Appointment51.PersonID) === null || _$Appointment51$Perso === void 0 ? void 0 : (_$Appointment51$Perso2 = _$Appointment51$Perso[0]) === null || _$Appointment51$Perso2 === void 0 ? void 0 : _$Appointment51$Perso2.Id) !== null && _$Appointment$PersonI17 !== void 0 ? _$Appointment$PersonI17 : null,
38769
+ patientId: (_$Encounter$patient_i16 = _ === null || _ === void 0 ? void 0 : (_$Encounter64 = _.Encounter) === null || _$Encounter64 === void 0 ? void 0 : (_$Encounter64$patient = _$Encounter64.patient_id) === null || _$Encounter64$patient === void 0 ? void 0 : (_$Encounter64$patient2 = _$Encounter64$patient[0]) === null || _$Encounter64$patient2 === void 0 ? void 0 : _$Encounter64$patient2.id) !== null && _$Encounter$patient_i16 !== void 0 ? _$Encounter$patient_i16 : null
38770
+ }),
38771
+ modifyaction: JSON.stringify({
38772
+ appNo: (_$Encounter$appointme19 = _ === null || _ === void 0 ? void 0 : (_$Encounter65 = _.Encounter) === null || _$Encounter65 === void 0 ? void 0 : (_$Encounter65$appoint = _$Encounter65.appointmentId) === null || _$Encounter65$appoint === void 0 ? void 0 : _$Encounter65$appoint[0]) !== null && _$Encounter$appointme19 !== void 0 ? _$Encounter$appointme19 : "",
38773
+ enId: _.Encounter.id,
38774
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter66 = _.Encounter) === null || _$Encounter66 === void 0 ? void 0 : (_$Encounter66$patient = _$Encounter66.patient_id) === null || _$Encounter66$patient === void 0 ? void 0 : (_$Encounter66$patient2 = _$Encounter66$patient[0]) === null || _$Encounter66$patient2 === void 0 ? void 0 : (_$Encounter66$patient3 = _$Encounter66$patient2.telecom) === null || _$Encounter66$patient3 === void 0 ? void 0 : (_$Encounter66$patient4 = _$Encounter66$patient3[0]) === null || _$Encounter66$patient4 === void 0 ? void 0 : _$Encounter66$patient4.value,
38775
+ personId: (_$Appointment$PersonI18 = _ === null || _ === void 0 ? void 0 : (_$Appointment52 = _.Appointment) === null || _$Appointment52 === void 0 ? void 0 : (_$Appointment52$Perso = _$Appointment52.PersonID) === null || _$Appointment52$Perso === void 0 ? void 0 : (_$Appointment52$Perso2 = _$Appointment52$Perso[0]) === null || _$Appointment52$Perso2 === void 0 ? void 0 : _$Appointment52$Perso2.Id) !== null && _$Appointment$PersonI18 !== void 0 ? _$Appointment$PersonI18 : null,
38776
+ patientId: (_$Encounter$patient_i17 = _ === null || _ === void 0 ? void 0 : (_$Encounter67 = _.Encounter) === null || _$Encounter67 === void 0 ? void 0 : (_$Encounter67$patient = _$Encounter67.patient_id) === null || _$Encounter67$patient === void 0 ? void 0 : (_$Encounter67$patient2 = _$Encounter67$patient[0]) === null || _$Encounter67$patient2 === void 0 ? void 0 : _$Encounter67$patient2.id) !== null && _$Encounter$patient_i17 !== void 0 ? _$Encounter$patient_i17 : null
38777
+ }),
38778
+ cancelaction: JSON.stringify({
38779
+ appNo: (_$Encounter$appointme20 = _ === null || _ === void 0 ? void 0 : (_$Encounter68 = _.Encounter) === null || _$Encounter68 === void 0 ? void 0 : (_$Encounter68$appoint = _$Encounter68.appointmentId) === null || _$Encounter68$appoint === void 0 ? void 0 : _$Encounter68$appoint[0]) !== null && _$Encounter$appointme20 !== void 0 ? _$Encounter$appointme20 : "",
38780
+ enId: _.Encounter.id,
38781
+ contact: _ === null || _ === void 0 ? void 0 : (_$Encounter69 = _.Encounter) === null || _$Encounter69 === void 0 ? void 0 : (_$Encounter69$patient = _$Encounter69.patient_id) === null || _$Encounter69$patient === void 0 ? void 0 : (_$Encounter69$patient2 = _$Encounter69$patient[0]) === null || _$Encounter69$patient2 === void 0 ? void 0 : (_$Encounter69$patient3 = _$Encounter69$patient2.telecom) === null || _$Encounter69$patient3 === void 0 ? void 0 : (_$Encounter69$patient4 = _$Encounter69$patient3[0]) === null || _$Encounter69$patient4 === void 0 ? void 0 : _$Encounter69$patient4.value,
38782
+ personId: (_$Appointment$PersonI19 = _ === null || _ === void 0 ? void 0 : (_$Appointment53 = _.Appointment) === null || _$Appointment53 === void 0 ? void 0 : (_$Appointment53$Perso = _$Appointment53.PersonID) === null || _$Appointment53$Perso === void 0 ? void 0 : (_$Appointment53$Perso2 = _$Appointment53$Perso[0]) === null || _$Appointment53$Perso2 === void 0 ? void 0 : _$Appointment53$Perso2.Id) !== null && _$Appointment$PersonI19 !== void 0 ? _$Appointment$PersonI19 : null,
38783
+ patientId: (_$Encounter$patient_i18 = _ === null || _ === void 0 ? void 0 : (_$Encounter70 = _.Encounter) === null || _$Encounter70 === void 0 ? void 0 : (_$Encounter70$patient = _$Encounter70.patient_id) === null || _$Encounter70$patient === void 0 ? void 0 : (_$Encounter70$patient2 = _$Encounter70$patient[0]) === null || _$Encounter70$patient2 === void 0 ? void 0 : _$Encounter70$patient2.id) !== null && _$Encounter$patient_i18 !== void 0 ? _$Encounter$patient_i18 : null
38784
+ })
38601
38785
  };
38602
38786
  }) : [];
38603
38787
  return _context6.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -38643,31 +38827,47 @@ var GET_APPOINTMENTS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getAppoi
38643
38827
  case 5:
38644
38828
  data = _context7.sent;
38645
38829
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result7 = data.result) === null || _data$result7 === void 0 ? void 0 : _data$result7.map(function (_) {
38646
- var _$appointmentId, _$appointmentId$, _$appointmentId$$Pers, _$appointmentId$$Pers2, _$appointmentId$$Pers3, _$appointmentId$$Pers4, _$appointmentId2, _$appointmentId2$, _$appointmentId2$$Per, _$appointmentId2$$Per2, _$appointmentId2$$Per3, _$appointmentId2$$Per4, _$patient_id, _$patient_id$, _$patient_id$$name, _$patient_id2, _$patient_id2$, _$patient_id3, _$patient_id3$, _$appointmentId3, _$appointmentId3$, _$appointmentId4, _$appointmentId4$, _$appointmentId5, _$appointmentId5$, _$appointmentId6, _$appointmentId6$, _$appointmentId7, _$appointmentId7$, _$visit_type, _$appointmentId8, _$appointmentId8$, _$appointmentId8$$Spe, _$practitioner_detail, _$practitioner_detail2, _$status, _$Encounter$appointme7, _$Encounter43, _$Encounter43$appoint, _$Appointment61, _$Appointment61$Perso, _$Appointment61$Perso2, _$Appointment62, _$Appointment62$Perso, _$Appointment62$Perso2, _$Encounter44, _$Encounter44$patient, _$Encounter44$patient2, _$Encounter44$patient3, _$Encounter44$patient4, _ref15;
38830
+ var _$Appointment54, _$Appointment54$Perso, _$Appointment54$Perso2, _$Appointment54$Perso3, _$Appointment54$Perso4, _$Appointment55, _$Appointment55$Perso, _$Appointment55$Perso2, _$Appointment55$Perso3, _$Appointment55$Perso4, _$Appointment56, _$Appointment56$Perso, _$Appointment56$Perso2, _$Appointment56$Perso3, _$Appointment57, _$Appointment57$Perso, _$Appointment57$Perso2, _$Appointment58, _$Appointment58$Perso, _$Appointment58$Perso2, _$Appointment58$Perso3, _$Appointment$PersonI20, _$Appointment59, _$Appointment59$Perso, _$Appointment59$Perso2, _$Appointment59$Perso3, _$Appointment59$Perso4, _$Appointment60, _$Appointment61, _$Appointment62, _$Appointment63, _$Appointment64, _$Appointment$appoint2, _$Appointment65, _$Appointment$Special, _$Appointment66, _$Appointment66$Speci, _$Appointment$orgid$n, _$Appointment67, _$Appointment67$orgid, _$practitioner_detail, _$practitioner_detail2, _$Appointment68;
38647
38831
 
38648
- return _ref15 = {
38649
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId = _.appointmentId) === null || _$appointmentId === void 0 ? void 0 : (_$appointmentId$ = _$appointmentId[0]) === null || _$appointmentId$ === void 0 ? void 0 : (_$appointmentId$$Pers = _$appointmentId$.PersonID) === null || _$appointmentId$$Pers === void 0 ? void 0 : (_$appointmentId$$Pers2 = _$appointmentId$$Pers[0]) === null || _$appointmentId$$Pers2 === void 0 ? void 0 : (_$appointmentId$$Pers3 = _$appointmentId$$Pers2.photo) === null || _$appointmentId$$Pers3 === void 0 ? void 0 : (_$appointmentId$$Pers4 = _$appointmentId$$Pers3[0]) === null || _$appointmentId$$Pers4 === void 0 ? void 0 : _$appointmentId$$Pers4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId2 = _.appointmentId) === null || _$appointmentId2 === void 0 ? void 0 : (_$appointmentId2$ = _$appointmentId2[0]) === null || _$appointmentId2$ === void 0 ? void 0 : (_$appointmentId2$$Per = _$appointmentId2$.PersonID) === null || _$appointmentId2$$Per === void 0 ? void 0 : (_$appointmentId2$$Per2 = _$appointmentId2$$Per[0]) === null || _$appointmentId2$$Per2 === void 0 ? void 0 : (_$appointmentId2$$Per3 = _$appointmentId2$$Per2.photo) === null || _$appointmentId2$$Per3 === void 0 ? void 0 : (_$appointmentId2$$Per4 = _$appointmentId2$$Per3[0]) === null || _$appointmentId2$$Per4 === void 0 ? void 0 : _$appointmentId2$$Per4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38650
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id = _.patient_id) === null || _$patient_id === void 0 ? void 0 : (_$patient_id$ = _$patient_id[0]) === null || _$patient_id$ === void 0 ? void 0 : (_$patient_id$$name = _$patient_id$.name) === null || _$patient_id$$name === void 0 ? void 0 : _$patient_id$$name[0]) || {}),
38651
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id2 = _.patient_id) === null || _$patient_id2 === void 0 ? void 0 : (_$patient_id2$ = _$patient_id2[0]) === null || _$patient_id2$ === void 0 ? void 0 : _$patient_id2$.alias) || "",
38652
- age: _ === null || _ === void 0 ? void 0 : (_$patient_id3 = _.patient_id) === null || _$patient_id3 === void 0 ? void 0 : (_$patient_id3$ = _$patient_id3[0]) === null || _$patient_id3$ === void 0 ? void 0 : _$patient_id3$.age,
38653
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId3 = _.appointmentId) === null || _$appointmentId3 === void 0 ? void 0 : (_$appointmentId3$ = _$appointmentId3[0]) === null || _$appointmentId3$ === void 0 ? void 0 : _$appointmentId3$.appno) || "",
38654
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId4 = _.appointmentId) === null || _$appointmentId4 === void 0 ? void 0 : (_$appointmentId4$ = _$appointmentId4[0]) === null || _$appointmentId4$ === void 0 ? void 0 : _$appointmentId4$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId5 = _.appointmentId) === null || _$appointmentId5 === void 0 ? void 0 : (_$appointmentId5$ = _$appointmentId5[0]) === null || _$appointmentId5$ === void 0 ? void 0 : _$appointmentId5$.start, "DD MMM,YYYY") : "",
38655
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId6 = _.appointmentId) === null || _$appointmentId6 === void 0 ? void 0 : (_$appointmentId6$ = _$appointmentId6[0]) === null || _$appointmentId6$ === void 0 ? void 0 : _$appointmentId6$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId7 = _.appointmentId) === null || _$appointmentId7 === void 0 ? void 0 : (_$appointmentId7$ = _$appointmentId7[0]) === null || _$appointmentId7$ === void 0 ? void 0 : _$appointmentId7$.start, "hh:mm A") : "",
38656
- visitType: (_$visit_type = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type !== void 0 ? _$visit_type : "",
38657
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId8 = _.appointmentId) === null || _$appointmentId8 === void 0 ? void 0 : (_$appointmentId8$ = _$appointmentId8[0]) === null || _$appointmentId8$ === void 0 ? void 0 : (_$appointmentId8$$Spe = _$appointmentId8$.SpecialtyID) === null || _$appointmentId8$$Spe === void 0 ? void 0 : _$appointmentId8$$Spe.map(function (spl) {
38658
- var _spl$coding7, _spl$coding7$;
38659
-
38660
- return spl === null || spl === void 0 ? void 0 : (_spl$coding7 = spl.coding) === null || _spl$coding7 === void 0 ? void 0 : (_spl$coding7$ = _spl$coding7[0]) === null || _spl$coding7$ === void 0 ? void 0 : _spl$coding7$.display;
38661
- }).join(", "),
38832
+ return {
38833
+ img: (_ === null || _ === void 0 ? void 0 : (_$Appointment54 = _.Appointment) === null || _$Appointment54 === void 0 ? void 0 : (_$Appointment54$Perso = _$Appointment54.PersonID) === null || _$Appointment54$Perso === void 0 ? void 0 : (_$Appointment54$Perso2 = _$Appointment54$Perso[0]) === null || _$Appointment54$Perso2 === void 0 ? void 0 : (_$Appointment54$Perso3 = _$Appointment54$Perso2.photo) === null || _$Appointment54$Perso3 === void 0 ? void 0 : (_$Appointment54$Perso4 = _$Appointment54$Perso3[0]) === null || _$Appointment54$Perso4 === void 0 ? void 0 : _$Appointment54$Perso4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$Appointment55 = _.Appointment) === null || _$Appointment55 === void 0 ? void 0 : (_$Appointment55$Perso = _$Appointment55.PersonID) === null || _$Appointment55$Perso === void 0 ? void 0 : (_$Appointment55$Perso2 = _$Appointment55$Perso[0]) === null || _$Appointment55$Perso2 === void 0 ? void 0 : (_$Appointment55$Perso3 = _$Appointment55$Perso2.photo) === null || _$Appointment55$Perso3 === void 0 ? void 0 : (_$Appointment55$Perso4 = _$Appointment55$Perso3[0]) === null || _$Appointment55$Perso4 === void 0 ? void 0 : _$Appointment55$Perso4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38834
+ name: JSON.stringify({
38835
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$Appointment56 = _.Appointment) === null || _$Appointment56 === void 0 ? void 0 : (_$Appointment56$Perso = _$Appointment56.PersonID) === null || _$Appointment56$Perso === void 0 ? void 0 : (_$Appointment56$Perso2 = _$Appointment56$Perso[0]) === null || _$Appointment56$Perso2 === void 0 ? void 0 : (_$Appointment56$Perso3 = _$Appointment56$Perso2.name) === null || _$Appointment56$Perso3 === void 0 ? void 0 : _$Appointment56$Perso3[0]) || {}),
38836
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment57 = _.Appointment) === null || _$Appointment57 === void 0 ? void 0 : (_$Appointment57$Perso = _$Appointment57.PersonID) === null || _$Appointment57$Perso === void 0 ? void 0 : (_$Appointment57$Perso2 = _$Appointment57$Perso[0]) === null || _$Appointment57$Perso2 === void 0 ? void 0 : _$Appointment57$Perso2.birthDay),
38837
+ mrn: (_$Appointment58 = _.Appointment) === null || _$Appointment58 === void 0 ? void 0 : (_$Appointment58$Perso = _$Appointment58.PersonID) === null || _$Appointment58$Perso === void 0 ? void 0 : (_$Appointment58$Perso2 = _$Appointment58$Perso[0]) === null || _$Appointment58$Perso2 === void 0 ? void 0 : (_$Appointment58$Perso3 = _$Appointment58$Perso2.MRN) === null || _$Appointment58$Perso3 === void 0 ? void 0 : _$Appointment58$Perso3[0],
38838
+ // genderData: "M",
38839
+ contact: (_$Appointment$PersonI20 = (_$Appointment59 = _.Appointment) === null || _$Appointment59 === void 0 ? void 0 : (_$Appointment59$Perso = _$Appointment59.PersonID) === null || _$Appointment59$Perso === void 0 ? void 0 : (_$Appointment59$Perso2 = _$Appointment59$Perso[0]) === null || _$Appointment59$Perso2 === void 0 ? void 0 : (_$Appointment59$Perso3 = _$Appointment59$Perso2.telecom) === null || _$Appointment59$Perso3 === void 0 ? void 0 : (_$Appointment59$Perso4 = _$Appointment59$Perso3[0]) === null || _$Appointment59$Perso4 === void 0 ? void 0 : _$Appointment59$Perso4.value) !== null && _$Appointment$PersonI20 !== void 0 ? _$Appointment$PersonI20 : ""
38840
+ }),
38841
+ // mrn: _?.patient_id?.[0]?.alias || "",
38842
+ // age: _?.patient_id?.[0]?.age,
38843
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$Appointment60 = _.Appointment) === null || _$Appointment60 === void 0 ? void 0 : _$Appointment60.appno) || "",
38844
+ date: JSON.stringify({
38845
+ date: (_ === null || _ === void 0 ? void 0 : (_$Appointment61 = _.Appointment) === null || _$Appointment61 === void 0 ? void 0 : _$Appointment61.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment62 = _.Appointment) === null || _$Appointment62 === void 0 ? void 0 : _$Appointment62.start, "DD MMM,YYYY") : "",
38846
+ time: (_ === null || _ === void 0 ? void 0 : (_$Appointment63 = _.Appointment) === null || _$Appointment63 === void 0 ? void 0 : _$Appointment63.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment64 = _.Appointment) === null || _$Appointment64 === void 0 ? void 0 : _$Appointment64.start, "hh:mm A") : ""
38847
+ }),
38848
+ visitType: (_$Appointment$appoint2 = _ === null || _ === void 0 ? void 0 : (_$Appointment65 = _.Appointment) === null || _$Appointment65 === void 0 ? void 0 : _$Appointment65.appointmentType) !== null && _$Appointment$appoint2 !== void 0 ? _$Appointment$appoint2 : "",
38849
+ speciality: JSON.stringify({
38850
+ speciality: (_$Appointment$Special = _ === null || _ === void 0 ? void 0 : (_$Appointment66 = _.Appointment) === null || _$Appointment66 === void 0 ? void 0 : (_$Appointment66$Speci = _$Appointment66.SpecialtyID) === null || _$Appointment66$Speci === void 0 ? void 0 : _$Appointment66$Speci.map(function (spl) {
38851
+ var _spl$coding, _spl$coding$;
38852
+
38853
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding = spl.coding) === null || _spl$coding === void 0 ? void 0 : (_spl$coding$ = _spl$coding[0]) === null || _spl$coding$ === void 0 ? void 0 : _spl$coding$.display;
38854
+ }).join(", ")) !== null && _$Appointment$Special !== void 0 ? _$Appointment$Special : "",
38855
+ clinic: (_$Appointment$orgid$n = _ === null || _ === void 0 ? void 0 : (_$Appointment67 = _.Appointment) === null || _$Appointment67 === void 0 ? void 0 : (_$Appointment67$orgid = _$Appointment67.orgid) === null || _$Appointment67$orgid === void 0 ? void 0 : _$Appointment67$orgid.name) !== null && _$Appointment$orgid$n !== void 0 ? _$Appointment$orgid$n : ""
38856
+ }),
38662
38857
  clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail = _.practitioner_details) === null || _$practitioner_detail === void 0 ? void 0 : (_$practitioner_detail2 = _$practitioner_detail[0]) === null || _$practitioner_detail2 === void 0 ? void 0 : _$practitioner_detail2.clinic) || "",
38663
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status = _.status) === null || _$status === void 0 ? void 0 : _$status.display) || "",
38858
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$Appointment68 = _.Appointment) === null || _$Appointment68 === void 0 ? void 0 : _$Appointment68.appstatus) || "",
38664
38859
  "View Patient": true,
38665
38860
  Attend: true,
38666
- type: "OP",
38667
- appNo: (_$Encounter$appointme7 = _ === null || _ === void 0 ? void 0 : (_$Encounter43 = _.Encounter) === null || _$Encounter43 === void 0 ? void 0 : (_$Encounter43$appoint = _$Encounter43.appointmentId) === null || _$Encounter43$appoint === void 0 ? void 0 : _$Encounter43$appoint[0]) !== null && _$Encounter$appointme7 !== void 0 ? _$Encounter$appointme7 : "",
38668
- data: _,
38669
- enId: _.Encounter.id
38670
- }, _defineProperty(_ref15, "age", getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment61 = _.Appointment) === null || _$Appointment61 === void 0 ? void 0 : (_$Appointment61$Perso = _$Appointment61.PersonID) === null || _$Appointment61$Perso === void 0 ? void 0 : (_$Appointment61$Perso2 = _$Appointment61$Perso[0]) === null || _$Appointment61$Perso2 === void 0 ? void 0 : _$Appointment61$Perso2.birthDay)), _defineProperty(_ref15, "gender", _ === null || _ === void 0 ? void 0 : (_$Appointment62 = _.Appointment) === null || _$Appointment62 === void 0 ? void 0 : (_$Appointment62$Perso = _$Appointment62.PersonID) === null || _$Appointment62$Perso === void 0 ? void 0 : (_$Appointment62$Perso2 = _$Appointment62$Perso[0]) === null || _$Appointment62$Perso2 === void 0 ? void 0 : _$Appointment62$Perso2.gender), _defineProperty(_ref15, "contact", _ === null || _ === void 0 ? void 0 : (_$Encounter44 = _.Encounter) === null || _$Encounter44 === void 0 ? void 0 : (_$Encounter44$patient = _$Encounter44.patient_id) === null || _$Encounter44$patient === void 0 ? void 0 : (_$Encounter44$patient2 = _$Encounter44$patient[0]) === null || _$Encounter44$patient2 === void 0 ? void 0 : (_$Encounter44$patient3 = _$Encounter44$patient2.telecom) === null || _$Encounter44$patient3 === void 0 ? void 0 : (_$Encounter44$patient4 = _$Encounter44$patient3[0]) === null || _$Encounter44$patient4 === void 0 ? void 0 : _$Encounter44$patient4.value), _ref15;
38861
+ action: true,
38862
+ type: "OP" // appNo: _?.id ?? '',
38863
+ // // data: _,
38864
+ // enId: _.id,
38865
+ // age: getAge(_?.PersonID?.[0]?.birthDay),
38866
+ // // gender: _?.PersonID?.[0]?.gender,
38867
+ // contact: _?.PersonID?.[0]?.telecom?.[0]?.value ?? "",
38868
+ // pId : _?.patient_id?.id,
38869
+
38870
+ };
38671
38871
  }) : [];
38672
38872
  return _context7.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
38673
38873
  data: returnedData
@@ -38689,7 +38889,7 @@ var GET_APPOINTMENTS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getAppoi
38689
38889
  })));
38690
38890
  var GET_FIRST_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getFirstVisitsNurse", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
38691
38891
  var payload,
38692
- _ref17,
38892
+ _ref16,
38693
38893
  rejectWithValue,
38694
38894
  _data$result8,
38695
38895
  data,
@@ -38701,7 +38901,7 @@ var GET_FIRST_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getFirst
38701
38901
  switch (_context8.prev = _context8.next) {
38702
38902
  case 0:
38703
38903
  payload = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
38704
- _ref17 = _args8.length > 1 ? _args8[1] : undefined, rejectWithValue = _ref17.rejectWithValue;
38904
+ _ref16 = _args8.length > 1 ? _args8[1] : undefined, rejectWithValue = _ref16.rejectWithValue;
38705
38905
  _context8.prev = 2;
38706
38906
  _context8.next = 5;
38707
38907
  return fetchData$3({
@@ -38711,31 +38911,60 @@ var GET_FIRST_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getFirst
38711
38911
  case 5:
38712
38912
  data = _context8.sent;
38713
38913
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result8 = data.result) === null || _data$result8 === void 0 ? void 0 : _data$result8.map(function (_) {
38714
- var _$appointmentId9, _$appointmentId9$, _$appointmentId9$$Per, _$appointmentId9$$Per2, _$appointmentId9$$Per3, _$appointmentId9$$Per4, _$appointmentId10, _$appointmentId10$, _$appointmentId10$$Pe, _$appointmentId10$$Pe2, _$appointmentId10$$Pe3, _$appointmentId10$$Pe4, _$patient_id4, _$patient_id4$, _$patient_id4$$name, _$patient_id5, _$patient_id5$, _$patient_id6, _$patient_id6$, _$appointmentId11, _$appointmentId11$, _$appointmentId12, _$appointmentId12$, _$appointmentId13, _$appointmentId13$, _$appointmentId14, _$appointmentId14$, _$appointmentId15, _$appointmentId15$, _$visit_type2, _$appointmentId16, _$appointmentId16$, _$appointmentId16$$Sp, _$practitioner_detail3, _$practitioner_detail4, _$status2, _$Encounter$appointme8, _$Encounter45, _$Encounter45$appoint, _$Appointment63, _$Appointment63$Perso, _$Appointment63$Perso2, _$Appointment64, _$Appointment64$Perso, _$Appointment64$Perso2, _$Encounter46, _$Encounter46$patient, _$Encounter46$patient2, _$Encounter46$patient3, _$Encounter46$patient4, _ref18;
38715
-
38716
- return _ref18 = {
38717
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId9 = _.appointmentId) === null || _$appointmentId9 === void 0 ? void 0 : (_$appointmentId9$ = _$appointmentId9[0]) === null || _$appointmentId9$ === void 0 ? void 0 : (_$appointmentId9$$Per = _$appointmentId9$.PersonID) === null || _$appointmentId9$$Per === void 0 ? void 0 : (_$appointmentId9$$Per2 = _$appointmentId9$$Per[0]) === null || _$appointmentId9$$Per2 === void 0 ? void 0 : (_$appointmentId9$$Per3 = _$appointmentId9$$Per2.photo) === null || _$appointmentId9$$Per3 === void 0 ? void 0 : (_$appointmentId9$$Per4 = _$appointmentId9$$Per3[0]) === null || _$appointmentId9$$Per4 === void 0 ? void 0 : _$appointmentId9$$Per4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId10 = _.appointmentId) === null || _$appointmentId10 === void 0 ? void 0 : (_$appointmentId10$ = _$appointmentId10[0]) === null || _$appointmentId10$ === void 0 ? void 0 : (_$appointmentId10$$Pe = _$appointmentId10$.PersonID) === null || _$appointmentId10$$Pe === void 0 ? void 0 : (_$appointmentId10$$Pe2 = _$appointmentId10$$Pe[0]) === null || _$appointmentId10$$Pe2 === void 0 ? void 0 : (_$appointmentId10$$Pe3 = _$appointmentId10$$Pe2.photo) === null || _$appointmentId10$$Pe3 === void 0 ? void 0 : (_$appointmentId10$$Pe4 = _$appointmentId10$$Pe3[0]) === null || _$appointmentId10$$Pe4 === void 0 ? void 0 : _$appointmentId10$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38718
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id4 = _.patient_id) === null || _$patient_id4 === void 0 ? void 0 : (_$patient_id4$ = _$patient_id4[0]) === null || _$patient_id4$ === void 0 ? void 0 : (_$patient_id4$$name = _$patient_id4$.name) === null || _$patient_id4$$name === void 0 ? void 0 : _$patient_id4$$name[0]) || {}),
38719
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id5 = _.patient_id) === null || _$patient_id5 === void 0 ? void 0 : (_$patient_id5$ = _$patient_id5[0]) === null || _$patient_id5$ === void 0 ? void 0 : _$patient_id5$.alias) || "",
38720
- age: _ === null || _ === void 0 ? void 0 : (_$patient_id6 = _.patient_id) === null || _$patient_id6 === void 0 ? void 0 : (_$patient_id6$ = _$patient_id6[0]) === null || _$patient_id6$ === void 0 ? void 0 : _$patient_id6$.age,
38721
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId11 = _.appointmentId) === null || _$appointmentId11 === void 0 ? void 0 : (_$appointmentId11$ = _$appointmentId11[0]) === null || _$appointmentId11$ === void 0 ? void 0 : _$appointmentId11$.appno) || "",
38722
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId12 = _.appointmentId) === null || _$appointmentId12 === void 0 ? void 0 : (_$appointmentId12$ = _$appointmentId12[0]) === null || _$appointmentId12$ === void 0 ? void 0 : _$appointmentId12$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId13 = _.appointmentId) === null || _$appointmentId13 === void 0 ? void 0 : (_$appointmentId13$ = _$appointmentId13[0]) === null || _$appointmentId13$ === void 0 ? void 0 : _$appointmentId13$.start, "DD MMM,YYYY") : "",
38723
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId14 = _.appointmentId) === null || _$appointmentId14 === void 0 ? void 0 : (_$appointmentId14$ = _$appointmentId14[0]) === null || _$appointmentId14$ === void 0 ? void 0 : _$appointmentId14$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId15 = _.appointmentId) === null || _$appointmentId15 === void 0 ? void 0 : (_$appointmentId15$ = _$appointmentId15[0]) === null || _$appointmentId15$ === void 0 ? void 0 : _$appointmentId15$.start, "hh:mm A") : "",
38724
- visitType: (_$visit_type2 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type2 !== void 0 ? _$visit_type2 : "",
38725
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId16 = _.appointmentId) === null || _$appointmentId16 === void 0 ? void 0 : (_$appointmentId16$ = _$appointmentId16[0]) === null || _$appointmentId16$ === void 0 ? void 0 : (_$appointmentId16$$Sp = _$appointmentId16$.SpecialtyID) === null || _$appointmentId16$$Sp === void 0 ? void 0 : _$appointmentId16$$Sp.map(function (spl) {
38726
- var _spl$coding8, _spl$coding8$;
38914
+ var _$appointmentId, _$appointmentId$, _$appointmentId$$Pers, _$appointmentId$$Pers2, _$appointmentId$$Pers3, _$appointmentId$$Pers4, _$appointmentId2, _$appointmentId2$, _$appointmentId2$$Per, _$appointmentId2$$Per2, _$appointmentId2$$Per3, _$appointmentId2$$Per4, _$patient_id, _$patient_id$, _$patient_id$$name, _$appointmentId3, _$appointmentId3$, _$appointmentId3$$Per, _$appointmentId3$$Per2, _$patient_id2, _$patient_id2$, _$appointmentId$0$Per, _$appointmentId4, _$appointmentId4$, _$appointmentId4$$Per, _$appointmentId4$$Per2, _$patient_id$0$teleco, _$patient_id3, _$patient_id3$, _$patient_id3$$teleco, _$patient_id3$$teleco2, _$appointmentId5, _$appointmentId5$, _$appointmentId6, _$appointmentId6$, _$appointmentId7, _$appointmentId7$, _$appointmentId8, _$appointmentId8$, _$appointmentId9, _$appointmentId9$, _$visit_type, _$appointmentId10, _$appointmentId10$, _$appointmentId10$$Sp, _$practitioner_detail3, _$practitioner_detail4, _$status;
38727
38915
 
38728
- return spl === null || spl === void 0 ? void 0 : (_spl$coding8 = spl.coding) === null || _spl$coding8 === void 0 ? void 0 : (_spl$coding8$ = _spl$coding8[0]) === null || _spl$coding8$ === void 0 ? void 0 : _spl$coding8$.display;
38729
- }).join(", "),
38730
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail3 = _.practitioner_details) === null || _$practitioner_detail3 === void 0 ? void 0 : (_$practitioner_detail4 = _$practitioner_detail3[0]) === null || _$practitioner_detail4 === void 0 ? void 0 : _$practitioner_detail4.clinic) || "",
38731
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status2 = _.status) === null || _$status2 === void 0 ? void 0 : _$status2.display) || "",
38732
- "View Patient": true,
38733
- Attend: true,
38734
- type: "OP",
38735
- appNo: (_$Encounter$appointme8 = _ === null || _ === void 0 ? void 0 : (_$Encounter45 = _.Encounter) === null || _$Encounter45 === void 0 ? void 0 : (_$Encounter45$appoint = _$Encounter45.appointmentId) === null || _$Encounter45$appoint === void 0 ? void 0 : _$Encounter45$appoint[0]) !== null && _$Encounter$appointme8 !== void 0 ? _$Encounter$appointme8 : "",
38736
- data: _,
38737
- enId: _.Encounter.id
38738
- }, _defineProperty(_ref18, "age", getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment63 = _.Appointment) === null || _$Appointment63 === void 0 ? void 0 : (_$Appointment63$Perso = _$Appointment63.PersonID) === null || _$Appointment63$Perso === void 0 ? void 0 : (_$Appointment63$Perso2 = _$Appointment63$Perso[0]) === null || _$Appointment63$Perso2 === void 0 ? void 0 : _$Appointment63$Perso2.birthDay)), _defineProperty(_ref18, "gender", _ === null || _ === void 0 ? void 0 : (_$Appointment64 = _.Appointment) === null || _$Appointment64 === void 0 ? void 0 : (_$Appointment64$Perso = _$Appointment64.PersonID) === null || _$Appointment64$Perso === void 0 ? void 0 : (_$Appointment64$Perso2 = _$Appointment64$Perso[0]) === null || _$Appointment64$Perso2 === void 0 ? void 0 : _$Appointment64$Perso2.gender), _defineProperty(_ref18, "contact", _ === null || _ === void 0 ? void 0 : (_$Encounter46 = _.Encounter) === null || _$Encounter46 === void 0 ? void 0 : (_$Encounter46$patient = _$Encounter46.patient_id) === null || _$Encounter46$patient === void 0 ? void 0 : (_$Encounter46$patient2 = _$Encounter46$patient[0]) === null || _$Encounter46$patient2 === void 0 ? void 0 : (_$Encounter46$patient3 = _$Encounter46$patient2.telecom) === null || _$Encounter46$patient3 === void 0 ? void 0 : (_$Encounter46$patient4 = _$Encounter46$patient3[0]) === null || _$Encounter46$patient4 === void 0 ? void 0 : _$Encounter46$patient4.value), _ref18;
38916
+ return {
38917
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId = _.appointmentId) === null || _$appointmentId === void 0 ? void 0 : (_$appointmentId$ = _$appointmentId[0]) === null || _$appointmentId$ === void 0 ? void 0 : (_$appointmentId$$Pers = _$appointmentId$.PersonID) === null || _$appointmentId$$Pers === void 0 ? void 0 : (_$appointmentId$$Pers2 = _$appointmentId$$Pers[0]) === null || _$appointmentId$$Pers2 === void 0 ? void 0 : (_$appointmentId$$Pers3 = _$appointmentId$$Pers2.photo) === null || _$appointmentId$$Pers3 === void 0 ? void 0 : (_$appointmentId$$Pers4 = _$appointmentId$$Pers3[0]) === null || _$appointmentId$$Pers4 === void 0 ? void 0 : _$appointmentId$$Pers4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId2 = _.appointmentId) === null || _$appointmentId2 === void 0 ? void 0 : (_$appointmentId2$ = _$appointmentId2[0]) === null || _$appointmentId2$ === void 0 ? void 0 : (_$appointmentId2$$Per = _$appointmentId2$.PersonID) === null || _$appointmentId2$$Per === void 0 ? void 0 : (_$appointmentId2$$Per2 = _$appointmentId2$$Per[0]) === null || _$appointmentId2$$Per2 === void 0 ? void 0 : (_$appointmentId2$$Per3 = _$appointmentId2$$Per2.photo) === null || _$appointmentId2$$Per3 === void 0 ? void 0 : (_$appointmentId2$$Per4 = _$appointmentId2$$Per3[0]) === null || _$appointmentId2$$Per4 === void 0 ? void 0 : _$appointmentId2$$Per4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38918
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
38919
+ // mrn: _?.patient_id?.[0]?.alias || "",
38920
+ // age: _?.patient_id?.[0]?.age,
38921
+ // refNo: _?.appointmentId?.[0]?.appno || "",
38922
+ // date: _?.appointmentId?.[0]?.start
38923
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
38924
+ // : "",
38925
+ // time: _?.appointmentId?.[0]?.start
38926
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
38927
+ // : "",
38928
+ // visitType: _?.visit_type ?? "",
38929
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
38930
+ // return spl?.coding?.[0]?.display;
38931
+ // }).join(", "),
38932
+ // clinic: _?.practitioner_details?.[0]?.clinic || "",
38933
+ // appointmentStatus: _?.status?.display || "",
38934
+ // "View Patient": true,
38935
+ // Attend: true,
38936
+ // type: "OP",
38937
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
38938
+ // data: _,
38939
+ // enId: _.id,
38940
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
38941
+ // // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
38942
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
38943
+ // pId: _?.patient_id?.id ?? "",
38944
+ name: JSON.stringify({
38945
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id = _.patient_id) === null || _$patient_id === void 0 ? void 0 : (_$patient_id$ = _$patient_id[0]) === null || _$patient_id$ === void 0 ? void 0 : (_$patient_id$$name = _$patient_id$.name) === null || _$patient_id$$name === void 0 ? void 0 : _$patient_id$$name[0]) || {}),
38946
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId3 = _.appointmentId) === null || _$appointmentId3 === void 0 ? void 0 : (_$appointmentId3$ = _$appointmentId3[0]) === null || _$appointmentId3$ === void 0 ? void 0 : (_$appointmentId3$$Per = _$appointmentId3$.PersonID) === null || _$appointmentId3$$Per === void 0 ? void 0 : (_$appointmentId3$$Per2 = _$appointmentId3$$Per[0]) === null || _$appointmentId3$$Per2 === void 0 ? void 0 : _$appointmentId3$$Per2.birthDay),
38947
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id2 = _.patient_id) === null || _$patient_id2 === void 0 ? void 0 : (_$patient_id2$ = _$patient_id2[0]) === null || _$patient_id2$ === void 0 ? void 0 : _$patient_id2$.alias) || "",
38948
+ genderData: (_$appointmentId$0$Per = _ === null || _ === void 0 ? void 0 : (_$appointmentId4 = _.appointmentId) === null || _$appointmentId4 === void 0 ? void 0 : (_$appointmentId4$ = _$appointmentId4[0]) === null || _$appointmentId4$ === void 0 ? void 0 : (_$appointmentId4$$Per = _$appointmentId4$.PersonID) === null || _$appointmentId4$$Per === void 0 ? void 0 : (_$appointmentId4$$Per2 = _$appointmentId4$$Per[0]) === null || _$appointmentId4$$Per2 === void 0 ? void 0 : _$appointmentId4$$Per2.gender) !== null && _$appointmentId$0$Per !== void 0 ? _$appointmentId$0$Per : "",
38949
+ contact: (_$patient_id$0$teleco = _ === null || _ === void 0 ? void 0 : (_$patient_id3 = _.patient_id) === null || _$patient_id3 === void 0 ? void 0 : (_$patient_id3$ = _$patient_id3[0]) === null || _$patient_id3$ === void 0 ? void 0 : (_$patient_id3$$teleco = _$patient_id3$.telecom) === null || _$patient_id3$$teleco === void 0 ? void 0 : (_$patient_id3$$teleco2 = _$patient_id3$$teleco[0]) === null || _$patient_id3$$teleco2 === void 0 ? void 0 : _$patient_id3$$teleco2.value) !== null && _$patient_id$0$teleco !== void 0 ? _$patient_id$0$teleco : ""
38950
+ }),
38951
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId5 = _.appointmentId) === null || _$appointmentId5 === void 0 ? void 0 : (_$appointmentId5$ = _$appointmentId5[0]) === null || _$appointmentId5$ === void 0 ? void 0 : _$appointmentId5$.appno) || "",
38952
+ date: JSON.stringify({
38953
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId6 = _.appointmentId) === null || _$appointmentId6 === void 0 ? void 0 : (_$appointmentId6$ = _$appointmentId6[0]) === null || _$appointmentId6$ === void 0 ? void 0 : _$appointmentId6$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId7 = _.appointmentId) === null || _$appointmentId7 === void 0 ? void 0 : (_$appointmentId7$ = _$appointmentId7[0]) === null || _$appointmentId7$ === void 0 ? void 0 : _$appointmentId7$.start, "DD MMM,YYYY") : "",
38954
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId8 = _.appointmentId) === null || _$appointmentId8 === void 0 ? void 0 : (_$appointmentId8$ = _$appointmentId8[0]) === null || _$appointmentId8$ === void 0 ? void 0 : _$appointmentId8$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId9 = _.appointmentId) === null || _$appointmentId9 === void 0 ? void 0 : (_$appointmentId9$ = _$appointmentId9[0]) === null || _$appointmentId9$ === void 0 ? void 0 : _$appointmentId9$.start, "hh:mm A") : ""
38955
+ }),
38956
+ visitType: (_$visit_type = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type !== void 0 ? _$visit_type : "",
38957
+ speciality: JSON.stringify({
38958
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId10 = _.appointmentId) === null || _$appointmentId10 === void 0 ? void 0 : (_$appointmentId10$ = _$appointmentId10[0]) === null || _$appointmentId10$ === void 0 ? void 0 : (_$appointmentId10$$Sp = _$appointmentId10$.SpecialtyID) === null || _$appointmentId10$$Sp === void 0 ? void 0 : _$appointmentId10$$Sp.map(function (spl) {
38959
+ var _spl$coding2, _spl$coding2$;
38960
+
38961
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding2 = spl.coding) === null || _spl$coding2 === void 0 ? void 0 : (_spl$coding2$ = _spl$coding2[0]) === null || _spl$coding2$ === void 0 ? void 0 : _spl$coding2$.display;
38962
+ }).join(", "),
38963
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail3 = _.practitioner_details) === null || _$practitioner_detail3 === void 0 ? void 0 : (_$practitioner_detail4 = _$practitioner_detail3[0]) === null || _$practitioner_detail4 === void 0 ? void 0 : _$practitioner_detail4.clinic) || ""
38964
+ }),
38965
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status = _.status) === null || _$status === void 0 ? void 0 : _$status.display) || "",
38966
+ action: true
38967
+ };
38739
38968
  }) : [];
38740
38969
  return _context8.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
38741
38970
  data: returnedData
@@ -38757,7 +38986,7 @@ var GET_FIRST_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getFirst
38757
38986
  })));
38758
38987
  var GET_NEW_PATIENTS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getNewPatientsNurse", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
38759
38988
  var payload,
38760
- _ref20,
38989
+ _ref18,
38761
38990
  rejectWithValue,
38762
38991
  _data$result9,
38763
38992
  data,
@@ -38769,7 +38998,7 @@ var GET_NEW_PATIENTS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getNewPa
38769
38998
  switch (_context9.prev = _context9.next) {
38770
38999
  case 0:
38771
39000
  payload = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
38772
- _ref20 = _args9.length > 1 ? _args9[1] : undefined, rejectWithValue = _ref20.rejectWithValue;
39001
+ _ref18 = _args9.length > 1 ? _args9[1] : undefined, rejectWithValue = _ref18.rejectWithValue;
38773
39002
  _context9.prev = 2;
38774
39003
  _context9.next = 5;
38775
39004
  return fetchData$3({
@@ -38779,31 +39008,60 @@ var GET_NEW_PATIENTS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getNewPa
38779
39008
  case 5:
38780
39009
  data = _context9.sent;
38781
39010
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result9 = data.result) === null || _data$result9 === void 0 ? void 0 : _data$result9.map(function (_) {
38782
- var _$appointmentId17, _$appointmentId17$, _$appointmentId17$$Pe, _$appointmentId17$$Pe2, _$appointmentId17$$Pe3, _$appointmentId17$$Pe4, _$appointmentId18, _$appointmentId18$, _$appointmentId18$$Pe, _$appointmentId18$$Pe2, _$appointmentId18$$Pe3, _$appointmentId18$$Pe4, _$patient_id7, _$patient_id7$, _$patient_id7$$name, _$patient_id8, _$patient_id8$, _$patient_id9, _$patient_id9$, _$appointmentId19, _$appointmentId19$, _$appointmentId20, _$appointmentId20$, _$appointmentId21, _$appointmentId21$, _$appointmentId22, _$appointmentId22$, _$appointmentId23, _$appointmentId23$, _$visit_type3, _$appointmentId24, _$appointmentId24$, _$appointmentId24$$Sp, _$practitioner_detail5, _$practitioner_detail6, _$status3, _$Encounter$appointme9, _$Encounter47, _$Encounter47$appoint, _$Appointment65, _$Appointment65$Perso, _$Appointment65$Perso2, _$Appointment66, _$Appointment66$Perso, _$Appointment66$Perso2, _$Encounter48, _$Encounter48$patient, _$Encounter48$patient2, _$Encounter48$patient3, _$Encounter48$patient4, _ref21;
38783
-
38784
- return _ref21 = {
38785
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId17 = _.appointmentId) === null || _$appointmentId17 === void 0 ? void 0 : (_$appointmentId17$ = _$appointmentId17[0]) === null || _$appointmentId17$ === void 0 ? void 0 : (_$appointmentId17$$Pe = _$appointmentId17$.PersonID) === null || _$appointmentId17$$Pe === void 0 ? void 0 : (_$appointmentId17$$Pe2 = _$appointmentId17$$Pe[0]) === null || _$appointmentId17$$Pe2 === void 0 ? void 0 : (_$appointmentId17$$Pe3 = _$appointmentId17$$Pe2.photo) === null || _$appointmentId17$$Pe3 === void 0 ? void 0 : (_$appointmentId17$$Pe4 = _$appointmentId17$$Pe3[0]) === null || _$appointmentId17$$Pe4 === void 0 ? void 0 : _$appointmentId17$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId18 = _.appointmentId) === null || _$appointmentId18 === void 0 ? void 0 : (_$appointmentId18$ = _$appointmentId18[0]) === null || _$appointmentId18$ === void 0 ? void 0 : (_$appointmentId18$$Pe = _$appointmentId18$.PersonID) === null || _$appointmentId18$$Pe === void 0 ? void 0 : (_$appointmentId18$$Pe2 = _$appointmentId18$$Pe[0]) === null || _$appointmentId18$$Pe2 === void 0 ? void 0 : (_$appointmentId18$$Pe3 = _$appointmentId18$$Pe2.photo) === null || _$appointmentId18$$Pe3 === void 0 ? void 0 : (_$appointmentId18$$Pe4 = _$appointmentId18$$Pe3[0]) === null || _$appointmentId18$$Pe4 === void 0 ? void 0 : _$appointmentId18$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38786
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id7 = _.patient_id) === null || _$patient_id7 === void 0 ? void 0 : (_$patient_id7$ = _$patient_id7[0]) === null || _$patient_id7$ === void 0 ? void 0 : (_$patient_id7$$name = _$patient_id7$.name) === null || _$patient_id7$$name === void 0 ? void 0 : _$patient_id7$$name[0]) || {}),
38787
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id8 = _.patient_id) === null || _$patient_id8 === void 0 ? void 0 : (_$patient_id8$ = _$patient_id8[0]) === null || _$patient_id8$ === void 0 ? void 0 : _$patient_id8$.alias) || "",
38788
- age: _ === null || _ === void 0 ? void 0 : (_$patient_id9 = _.patient_id) === null || _$patient_id9 === void 0 ? void 0 : (_$patient_id9$ = _$patient_id9[0]) === null || _$patient_id9$ === void 0 ? void 0 : _$patient_id9$.age,
38789
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId19 = _.appointmentId) === null || _$appointmentId19 === void 0 ? void 0 : (_$appointmentId19$ = _$appointmentId19[0]) === null || _$appointmentId19$ === void 0 ? void 0 : _$appointmentId19$.appno) || "",
38790
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId20 = _.appointmentId) === null || _$appointmentId20 === void 0 ? void 0 : (_$appointmentId20$ = _$appointmentId20[0]) === null || _$appointmentId20$ === void 0 ? void 0 : _$appointmentId20$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId21 = _.appointmentId) === null || _$appointmentId21 === void 0 ? void 0 : (_$appointmentId21$ = _$appointmentId21[0]) === null || _$appointmentId21$ === void 0 ? void 0 : _$appointmentId21$.start, "DD MMM,YYYY") : "",
38791
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId22 = _.appointmentId) === null || _$appointmentId22 === void 0 ? void 0 : (_$appointmentId22$ = _$appointmentId22[0]) === null || _$appointmentId22$ === void 0 ? void 0 : _$appointmentId22$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId23 = _.appointmentId) === null || _$appointmentId23 === void 0 ? void 0 : (_$appointmentId23$ = _$appointmentId23[0]) === null || _$appointmentId23$ === void 0 ? void 0 : _$appointmentId23$.start, "hh:mm A") : "",
38792
- visitType: (_$visit_type3 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type3 !== void 0 ? _$visit_type3 : "",
38793
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId24 = _.appointmentId) === null || _$appointmentId24 === void 0 ? void 0 : (_$appointmentId24$ = _$appointmentId24[0]) === null || _$appointmentId24$ === void 0 ? void 0 : (_$appointmentId24$$Sp = _$appointmentId24$.SpecialtyID) === null || _$appointmentId24$$Sp === void 0 ? void 0 : _$appointmentId24$$Sp.map(function (spl) {
38794
- var _spl$coding9, _spl$coding9$;
39011
+ var _$appointmentId11, _$appointmentId11$, _$appointmentId11$$Pe, _$appointmentId11$$Pe2, _$appointmentId11$$Pe3, _$appointmentId11$$Pe4, _$appointmentId12, _$appointmentId12$, _$appointmentId12$$Pe, _$appointmentId12$$Pe2, _$appointmentId12$$Pe3, _$appointmentId12$$Pe4, _$patient_id4, _$patient_id4$, _$patient_id4$$name, _$appointmentId13, _$appointmentId13$, _$appointmentId13$$Pe, _$appointmentId13$$Pe2, _$patient_id5, _$patient_id5$, _$appointmentId$0$Per2, _$appointmentId14, _$appointmentId14$, _$appointmentId14$$Pe, _$appointmentId14$$Pe2, _$patient_id$0$teleco2, _$patient_id6, _$patient_id6$, _$patient_id6$$teleco, _$patient_id6$$teleco2, _$appointmentId15, _$appointmentId15$, _$appointmentId16, _$appointmentId16$, _$appointmentId17, _$appointmentId17$, _$appointmentId18, _$appointmentId18$, _$appointmentId19, _$appointmentId19$, _$visit_type2, _$appointmentId20, _$appointmentId20$, _$appointmentId20$$Sp, _$practitioner_detail5, _$practitioner_detail6, _$status2;
38795
39012
 
38796
- return spl === null || spl === void 0 ? void 0 : (_spl$coding9 = spl.coding) === null || _spl$coding9 === void 0 ? void 0 : (_spl$coding9$ = _spl$coding9[0]) === null || _spl$coding9$ === void 0 ? void 0 : _spl$coding9$.display;
38797
- }).join(", "),
38798
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail5 = _.practitioner_details) === null || _$practitioner_detail5 === void 0 ? void 0 : (_$practitioner_detail6 = _$practitioner_detail5[0]) === null || _$practitioner_detail6 === void 0 ? void 0 : _$practitioner_detail6.clinic) || "",
38799
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status3 = _.status) === null || _$status3 === void 0 ? void 0 : _$status3.display) || "",
38800
- "View Patient": true,
38801
- Attend: true,
38802
- type: "OP",
38803
- appNo: (_$Encounter$appointme9 = _ === null || _ === void 0 ? void 0 : (_$Encounter47 = _.Encounter) === null || _$Encounter47 === void 0 ? void 0 : (_$Encounter47$appoint = _$Encounter47.appointmentId) === null || _$Encounter47$appoint === void 0 ? void 0 : _$Encounter47$appoint[0]) !== null && _$Encounter$appointme9 !== void 0 ? _$Encounter$appointme9 : "",
38804
- data: _,
38805
- enId: _.Encounter.id
38806
- }, _defineProperty(_ref21, "age", getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment65 = _.Appointment) === null || _$Appointment65 === void 0 ? void 0 : (_$Appointment65$Perso = _$Appointment65.PersonID) === null || _$Appointment65$Perso === void 0 ? void 0 : (_$Appointment65$Perso2 = _$Appointment65$Perso[0]) === null || _$Appointment65$Perso2 === void 0 ? void 0 : _$Appointment65$Perso2.birthDay)), _defineProperty(_ref21, "gender", _ === null || _ === void 0 ? void 0 : (_$Appointment66 = _.Appointment) === null || _$Appointment66 === void 0 ? void 0 : (_$Appointment66$Perso = _$Appointment66.PersonID) === null || _$Appointment66$Perso === void 0 ? void 0 : (_$Appointment66$Perso2 = _$Appointment66$Perso[0]) === null || _$Appointment66$Perso2 === void 0 ? void 0 : _$Appointment66$Perso2.gender), _defineProperty(_ref21, "contact", _ === null || _ === void 0 ? void 0 : (_$Encounter48 = _.Encounter) === null || _$Encounter48 === void 0 ? void 0 : (_$Encounter48$patient = _$Encounter48.patient_id) === null || _$Encounter48$patient === void 0 ? void 0 : (_$Encounter48$patient2 = _$Encounter48$patient[0]) === null || _$Encounter48$patient2 === void 0 ? void 0 : (_$Encounter48$patient3 = _$Encounter48$patient2.telecom) === null || _$Encounter48$patient3 === void 0 ? void 0 : (_$Encounter48$patient4 = _$Encounter48$patient3[0]) === null || _$Encounter48$patient4 === void 0 ? void 0 : _$Encounter48$patient4.value), _ref21;
39013
+ return {
39014
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId11 = _.appointmentId) === null || _$appointmentId11 === void 0 ? void 0 : (_$appointmentId11$ = _$appointmentId11[0]) === null || _$appointmentId11$ === void 0 ? void 0 : (_$appointmentId11$$Pe = _$appointmentId11$.PersonID) === null || _$appointmentId11$$Pe === void 0 ? void 0 : (_$appointmentId11$$Pe2 = _$appointmentId11$$Pe[0]) === null || _$appointmentId11$$Pe2 === void 0 ? void 0 : (_$appointmentId11$$Pe3 = _$appointmentId11$$Pe2.photo) === null || _$appointmentId11$$Pe3 === void 0 ? void 0 : (_$appointmentId11$$Pe4 = _$appointmentId11$$Pe3[0]) === null || _$appointmentId11$$Pe4 === void 0 ? void 0 : _$appointmentId11$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId12 = _.appointmentId) === null || _$appointmentId12 === void 0 ? void 0 : (_$appointmentId12$ = _$appointmentId12[0]) === null || _$appointmentId12$ === void 0 ? void 0 : (_$appointmentId12$$Pe = _$appointmentId12$.PersonID) === null || _$appointmentId12$$Pe === void 0 ? void 0 : (_$appointmentId12$$Pe2 = _$appointmentId12$$Pe[0]) === null || _$appointmentId12$$Pe2 === void 0 ? void 0 : (_$appointmentId12$$Pe3 = _$appointmentId12$$Pe2.photo) === null || _$appointmentId12$$Pe3 === void 0 ? void 0 : (_$appointmentId12$$Pe4 = _$appointmentId12$$Pe3[0]) === null || _$appointmentId12$$Pe4 === void 0 ? void 0 : _$appointmentId12$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39015
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
39016
+ // mrn: _?.patient_id?.[0]?.alias || "",
39017
+ // age: _?.patient_id?.[0]?.age,
39018
+ // refNo: _?.appointmentId?.[0]?.appno || "",
39019
+ // date: _?.appointmentId?.[0]?.start
39020
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
39021
+ // : "",
39022
+ // time: _?.appointmentId?.[0]?.start
39023
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
39024
+ // : "",
39025
+ // visitType: _?.visit_type ?? "",
39026
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
39027
+ // return spl?.coding?.[0]?.display;
39028
+ // }).join(", "),
39029
+ // clinic: _?.practitioner_details?.[0]?.clinic || "",
39030
+ // appointmentStatus: _?.status?.display || "",
39031
+ // "View Patient": true,
39032
+ // Attend: true,
39033
+ // type: "OP",
39034
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
39035
+ // data: _,
39036
+ // enId: _.id,
39037
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
39038
+ // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
39039
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
39040
+ // pId: _?.patient_id?.id,
39041
+ name: JSON.stringify({
39042
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id4 = _.patient_id) === null || _$patient_id4 === void 0 ? void 0 : (_$patient_id4$ = _$patient_id4[0]) === null || _$patient_id4$ === void 0 ? void 0 : (_$patient_id4$$name = _$patient_id4$.name) === null || _$patient_id4$$name === void 0 ? void 0 : _$patient_id4$$name[0]) || {}),
39043
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId13 = _.appointmentId) === null || _$appointmentId13 === void 0 ? void 0 : (_$appointmentId13$ = _$appointmentId13[0]) === null || _$appointmentId13$ === void 0 ? void 0 : (_$appointmentId13$$Pe = _$appointmentId13$.PersonID) === null || _$appointmentId13$$Pe === void 0 ? void 0 : (_$appointmentId13$$Pe2 = _$appointmentId13$$Pe[0]) === null || _$appointmentId13$$Pe2 === void 0 ? void 0 : _$appointmentId13$$Pe2.birthDay),
39044
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id5 = _.patient_id) === null || _$patient_id5 === void 0 ? void 0 : (_$patient_id5$ = _$patient_id5[0]) === null || _$patient_id5$ === void 0 ? void 0 : _$patient_id5$.alias) || "",
39045
+ gender: (_$appointmentId$0$Per2 = _ === null || _ === void 0 ? void 0 : (_$appointmentId14 = _.appointmentId) === null || _$appointmentId14 === void 0 ? void 0 : (_$appointmentId14$ = _$appointmentId14[0]) === null || _$appointmentId14$ === void 0 ? void 0 : (_$appointmentId14$$Pe = _$appointmentId14$.PersonID) === null || _$appointmentId14$$Pe === void 0 ? void 0 : (_$appointmentId14$$Pe2 = _$appointmentId14$$Pe[0]) === null || _$appointmentId14$$Pe2 === void 0 ? void 0 : _$appointmentId14$$Pe2.gender) !== null && _$appointmentId$0$Per2 !== void 0 ? _$appointmentId$0$Per2 : "",
39046
+ contact: (_$patient_id$0$teleco2 = _ === null || _ === void 0 ? void 0 : (_$patient_id6 = _.patient_id) === null || _$patient_id6 === void 0 ? void 0 : (_$patient_id6$ = _$patient_id6[0]) === null || _$patient_id6$ === void 0 ? void 0 : (_$patient_id6$$teleco = _$patient_id6$.telecom) === null || _$patient_id6$$teleco === void 0 ? void 0 : (_$patient_id6$$teleco2 = _$patient_id6$$teleco[0]) === null || _$patient_id6$$teleco2 === void 0 ? void 0 : _$patient_id6$$teleco2.value) !== null && _$patient_id$0$teleco2 !== void 0 ? _$patient_id$0$teleco2 : ""
39047
+ }),
39048
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId15 = _.appointmentId) === null || _$appointmentId15 === void 0 ? void 0 : (_$appointmentId15$ = _$appointmentId15[0]) === null || _$appointmentId15$ === void 0 ? void 0 : _$appointmentId15$.appno) || "",
39049
+ date: JSON.stringify({
39050
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId16 = _.appointmentId) === null || _$appointmentId16 === void 0 ? void 0 : (_$appointmentId16$ = _$appointmentId16[0]) === null || _$appointmentId16$ === void 0 ? void 0 : _$appointmentId16$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId17 = _.appointmentId) === null || _$appointmentId17 === void 0 ? void 0 : (_$appointmentId17$ = _$appointmentId17[0]) === null || _$appointmentId17$ === void 0 ? void 0 : _$appointmentId17$.start, "DD MMM,YYYY") : "",
39051
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId18 = _.appointmentId) === null || _$appointmentId18 === void 0 ? void 0 : (_$appointmentId18$ = _$appointmentId18[0]) === null || _$appointmentId18$ === void 0 ? void 0 : _$appointmentId18$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId19 = _.appointmentId) === null || _$appointmentId19 === void 0 ? void 0 : (_$appointmentId19$ = _$appointmentId19[0]) === null || _$appointmentId19$ === void 0 ? void 0 : _$appointmentId19$.start, "hh:mm A") : ""
39052
+ }),
39053
+ visitType: (_$visit_type2 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type2 !== void 0 ? _$visit_type2 : "",
39054
+ speciality: JSON.stringify({
39055
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId20 = _.appointmentId) === null || _$appointmentId20 === void 0 ? void 0 : (_$appointmentId20$ = _$appointmentId20[0]) === null || _$appointmentId20$ === void 0 ? void 0 : (_$appointmentId20$$Sp = _$appointmentId20$.SpecialtyID) === null || _$appointmentId20$$Sp === void 0 ? void 0 : _$appointmentId20$$Sp.map(function (spl) {
39056
+ var _spl$coding3, _spl$coding3$;
39057
+
39058
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding3 = spl.coding) === null || _spl$coding3 === void 0 ? void 0 : (_spl$coding3$ = _spl$coding3[0]) === null || _spl$coding3$ === void 0 ? void 0 : _spl$coding3$.display;
39059
+ }).join(", "),
39060
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail5 = _.practitioner_details) === null || _$practitioner_detail5 === void 0 ? void 0 : (_$practitioner_detail6 = _$practitioner_detail5[0]) === null || _$practitioner_detail6 === void 0 ? void 0 : _$practitioner_detail6.clinic) || ""
39061
+ }),
39062
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status2 = _.status) === null || _$status2 === void 0 ? void 0 : _$status2.display) || "",
39063
+ action: true
39064
+ };
38807
39065
  }) : [];
38808
39066
  return _context9.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
38809
39067
  data: returnedData
@@ -38825,7 +39083,7 @@ var GET_NEW_PATIENTS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getNewPa
38825
39083
  })));
38826
39084
  var GET_OTHER_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getOtherVisitsNurse", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
38827
39085
  var payload,
38828
- _ref23,
39086
+ _ref20,
38829
39087
  rejectWithValue,
38830
39088
  _data$result10,
38831
39089
  data,
@@ -38837,7 +39095,7 @@ var GET_OTHER_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getOther
38837
39095
  switch (_context10.prev = _context10.next) {
38838
39096
  case 0:
38839
39097
  payload = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : {};
38840
- _ref23 = _args10.length > 1 ? _args10[1] : undefined, rejectWithValue = _ref23.rejectWithValue;
39098
+ _ref20 = _args10.length > 1 ? _args10[1] : undefined, rejectWithValue = _ref20.rejectWithValue;
38841
39099
  _context10.prev = 2;
38842
39100
  _context10.next = 5;
38843
39101
  return fetchData$3({
@@ -38847,31 +39105,60 @@ var GET_OTHER_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getOther
38847
39105
  case 5:
38848
39106
  data = _context10.sent;
38849
39107
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result10 = data.result) === null || _data$result10 === void 0 ? void 0 : _data$result10.map(function (_) {
38850
- var _$appointmentId25, _$appointmentId25$, _$appointmentId25$$Pe, _$appointmentId25$$Pe2, _$appointmentId25$$Pe3, _$appointmentId25$$Pe4, _$appointmentId26, _$appointmentId26$, _$appointmentId26$$Pe, _$appointmentId26$$Pe2, _$appointmentId26$$Pe3, _$appointmentId26$$Pe4, _$patient_id10, _$patient_id10$, _$patient_id10$$name, _$patient_id11, _$patient_id11$, _$patient_id12, _$patient_id12$, _$appointmentId27, _$appointmentId27$, _$appointmentId28, _$appointmentId28$, _$appointmentId29, _$appointmentId29$, _$appointmentId30, _$appointmentId30$, _$appointmentId31, _$appointmentId31$, _$visit_type4, _$appointmentId32, _$appointmentId32$, _$appointmentId32$$Sp, _$practitioner_detail7, _$practitioner_detail8, _$status4, _$Encounter$appointme10, _$Encounter49, _$Encounter49$appoint, _$Appointment67, _$Appointment67$Perso, _$Appointment67$Perso2, _$Appointment68, _$Appointment68$Perso, _$Appointment68$Perso2, _$Encounter50, _$Encounter50$patient, _$Encounter50$patient2, _$Encounter50$patient3, _$Encounter50$patient4, _ref24;
38851
-
38852
- return _ref24 = {
38853
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId25 = _.appointmentId) === null || _$appointmentId25 === void 0 ? void 0 : (_$appointmentId25$ = _$appointmentId25[0]) === null || _$appointmentId25$ === void 0 ? void 0 : (_$appointmentId25$$Pe = _$appointmentId25$.PersonID) === null || _$appointmentId25$$Pe === void 0 ? void 0 : (_$appointmentId25$$Pe2 = _$appointmentId25$$Pe[0]) === null || _$appointmentId25$$Pe2 === void 0 ? void 0 : (_$appointmentId25$$Pe3 = _$appointmentId25$$Pe2.photo) === null || _$appointmentId25$$Pe3 === void 0 ? void 0 : (_$appointmentId25$$Pe4 = _$appointmentId25$$Pe3[0]) === null || _$appointmentId25$$Pe4 === void 0 ? void 0 : _$appointmentId25$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId26 = _.appointmentId) === null || _$appointmentId26 === void 0 ? void 0 : (_$appointmentId26$ = _$appointmentId26[0]) === null || _$appointmentId26$ === void 0 ? void 0 : (_$appointmentId26$$Pe = _$appointmentId26$.PersonID) === null || _$appointmentId26$$Pe === void 0 ? void 0 : (_$appointmentId26$$Pe2 = _$appointmentId26$$Pe[0]) === null || _$appointmentId26$$Pe2 === void 0 ? void 0 : (_$appointmentId26$$Pe3 = _$appointmentId26$$Pe2.photo) === null || _$appointmentId26$$Pe3 === void 0 ? void 0 : (_$appointmentId26$$Pe4 = _$appointmentId26$$Pe3[0]) === null || _$appointmentId26$$Pe4 === void 0 ? void 0 : _$appointmentId26$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38854
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id10 = _.patient_id) === null || _$patient_id10 === void 0 ? void 0 : (_$patient_id10$ = _$patient_id10[0]) === null || _$patient_id10$ === void 0 ? void 0 : (_$patient_id10$$name = _$patient_id10$.name) === null || _$patient_id10$$name === void 0 ? void 0 : _$patient_id10$$name[0]) || {}),
38855
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id11 = _.patient_id) === null || _$patient_id11 === void 0 ? void 0 : (_$patient_id11$ = _$patient_id11[0]) === null || _$patient_id11$ === void 0 ? void 0 : _$patient_id11$.alias) || "",
38856
- age: _ === null || _ === void 0 ? void 0 : (_$patient_id12 = _.patient_id) === null || _$patient_id12 === void 0 ? void 0 : (_$patient_id12$ = _$patient_id12[0]) === null || _$patient_id12$ === void 0 ? void 0 : _$patient_id12$.age,
38857
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId27 = _.appointmentId) === null || _$appointmentId27 === void 0 ? void 0 : (_$appointmentId27$ = _$appointmentId27[0]) === null || _$appointmentId27$ === void 0 ? void 0 : _$appointmentId27$.appno) || "",
38858
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId28 = _.appointmentId) === null || _$appointmentId28 === void 0 ? void 0 : (_$appointmentId28$ = _$appointmentId28[0]) === null || _$appointmentId28$ === void 0 ? void 0 : _$appointmentId28$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId29 = _.appointmentId) === null || _$appointmentId29 === void 0 ? void 0 : (_$appointmentId29$ = _$appointmentId29[0]) === null || _$appointmentId29$ === void 0 ? void 0 : _$appointmentId29$.start, "DD MMM,YYYY") : "",
38859
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId30 = _.appointmentId) === null || _$appointmentId30 === void 0 ? void 0 : (_$appointmentId30$ = _$appointmentId30[0]) === null || _$appointmentId30$ === void 0 ? void 0 : _$appointmentId30$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId31 = _.appointmentId) === null || _$appointmentId31 === void 0 ? void 0 : (_$appointmentId31$ = _$appointmentId31[0]) === null || _$appointmentId31$ === void 0 ? void 0 : _$appointmentId31$.start, "hh:mm A") : "",
38860
- visitType: (_$visit_type4 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type4 !== void 0 ? _$visit_type4 : "",
38861
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId32 = _.appointmentId) === null || _$appointmentId32 === void 0 ? void 0 : (_$appointmentId32$ = _$appointmentId32[0]) === null || _$appointmentId32$ === void 0 ? void 0 : (_$appointmentId32$$Sp = _$appointmentId32$.SpecialtyID) === null || _$appointmentId32$$Sp === void 0 ? void 0 : _$appointmentId32$$Sp.map(function (spl) {
38862
- var _spl$coding10, _spl$coding10$;
39108
+ var _$appointmentId21, _$appointmentId21$, _$appointmentId21$$Pe, _$appointmentId21$$Pe2, _$appointmentId21$$Pe3, _$appointmentId21$$Pe4, _$appointmentId22, _$appointmentId22$, _$appointmentId22$$Pe, _$appointmentId22$$Pe2, _$appointmentId22$$Pe3, _$appointmentId22$$Pe4, _$patient_id7, _$patient_id7$, _$patient_id7$$name, _$appointmentId23, _$appointmentId23$, _$appointmentId23$$Pe, _$appointmentId23$$Pe2, _$patient_id8, _$patient_id8$, _$appointmentId$0$Per3, _$appointmentId24, _$appointmentId24$, _$appointmentId24$$Pe, _$appointmentId24$$Pe2, _$patient_id$0$teleco3, _$patient_id9, _$patient_id9$, _$patient_id9$$teleco, _$patient_id9$$teleco2, _$appointmentId25, _$appointmentId25$, _$appointmentId26, _$appointmentId26$, _$appointmentId27, _$appointmentId27$, _$appointmentId28, _$appointmentId28$, _$appointmentId29, _$appointmentId29$, _$visit_type3, _$appointmentId30, _$appointmentId30$, _$appointmentId30$$Sp, _$practitioner_detail7, _$practitioner_detail8, _$status3;
38863
39109
 
38864
- return spl === null || spl === void 0 ? void 0 : (_spl$coding10 = spl.coding) === null || _spl$coding10 === void 0 ? void 0 : (_spl$coding10$ = _spl$coding10[0]) === null || _spl$coding10$ === void 0 ? void 0 : _spl$coding10$.display;
38865
- }).join(", "),
38866
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail7 = _.practitioner_details) === null || _$practitioner_detail7 === void 0 ? void 0 : (_$practitioner_detail8 = _$practitioner_detail7[0]) === null || _$practitioner_detail8 === void 0 ? void 0 : _$practitioner_detail8.clinic) || "",
38867
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status4 = _.status) === null || _$status4 === void 0 ? void 0 : _$status4.display) || "",
38868
- "View Patient": true,
38869
- Attend: true,
38870
- type: "OP",
38871
- appNo: (_$Encounter$appointme10 = _ === null || _ === void 0 ? void 0 : (_$Encounter49 = _.Encounter) === null || _$Encounter49 === void 0 ? void 0 : (_$Encounter49$appoint = _$Encounter49.appointmentId) === null || _$Encounter49$appoint === void 0 ? void 0 : _$Encounter49$appoint[0]) !== null && _$Encounter$appointme10 !== void 0 ? _$Encounter$appointme10 : "",
38872
- data: _,
38873
- enId: _.Encounter.id
38874
- }, _defineProperty(_ref24, "age", getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment67 = _.Appointment) === null || _$Appointment67 === void 0 ? void 0 : (_$Appointment67$Perso = _$Appointment67.PersonID) === null || _$Appointment67$Perso === void 0 ? void 0 : (_$Appointment67$Perso2 = _$Appointment67$Perso[0]) === null || _$Appointment67$Perso2 === void 0 ? void 0 : _$Appointment67$Perso2.birthDay)), _defineProperty(_ref24, "gender", _ === null || _ === void 0 ? void 0 : (_$Appointment68 = _.Appointment) === null || _$Appointment68 === void 0 ? void 0 : (_$Appointment68$Perso = _$Appointment68.PersonID) === null || _$Appointment68$Perso === void 0 ? void 0 : (_$Appointment68$Perso2 = _$Appointment68$Perso[0]) === null || _$Appointment68$Perso2 === void 0 ? void 0 : _$Appointment68$Perso2.gender), _defineProperty(_ref24, "contact", _ === null || _ === void 0 ? void 0 : (_$Encounter50 = _.Encounter) === null || _$Encounter50 === void 0 ? void 0 : (_$Encounter50$patient = _$Encounter50.patient_id) === null || _$Encounter50$patient === void 0 ? void 0 : (_$Encounter50$patient2 = _$Encounter50$patient[0]) === null || _$Encounter50$patient2 === void 0 ? void 0 : (_$Encounter50$patient3 = _$Encounter50$patient2.telecom) === null || _$Encounter50$patient3 === void 0 ? void 0 : (_$Encounter50$patient4 = _$Encounter50$patient3[0]) === null || _$Encounter50$patient4 === void 0 ? void 0 : _$Encounter50$patient4.value), _ref24;
39110
+ return {
39111
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId21 = _.appointmentId) === null || _$appointmentId21 === void 0 ? void 0 : (_$appointmentId21$ = _$appointmentId21[0]) === null || _$appointmentId21$ === void 0 ? void 0 : (_$appointmentId21$$Pe = _$appointmentId21$.PersonID) === null || _$appointmentId21$$Pe === void 0 ? void 0 : (_$appointmentId21$$Pe2 = _$appointmentId21$$Pe[0]) === null || _$appointmentId21$$Pe2 === void 0 ? void 0 : (_$appointmentId21$$Pe3 = _$appointmentId21$$Pe2.photo) === null || _$appointmentId21$$Pe3 === void 0 ? void 0 : (_$appointmentId21$$Pe4 = _$appointmentId21$$Pe3[0]) === null || _$appointmentId21$$Pe4 === void 0 ? void 0 : _$appointmentId21$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId22 = _.appointmentId) === null || _$appointmentId22 === void 0 ? void 0 : (_$appointmentId22$ = _$appointmentId22[0]) === null || _$appointmentId22$ === void 0 ? void 0 : (_$appointmentId22$$Pe = _$appointmentId22$.PersonID) === null || _$appointmentId22$$Pe === void 0 ? void 0 : (_$appointmentId22$$Pe2 = _$appointmentId22$$Pe[0]) === null || _$appointmentId22$$Pe2 === void 0 ? void 0 : (_$appointmentId22$$Pe3 = _$appointmentId22$$Pe2.photo) === null || _$appointmentId22$$Pe3 === void 0 ? void 0 : (_$appointmentId22$$Pe4 = _$appointmentId22$$Pe3[0]) === null || _$appointmentId22$$Pe4 === void 0 ? void 0 : _$appointmentId22$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39112
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
39113
+ // mrn: _?.patient_id?.[0]?.alias || "",
39114
+ // age: _?.patient_id?.[0]?.age,
39115
+ // refNo: _?.appointmentId?.[0]?.appno || "",
39116
+ // date: _?.appointmentId?.[0]?.start
39117
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
39118
+ // : "",
39119
+ // time: _?.appointmentId?.[0]?.start
39120
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
39121
+ // : "",
39122
+ // visitType: _?.visit_type ?? "",
39123
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
39124
+ // return spl?.coding?.[0]?.display;
39125
+ // }).join(", "),
39126
+ // clinic: _?.practitioner_details?.[0]?.clinic || "",
39127
+ // appointmentStatus: _?.status?.display || "",
39128
+ // "View Patient": true,
39129
+ // Attend: true,
39130
+ // type: "OP",
39131
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
39132
+ // data: _,
39133
+ // enId: _.id,
39134
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
39135
+ // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
39136
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
39137
+ // pId: _?.patient_id?.id,
39138
+ name: JSON.stringify({
39139
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id7 = _.patient_id) === null || _$patient_id7 === void 0 ? void 0 : (_$patient_id7$ = _$patient_id7[0]) === null || _$patient_id7$ === void 0 ? void 0 : (_$patient_id7$$name = _$patient_id7$.name) === null || _$patient_id7$$name === void 0 ? void 0 : _$patient_id7$$name[0]) || {}),
39140
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId23 = _.appointmentId) === null || _$appointmentId23 === void 0 ? void 0 : (_$appointmentId23$ = _$appointmentId23[0]) === null || _$appointmentId23$ === void 0 ? void 0 : (_$appointmentId23$$Pe = _$appointmentId23$.PersonID) === null || _$appointmentId23$$Pe === void 0 ? void 0 : (_$appointmentId23$$Pe2 = _$appointmentId23$$Pe[0]) === null || _$appointmentId23$$Pe2 === void 0 ? void 0 : _$appointmentId23$$Pe2.birthDay),
39141
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id8 = _.patient_id) === null || _$patient_id8 === void 0 ? void 0 : (_$patient_id8$ = _$patient_id8[0]) === null || _$patient_id8$ === void 0 ? void 0 : _$patient_id8$.alias) || "",
39142
+ gender: (_$appointmentId$0$Per3 = _ === null || _ === void 0 ? void 0 : (_$appointmentId24 = _.appointmentId) === null || _$appointmentId24 === void 0 ? void 0 : (_$appointmentId24$ = _$appointmentId24[0]) === null || _$appointmentId24$ === void 0 ? void 0 : (_$appointmentId24$$Pe = _$appointmentId24$.PersonID) === null || _$appointmentId24$$Pe === void 0 ? void 0 : (_$appointmentId24$$Pe2 = _$appointmentId24$$Pe[0]) === null || _$appointmentId24$$Pe2 === void 0 ? void 0 : _$appointmentId24$$Pe2.gender) !== null && _$appointmentId$0$Per3 !== void 0 ? _$appointmentId$0$Per3 : "",
39143
+ contact: (_$patient_id$0$teleco3 = _ === null || _ === void 0 ? void 0 : (_$patient_id9 = _.patient_id) === null || _$patient_id9 === void 0 ? void 0 : (_$patient_id9$ = _$patient_id9[0]) === null || _$patient_id9$ === void 0 ? void 0 : (_$patient_id9$$teleco = _$patient_id9$.telecom) === null || _$patient_id9$$teleco === void 0 ? void 0 : (_$patient_id9$$teleco2 = _$patient_id9$$teleco[0]) === null || _$patient_id9$$teleco2 === void 0 ? void 0 : _$patient_id9$$teleco2.value) !== null && _$patient_id$0$teleco3 !== void 0 ? _$patient_id$0$teleco3 : ""
39144
+ }),
39145
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId25 = _.appointmentId) === null || _$appointmentId25 === void 0 ? void 0 : (_$appointmentId25$ = _$appointmentId25[0]) === null || _$appointmentId25$ === void 0 ? void 0 : _$appointmentId25$.appno) || "",
39146
+ date: JSON.stringify({
39147
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId26 = _.appointmentId) === null || _$appointmentId26 === void 0 ? void 0 : (_$appointmentId26$ = _$appointmentId26[0]) === null || _$appointmentId26$ === void 0 ? void 0 : _$appointmentId26$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId27 = _.appointmentId) === null || _$appointmentId27 === void 0 ? void 0 : (_$appointmentId27$ = _$appointmentId27[0]) === null || _$appointmentId27$ === void 0 ? void 0 : _$appointmentId27$.start, "DD MMM,YYYY") : "",
39148
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId28 = _.appointmentId) === null || _$appointmentId28 === void 0 ? void 0 : (_$appointmentId28$ = _$appointmentId28[0]) === null || _$appointmentId28$ === void 0 ? void 0 : _$appointmentId28$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId29 = _.appointmentId) === null || _$appointmentId29 === void 0 ? void 0 : (_$appointmentId29$ = _$appointmentId29[0]) === null || _$appointmentId29$ === void 0 ? void 0 : _$appointmentId29$.start, "hh:mm A") : ""
39149
+ }),
39150
+ visitType: (_$visit_type3 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type3 !== void 0 ? _$visit_type3 : "",
39151
+ speciality: JSON.stringify({
39152
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId30 = _.appointmentId) === null || _$appointmentId30 === void 0 ? void 0 : (_$appointmentId30$ = _$appointmentId30[0]) === null || _$appointmentId30$ === void 0 ? void 0 : (_$appointmentId30$$Sp = _$appointmentId30$.SpecialtyID) === null || _$appointmentId30$$Sp === void 0 ? void 0 : _$appointmentId30$$Sp.map(function (spl) {
39153
+ var _spl$coding4, _spl$coding4$;
39154
+
39155
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding4 = spl.coding) === null || _spl$coding4 === void 0 ? void 0 : (_spl$coding4$ = _spl$coding4[0]) === null || _spl$coding4$ === void 0 ? void 0 : _spl$coding4$.display;
39156
+ }).join(", "),
39157
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail7 = _.practitioner_details) === null || _$practitioner_detail7 === void 0 ? void 0 : (_$practitioner_detail8 = _$practitioner_detail7[0]) === null || _$practitioner_detail8 === void 0 ? void 0 : _$practitioner_detail8.clinic) || ""
39158
+ }),
39159
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status3 = _.status) === null || _$status3 === void 0 ? void 0 : _$status3.display) || "",
39160
+ action: true
39161
+ };
38875
39162
  }) : [];
38876
39163
  return _context10.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
38877
39164
  data: returnedData
@@ -38893,7 +39180,7 @@ var GET_OTHER_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getOther
38893
39180
  })));
38894
39181
  var GET_TODAY_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getTodayVisitsNurse", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
38895
39182
  var payload,
38896
- _ref26,
39183
+ _ref22,
38897
39184
  rejectWithValue,
38898
39185
  _data$result11,
38899
39186
  data,
@@ -38905,7 +39192,7 @@ var GET_TODAY_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getToday
38905
39192
  switch (_context11.prev = _context11.next) {
38906
39193
  case 0:
38907
39194
  payload = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
38908
- _ref26 = _args11.length > 1 ? _args11[1] : undefined, rejectWithValue = _ref26.rejectWithValue;
39195
+ _ref22 = _args11.length > 1 ? _args11[1] : undefined, rejectWithValue = _ref22.rejectWithValue;
38909
39196
  _context11.prev = 2;
38910
39197
  _context11.next = 5;
38911
39198
  return fetchData$3({
@@ -38915,30 +39202,59 @@ var GET_TODAY_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getToday
38915
39202
  case 5:
38916
39203
  data = _context11.sent;
38917
39204
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result11 = data.result) === null || _data$result11 === void 0 ? void 0 : _data$result11.map(function (_) {
38918
- var _$appointmentId33, _$appointmentId33$, _$appointmentId33$$Pe, _$appointmentId33$$Pe2, _$appointmentId33$$Pe3, _$appointmentId34, _$appointmentId34$, _$appointmentId34$$Pe, _$appointmentId34$$Pe2, _$appointmentId34$$Pe3, _$patient_id13, _$patient_id13$, _$patient_id13$$name, _$patient_id14, _$patient_id14$, _$patient_id15, _$patient_id15$, _$appointmentId35, _$appointmentId35$, _$appointmentId36, _$appointmentId36$, _$appointmentId37, _$appointmentId37$, _$appointmentId38, _$appointmentId38$, _$appointmentId39, _$appointmentId39$, _$appointmentId39$$Sp, _$patient_id16, _$patient_id16$, _$patient_id16$$telec, _$patient_id16$$telec2, _$status5, _$Encounter$appointme11, _$Encounter51, _$Encounter51$appoint, _$Appointment69, _$Appointment69$Perso, _$Appointment69$Perso2, _$Appointment70, _$Appointment70$Perso, _$Appointment70$Perso2, _$Encounter52, _$Encounter52$patient, _$Encounter52$patient2, _$Encounter52$patient3, _$Encounter52$patient4, _ref27;
38919
-
38920
- return _ref27 = {
38921
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId33 = _.appointmentId) === null || _$appointmentId33 === void 0 ? void 0 : (_$appointmentId33$ = _$appointmentId33[0]) === null || _$appointmentId33$ === void 0 ? void 0 : (_$appointmentId33$$Pe = _$appointmentId33$.PersonID) === null || _$appointmentId33$$Pe === void 0 ? void 0 : (_$appointmentId33$$Pe2 = _$appointmentId33$$Pe[0]) === null || _$appointmentId33$$Pe2 === void 0 ? void 0 : (_$appointmentId33$$Pe3 = _$appointmentId33$$Pe2.photo[0]) === null || _$appointmentId33$$Pe3 === void 0 ? void 0 : _$appointmentId33$$Pe3.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId34 = _.appointmentId) === null || _$appointmentId34 === void 0 ? void 0 : (_$appointmentId34$ = _$appointmentId34[0]) === null || _$appointmentId34$ === void 0 ? void 0 : (_$appointmentId34$$Pe = _$appointmentId34$.PersonID) === null || _$appointmentId34$$Pe === void 0 ? void 0 : (_$appointmentId34$$Pe2 = _$appointmentId34$$Pe[0]) === null || _$appointmentId34$$Pe2 === void 0 ? void 0 : (_$appointmentId34$$Pe3 = _$appointmentId34$$Pe2.photo[0]) === null || _$appointmentId34$$Pe3 === void 0 ? void 0 : _$appointmentId34$$Pe3.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38922
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id13 = _.patient_id) === null || _$patient_id13 === void 0 ? void 0 : (_$patient_id13$ = _$patient_id13[0]) === null || _$patient_id13$ === void 0 ? void 0 : (_$patient_id13$$name = _$patient_id13$.name) === null || _$patient_id13$$name === void 0 ? void 0 : _$patient_id13$$name[0]) || {}),
38923
- mrn: _ === null || _ === void 0 ? void 0 : (_$patient_id14 = _.patient_id) === null || _$patient_id14 === void 0 ? void 0 : (_$patient_id14$ = _$patient_id14[0]) === null || _$patient_id14$ === void 0 ? void 0 : _$patient_id14$.MRN,
38924
- age: _ === null || _ === void 0 ? void 0 : (_$patient_id15 = _.patient_id) === null || _$patient_id15 === void 0 ? void 0 : (_$patient_id15$ = _$patient_id15[0]) === null || _$patient_id15$ === void 0 ? void 0 : _$patient_id15$.age,
38925
- orderDate: (_ === null || _ === void 0 ? void 0 : (_$appointmentId35 = _.appointmentId) === null || _$appointmentId35 === void 0 ? void 0 : (_$appointmentId35$ = _$appointmentId35[0]) === null || _$appointmentId35$ === void 0 ? void 0 : _$appointmentId35$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId36 = _.appointmentId) === null || _$appointmentId36 === void 0 ? void 0 : (_$appointmentId36$ = _$appointmentId36[0]) === null || _$appointmentId36$ === void 0 ? void 0 : _$appointmentId36$.start, "DD MMM,YYYY") : "",
38926
- orderTime: (_ === null || _ === void 0 ? void 0 : (_$appointmentId37 = _.appointmentId) === null || _$appointmentId37 === void 0 ? void 0 : (_$appointmentId37$ = _$appointmentId37[0]) === null || _$appointmentId37$ === void 0 ? void 0 : _$appointmentId37$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId38 = _.appointmentId) === null || _$appointmentId38 === void 0 ? void 0 : (_$appointmentId38$ = _$appointmentId38[0]) === null || _$appointmentId38$ === void 0 ? void 0 : _$appointmentId38$.start, "hh:mm A") : "",
38927
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId39 = _.appointmentId) === null || _$appointmentId39 === void 0 ? void 0 : (_$appointmentId39$ = _$appointmentId39[0]) === null || _$appointmentId39$ === void 0 ? void 0 : (_$appointmentId39$$Sp = _$appointmentId39$.SpecialtyID) === null || _$appointmentId39$$Sp === void 0 ? void 0 : _$appointmentId39$$Sp.map(function (spl) {
38928
- var _spl$coding11, _spl$coding11$;
38929
-
38930
- return spl === null || spl === void 0 ? void 0 : (_spl$coding11 = spl.coding) === null || _spl$coding11 === void 0 ? void 0 : (_spl$coding11$ = _spl$coding11[0]) === null || _spl$coding11$ === void 0 ? void 0 : _spl$coding11$.display;
38931
- }).join(", "),
38932
- ward: "Ward 1",
38933
- contact: JSON.stringify(_ === null || _ === void 0 ? void 0 : (_$patient_id16 = _.patient_id) === null || _$patient_id16 === void 0 ? void 0 : (_$patient_id16$ = _$patient_id16[0]) === null || _$patient_id16$ === void 0 ? void 0 : (_$patient_id16$$telec = _$patient_id16$.telecom) === null || _$patient_id16$$telec === void 0 ? void 0 : (_$patient_id16$$telec2 = _$patient_id16$$telec[0]) === null || _$patient_id16$$telec2 === void 0 ? void 0 : _$patient_id16$$telec2.value),
38934
- visittype: (_ === null || _ === void 0 ? void 0 : _.visit_type) || "",
38935
- encounterStatus: _ === null || _ === void 0 ? void 0 : (_$status5 = _.status) === null || _$status5 === void 0 ? void 0 : _$status5.display,
38936
- view: true,
38937
- type: "OP",
38938
- appNo: (_$Encounter$appointme11 = _ === null || _ === void 0 ? void 0 : (_$Encounter51 = _.Encounter) === null || _$Encounter51 === void 0 ? void 0 : (_$Encounter51$appoint = _$Encounter51.appointmentId) === null || _$Encounter51$appoint === void 0 ? void 0 : _$Encounter51$appoint[0]) !== null && _$Encounter$appointme11 !== void 0 ? _$Encounter$appointme11 : "",
38939
- data: _,
38940
- enId: _.Encounter.id
38941
- }, _defineProperty(_ref27, "age", getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment69 = _.Appointment) === null || _$Appointment69 === void 0 ? void 0 : (_$Appointment69$Perso = _$Appointment69.PersonID) === null || _$Appointment69$Perso === void 0 ? void 0 : (_$Appointment69$Perso2 = _$Appointment69$Perso[0]) === null || _$Appointment69$Perso2 === void 0 ? void 0 : _$Appointment69$Perso2.birthDay)), _defineProperty(_ref27, "gender", _ === null || _ === void 0 ? void 0 : (_$Appointment70 = _.Appointment) === null || _$Appointment70 === void 0 ? void 0 : (_$Appointment70$Perso = _$Appointment70.PersonID) === null || _$Appointment70$Perso === void 0 ? void 0 : (_$Appointment70$Perso2 = _$Appointment70$Perso[0]) === null || _$Appointment70$Perso2 === void 0 ? void 0 : _$Appointment70$Perso2.gender), _defineProperty(_ref27, "contact", _ === null || _ === void 0 ? void 0 : (_$Encounter52 = _.Encounter) === null || _$Encounter52 === void 0 ? void 0 : (_$Encounter52$patient = _$Encounter52.patient_id) === null || _$Encounter52$patient === void 0 ? void 0 : (_$Encounter52$patient2 = _$Encounter52$patient[0]) === null || _$Encounter52$patient2 === void 0 ? void 0 : (_$Encounter52$patient3 = _$Encounter52$patient2.telecom) === null || _$Encounter52$patient3 === void 0 ? void 0 : (_$Encounter52$patient4 = _$Encounter52$patient3[0]) === null || _$Encounter52$patient4 === void 0 ? void 0 : _$Encounter52$patient4.value), _ref27;
39205
+ var _$appointmentId31, _$appointmentId31$, _$appointmentId31$$Pe, _$appointmentId31$$Pe2, _$appointmentId31$$Pe3, _$appointmentId32, _$appointmentId32$, _$appointmentId32$$Pe, _$appointmentId32$$Pe2, _$appointmentId32$$Pe3, _$patient_id10, _$patient_id10$, _$patient_id10$$name, _$appointmentId33, _$appointmentId33$, _$appointmentId33$$Pe, _$appointmentId33$$Pe2, _$patient_id11, _$patient_id11$, _$appointmentId$0$Per4, _$appointmentId34, _$appointmentId34$, _$appointmentId34$$Pe, _$appointmentId34$$Pe2, _$patient_id$0$teleco4, _$patient_id12, _$patient_id12$, _$patient_id12$$telec, _$patient_id12$$telec2, _$appointmentId35, _$appointmentId35$, _$appointmentId36, _$appointmentId36$, _$appointmentId37, _$appointmentId37$, _$appointmentId38, _$appointmentId38$, _$appointmentId39, _$appointmentId39$, _$visit_type4, _$appointmentId40, _$appointmentId40$, _$appointmentId40$$Sp, _$practitioner_detail9, _$practitioner_detail10, _$status4;
39206
+
39207
+ return {
39208
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId31 = _.appointmentId) === null || _$appointmentId31 === void 0 ? void 0 : (_$appointmentId31$ = _$appointmentId31[0]) === null || _$appointmentId31$ === void 0 ? void 0 : (_$appointmentId31$$Pe = _$appointmentId31$.PersonID) === null || _$appointmentId31$$Pe === void 0 ? void 0 : (_$appointmentId31$$Pe2 = _$appointmentId31$$Pe[0]) === null || _$appointmentId31$$Pe2 === void 0 ? void 0 : (_$appointmentId31$$Pe3 = _$appointmentId31$$Pe2.photo[0]) === null || _$appointmentId31$$Pe3 === void 0 ? void 0 : _$appointmentId31$$Pe3.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId32 = _.appointmentId) === null || _$appointmentId32 === void 0 ? void 0 : (_$appointmentId32$ = _$appointmentId32[0]) === null || _$appointmentId32$ === void 0 ? void 0 : (_$appointmentId32$$Pe = _$appointmentId32$.PersonID) === null || _$appointmentId32$$Pe === void 0 ? void 0 : (_$appointmentId32$$Pe2 = _$appointmentId32$$Pe[0]) === null || _$appointmentId32$$Pe2 === void 0 ? void 0 : (_$appointmentId32$$Pe3 = _$appointmentId32$$Pe2.photo[0]) === null || _$appointmentId32$$Pe3 === void 0 ? void 0 : _$appointmentId32$$Pe3.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39209
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
39210
+ // mrn: _?.patient_id?.[0]?.MRN,
39211
+ // age: _?.patient_id?.[0]?.age,
39212
+ // orderDate: _?.appointmentId?.[0]?.start
39213
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
39214
+ // : "",
39215
+ // orderTime: _?.appointmentId?.[0]?.start
39216
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
39217
+ // : "",
39218
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
39219
+ // return spl?.coding?.[0]?.display;
39220
+ // }).join(", "),
39221
+ // ward: "Ward 1",
39222
+ // contact: JSON.stringify(_?.patient_id?.[0]?.telecom?.[0]?.value),
39223
+ // visittype: _?.visit_type || "",
39224
+ // encounterStatus: _?.status?.display,
39225
+ // view: true,
39226
+ // type: "OP",
39227
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
39228
+ // data: _,
39229
+ // enId: _.id,
39230
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
39231
+ // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
39232
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
39233
+ // pId: _?.patient_id?.id,
39234
+ name: JSON.stringify({
39235
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id10 = _.patient_id) === null || _$patient_id10 === void 0 ? void 0 : (_$patient_id10$ = _$patient_id10[0]) === null || _$patient_id10$ === void 0 ? void 0 : (_$patient_id10$$name = _$patient_id10$.name) === null || _$patient_id10$$name === void 0 ? void 0 : _$patient_id10$$name[0]) || {}),
39236
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId33 = _.appointmentId) === null || _$appointmentId33 === void 0 ? void 0 : (_$appointmentId33$ = _$appointmentId33[0]) === null || _$appointmentId33$ === void 0 ? void 0 : (_$appointmentId33$$Pe = _$appointmentId33$.PersonID) === null || _$appointmentId33$$Pe === void 0 ? void 0 : (_$appointmentId33$$Pe2 = _$appointmentId33$$Pe[0]) === null || _$appointmentId33$$Pe2 === void 0 ? void 0 : _$appointmentId33$$Pe2.birthDay),
39237
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id11 = _.patient_id) === null || _$patient_id11 === void 0 ? void 0 : (_$patient_id11$ = _$patient_id11[0]) === null || _$patient_id11$ === void 0 ? void 0 : _$patient_id11$.alias) || "",
39238
+ gender: (_$appointmentId$0$Per4 = _ === null || _ === void 0 ? void 0 : (_$appointmentId34 = _.appointmentId) === null || _$appointmentId34 === void 0 ? void 0 : (_$appointmentId34$ = _$appointmentId34[0]) === null || _$appointmentId34$ === void 0 ? void 0 : (_$appointmentId34$$Pe = _$appointmentId34$.PersonID) === null || _$appointmentId34$$Pe === void 0 ? void 0 : (_$appointmentId34$$Pe2 = _$appointmentId34$$Pe[0]) === null || _$appointmentId34$$Pe2 === void 0 ? void 0 : _$appointmentId34$$Pe2.gender) !== null && _$appointmentId$0$Per4 !== void 0 ? _$appointmentId$0$Per4 : "",
39239
+ contact: (_$patient_id$0$teleco4 = _ === null || _ === void 0 ? void 0 : (_$patient_id12 = _.patient_id) === null || _$patient_id12 === void 0 ? void 0 : (_$patient_id12$ = _$patient_id12[0]) === null || _$patient_id12$ === void 0 ? void 0 : (_$patient_id12$$telec = _$patient_id12$.telecom) === null || _$patient_id12$$telec === void 0 ? void 0 : (_$patient_id12$$telec2 = _$patient_id12$$telec[0]) === null || _$patient_id12$$telec2 === void 0 ? void 0 : _$patient_id12$$telec2.value) !== null && _$patient_id$0$teleco4 !== void 0 ? _$patient_id$0$teleco4 : ""
39240
+ }),
39241
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId35 = _.appointmentId) === null || _$appointmentId35 === void 0 ? void 0 : (_$appointmentId35$ = _$appointmentId35[0]) === null || _$appointmentId35$ === void 0 ? void 0 : _$appointmentId35$.appno) || "",
39242
+ date: JSON.stringify({
39243
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId36 = _.appointmentId) === null || _$appointmentId36 === void 0 ? void 0 : (_$appointmentId36$ = _$appointmentId36[0]) === null || _$appointmentId36$ === void 0 ? void 0 : _$appointmentId36$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId37 = _.appointmentId) === null || _$appointmentId37 === void 0 ? void 0 : (_$appointmentId37$ = _$appointmentId37[0]) === null || _$appointmentId37$ === void 0 ? void 0 : _$appointmentId37$.start, "DD MMM,YYYY") : "",
39244
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId38 = _.appointmentId) === null || _$appointmentId38 === void 0 ? void 0 : (_$appointmentId38$ = _$appointmentId38[0]) === null || _$appointmentId38$ === void 0 ? void 0 : _$appointmentId38$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId39 = _.appointmentId) === null || _$appointmentId39 === void 0 ? void 0 : (_$appointmentId39$ = _$appointmentId39[0]) === null || _$appointmentId39$ === void 0 ? void 0 : _$appointmentId39$.start, "hh:mm A") : ""
39245
+ }),
39246
+ visitType: (_$visit_type4 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type4 !== void 0 ? _$visit_type4 : "",
39247
+ speciality: JSON.stringify({
39248
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId40 = _.appointmentId) === null || _$appointmentId40 === void 0 ? void 0 : (_$appointmentId40$ = _$appointmentId40[0]) === null || _$appointmentId40$ === void 0 ? void 0 : (_$appointmentId40$$Sp = _$appointmentId40$.SpecialtyID) === null || _$appointmentId40$$Sp === void 0 ? void 0 : _$appointmentId40$$Sp.map(function (spl) {
39249
+ var _spl$coding5, _spl$coding5$;
39250
+
39251
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding5 = spl.coding) === null || _spl$coding5 === void 0 ? void 0 : (_spl$coding5$ = _spl$coding5[0]) === null || _spl$coding5$ === void 0 ? void 0 : _spl$coding5$.display;
39252
+ }).join(", "),
39253
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail9 = _.practitioner_details) === null || _$practitioner_detail9 === void 0 ? void 0 : (_$practitioner_detail10 = _$practitioner_detail9[0]) === null || _$practitioner_detail10 === void 0 ? void 0 : _$practitioner_detail10.clinic) || ""
39254
+ }),
39255
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status4 = _.status) === null || _$status4 === void 0 ? void 0 : _$status4.display) || "",
39256
+ action: true
39257
+ };
38942
39258
  }) : [];
38943
39259
  return _context11.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
38944
39260
  data: returnedData
@@ -38960,7 +39276,7 @@ var GET_TODAY_VISITS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getToday
38960
39276
  })));
38961
39277
  var GET_WALK_INS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getWalkInsNurse", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
38962
39278
  var payload,
38963
- _ref29,
39279
+ _ref24,
38964
39280
  rejectWithValue,
38965
39281
  _data$result12,
38966
39282
  data,
@@ -38972,7 +39288,7 @@ var GET_WALK_INS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getWalkInsNu
38972
39288
  switch (_context12.prev = _context12.next) {
38973
39289
  case 0:
38974
39290
  payload = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
38975
- _ref29 = _args12.length > 1 ? _args12[1] : undefined, rejectWithValue = _ref29.rejectWithValue;
39291
+ _ref24 = _args12.length > 1 ? _args12[1] : undefined, rejectWithValue = _ref24.rejectWithValue;
38976
39292
  _context12.prev = 2;
38977
39293
  _context12.next = 5;
38978
39294
  return fetchData$3({
@@ -38982,31 +39298,60 @@ var GET_WALK_INS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getWalkInsNu
38982
39298
  case 5:
38983
39299
  data = _context12.sent;
38984
39300
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result12 = data.result) === null || _data$result12 === void 0 ? void 0 : _data$result12.map(function (_) {
38985
- var _$appointmentId40, _$appointmentId40$, _$appointmentId40$$Pe, _$appointmentId40$$Pe2, _$appointmentId40$$Pe3, _$appointmentId40$$Pe4, _$appointmentId41, _$appointmentId41$, _$appointmentId41$$Pe, _$appointmentId41$$Pe2, _$appointmentId41$$Pe3, _$appointmentId41$$Pe4, _$patient_id17, _$patient_id17$, _$patient_id17$$name, _$patient_id18, _$patient_id18$, _$patient_id19, _$patient_id19$, _$appointmentId42, _$appointmentId42$, _$appointmentId43, _$appointmentId43$, _$appointmentId44, _$appointmentId44$, _$appointmentId45, _$appointmentId45$, _$appointmentId46, _$appointmentId46$, _$visit_type5, _$appointmentId47, _$appointmentId47$, _$appointmentId47$$Sp, _$practitioner_detail9, _$practitioner_detail10, _$status6, _$Encounter$appointme12, _$Encounter53, _$Encounter53$appoint, _$Appointment71, _$Appointment71$Perso, _$Appointment71$Perso2, _$Appointment72, _$Appointment72$Perso, _$Appointment72$Perso2, _$Encounter54, _$Encounter54$patient, _$Encounter54$patient2, _$Encounter54$patient3, _$Encounter54$patient4, _ref30;
38986
-
38987
- return _ref30 = {
38988
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId40 = _.appointmentId) === null || _$appointmentId40 === void 0 ? void 0 : (_$appointmentId40$ = _$appointmentId40[0]) === null || _$appointmentId40$ === void 0 ? void 0 : (_$appointmentId40$$Pe = _$appointmentId40$.PersonID) === null || _$appointmentId40$$Pe === void 0 ? void 0 : (_$appointmentId40$$Pe2 = _$appointmentId40$$Pe[0]) === null || _$appointmentId40$$Pe2 === void 0 ? void 0 : (_$appointmentId40$$Pe3 = _$appointmentId40$$Pe2.photo) === null || _$appointmentId40$$Pe3 === void 0 ? void 0 : (_$appointmentId40$$Pe4 = _$appointmentId40$$Pe3[0]) === null || _$appointmentId40$$Pe4 === void 0 ? void 0 : _$appointmentId40$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId41 = _.appointmentId) === null || _$appointmentId41 === void 0 ? void 0 : (_$appointmentId41$ = _$appointmentId41[0]) === null || _$appointmentId41$ === void 0 ? void 0 : (_$appointmentId41$$Pe = _$appointmentId41$.PersonID) === null || _$appointmentId41$$Pe === void 0 ? void 0 : (_$appointmentId41$$Pe2 = _$appointmentId41$$Pe[0]) === null || _$appointmentId41$$Pe2 === void 0 ? void 0 : (_$appointmentId41$$Pe3 = _$appointmentId41$$Pe2.photo) === null || _$appointmentId41$$Pe3 === void 0 ? void 0 : (_$appointmentId41$$Pe4 = _$appointmentId41$$Pe3[0]) === null || _$appointmentId41$$Pe4 === void 0 ? void 0 : _$appointmentId41$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
38989
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id17 = _.patient_id) === null || _$patient_id17 === void 0 ? void 0 : (_$patient_id17$ = _$patient_id17[0]) === null || _$patient_id17$ === void 0 ? void 0 : (_$patient_id17$$name = _$patient_id17$.name) === null || _$patient_id17$$name === void 0 ? void 0 : _$patient_id17$$name[0]) || {}),
38990
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id18 = _.patient_id) === null || _$patient_id18 === void 0 ? void 0 : (_$patient_id18$ = _$patient_id18[0]) === null || _$patient_id18$ === void 0 ? void 0 : _$patient_id18$.alias) || "",
38991
- age: _ === null || _ === void 0 ? void 0 : (_$patient_id19 = _.patient_id) === null || _$patient_id19 === void 0 ? void 0 : (_$patient_id19$ = _$patient_id19[0]) === null || _$patient_id19$ === void 0 ? void 0 : _$patient_id19$.age,
38992
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId42 = _.appointmentId) === null || _$appointmentId42 === void 0 ? void 0 : (_$appointmentId42$ = _$appointmentId42[0]) === null || _$appointmentId42$ === void 0 ? void 0 : _$appointmentId42$.appno) || "",
38993
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId43 = _.appointmentId) === null || _$appointmentId43 === void 0 ? void 0 : (_$appointmentId43$ = _$appointmentId43[0]) === null || _$appointmentId43$ === void 0 ? void 0 : _$appointmentId43$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId44 = _.appointmentId) === null || _$appointmentId44 === void 0 ? void 0 : (_$appointmentId44$ = _$appointmentId44[0]) === null || _$appointmentId44$ === void 0 ? void 0 : _$appointmentId44$.start, "DD MMM,YYYY") : "",
38994
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId45 = _.appointmentId) === null || _$appointmentId45 === void 0 ? void 0 : (_$appointmentId45$ = _$appointmentId45[0]) === null || _$appointmentId45$ === void 0 ? void 0 : _$appointmentId45$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId46 = _.appointmentId) === null || _$appointmentId46 === void 0 ? void 0 : (_$appointmentId46$ = _$appointmentId46[0]) === null || _$appointmentId46$ === void 0 ? void 0 : _$appointmentId46$.start, "hh:mm A") : "",
39301
+ var _$appointmentId41, _$appointmentId41$, _$appointmentId41$$Pe, _$appointmentId41$$Pe2, _$appointmentId41$$Pe3, _$appointmentId41$$Pe4, _$appointmentId42, _$appointmentId42$, _$appointmentId42$$Pe, _$appointmentId42$$Pe2, _$appointmentId42$$Pe3, _$appointmentId42$$Pe4, _$patient_id13, _$patient_id13$, _$patient_id13$$name, _$appointmentId43, _$appointmentId43$, _$appointmentId43$$Pe, _$appointmentId43$$Pe2, _$patient_id14, _$patient_id14$, _$appointmentId$0$Per5, _$appointmentId44, _$appointmentId44$, _$appointmentId44$$Pe, _$appointmentId44$$Pe2, _$patient_id$0$teleco5, _$patient_id15, _$patient_id15$, _$patient_id15$$telec, _$patient_id15$$telec2, _$appointmentId45, _$appointmentId45$, _$appointmentId46, _$appointmentId46$, _$appointmentId47, _$appointmentId47$, _$appointmentId48, _$appointmentId48$, _$appointmentId49, _$appointmentId49$, _$visit_type5, _$appointmentId50, _$appointmentId50$, _$appointmentId50$$Sp, _$practitioner_detail11, _$practitioner_detail12, _$status5;
39302
+
39303
+ return {
39304
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId41 = _.appointmentId) === null || _$appointmentId41 === void 0 ? void 0 : (_$appointmentId41$ = _$appointmentId41[0]) === null || _$appointmentId41$ === void 0 ? void 0 : (_$appointmentId41$$Pe = _$appointmentId41$.PersonID) === null || _$appointmentId41$$Pe === void 0 ? void 0 : (_$appointmentId41$$Pe2 = _$appointmentId41$$Pe[0]) === null || _$appointmentId41$$Pe2 === void 0 ? void 0 : (_$appointmentId41$$Pe3 = _$appointmentId41$$Pe2.photo) === null || _$appointmentId41$$Pe3 === void 0 ? void 0 : (_$appointmentId41$$Pe4 = _$appointmentId41$$Pe3[0]) === null || _$appointmentId41$$Pe4 === void 0 ? void 0 : _$appointmentId41$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId42 = _.appointmentId) === null || _$appointmentId42 === void 0 ? void 0 : (_$appointmentId42$ = _$appointmentId42[0]) === null || _$appointmentId42$ === void 0 ? void 0 : (_$appointmentId42$$Pe = _$appointmentId42$.PersonID) === null || _$appointmentId42$$Pe === void 0 ? void 0 : (_$appointmentId42$$Pe2 = _$appointmentId42$$Pe[0]) === null || _$appointmentId42$$Pe2 === void 0 ? void 0 : (_$appointmentId42$$Pe3 = _$appointmentId42$$Pe2.photo) === null || _$appointmentId42$$Pe3 === void 0 ? void 0 : (_$appointmentId42$$Pe4 = _$appointmentId42$$Pe3[0]) === null || _$appointmentId42$$Pe4 === void 0 ? void 0 : _$appointmentId42$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39305
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
39306
+ // mrn: _?.patient_id?.[0]?.alias || "",
39307
+ // age: _?.patient_id?.[0]?.age,
39308
+ // refNo: _?.appointmentId?.[0]?.appno || "",
39309
+ // date: _?.appointmentId?.[0]?.start
39310
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
39311
+ // : "",
39312
+ // time: _?.appointmentId?.[0]?.start
39313
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
39314
+ // : "",
39315
+ // visitType: _?.visit_type ?? "Walk-Ins",
39316
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
39317
+ // return spl?.coding?.[0]?.display;
39318
+ // }).join(", "),
39319
+ // clinic: _?.practitioner_details?.[0]?.clinic || "",
39320
+ // appointmentStatus: _?.status?.display || "",
39321
+ // "View Patient": true,
39322
+ // Attend: true,
39323
+ // type: "OP",
39324
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
39325
+ // data: _,
39326
+ // enId: _.id,
39327
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
39328
+ // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
39329
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
39330
+ // pId: _?.patient_id?.id,
39331
+ name: JSON.stringify({
39332
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id13 = _.patient_id) === null || _$patient_id13 === void 0 ? void 0 : (_$patient_id13$ = _$patient_id13[0]) === null || _$patient_id13$ === void 0 ? void 0 : (_$patient_id13$$name = _$patient_id13$.name) === null || _$patient_id13$$name === void 0 ? void 0 : _$patient_id13$$name[0]) || {}),
39333
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId43 = _.appointmentId) === null || _$appointmentId43 === void 0 ? void 0 : (_$appointmentId43$ = _$appointmentId43[0]) === null || _$appointmentId43$ === void 0 ? void 0 : (_$appointmentId43$$Pe = _$appointmentId43$.PersonID) === null || _$appointmentId43$$Pe === void 0 ? void 0 : (_$appointmentId43$$Pe2 = _$appointmentId43$$Pe[0]) === null || _$appointmentId43$$Pe2 === void 0 ? void 0 : _$appointmentId43$$Pe2.birthDay),
39334
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id14 = _.patient_id) === null || _$patient_id14 === void 0 ? void 0 : (_$patient_id14$ = _$patient_id14[0]) === null || _$patient_id14$ === void 0 ? void 0 : _$patient_id14$.alias) || "",
39335
+ gender: (_$appointmentId$0$Per5 = _ === null || _ === void 0 ? void 0 : (_$appointmentId44 = _.appointmentId) === null || _$appointmentId44 === void 0 ? void 0 : (_$appointmentId44$ = _$appointmentId44[0]) === null || _$appointmentId44$ === void 0 ? void 0 : (_$appointmentId44$$Pe = _$appointmentId44$.PersonID) === null || _$appointmentId44$$Pe === void 0 ? void 0 : (_$appointmentId44$$Pe2 = _$appointmentId44$$Pe[0]) === null || _$appointmentId44$$Pe2 === void 0 ? void 0 : _$appointmentId44$$Pe2.gender) !== null && _$appointmentId$0$Per5 !== void 0 ? _$appointmentId$0$Per5 : "",
39336
+ contact: (_$patient_id$0$teleco5 = _ === null || _ === void 0 ? void 0 : (_$patient_id15 = _.patient_id) === null || _$patient_id15 === void 0 ? void 0 : (_$patient_id15$ = _$patient_id15[0]) === null || _$patient_id15$ === void 0 ? void 0 : (_$patient_id15$$telec = _$patient_id15$.telecom) === null || _$patient_id15$$telec === void 0 ? void 0 : (_$patient_id15$$telec2 = _$patient_id15$$telec[0]) === null || _$patient_id15$$telec2 === void 0 ? void 0 : _$patient_id15$$telec2.value) !== null && _$patient_id$0$teleco5 !== void 0 ? _$patient_id$0$teleco5 : ""
39337
+ }),
39338
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId45 = _.appointmentId) === null || _$appointmentId45 === void 0 ? void 0 : (_$appointmentId45$ = _$appointmentId45[0]) === null || _$appointmentId45$ === void 0 ? void 0 : _$appointmentId45$.appno) || "",
39339
+ date: JSON.stringify({
39340
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId46 = _.appointmentId) === null || _$appointmentId46 === void 0 ? void 0 : (_$appointmentId46$ = _$appointmentId46[0]) === null || _$appointmentId46$ === void 0 ? void 0 : _$appointmentId46$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId47 = _.appointmentId) === null || _$appointmentId47 === void 0 ? void 0 : (_$appointmentId47$ = _$appointmentId47[0]) === null || _$appointmentId47$ === void 0 ? void 0 : _$appointmentId47$.start, "DD MMM,YYYY") : "",
39341
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId48 = _.appointmentId) === null || _$appointmentId48 === void 0 ? void 0 : (_$appointmentId48$ = _$appointmentId48[0]) === null || _$appointmentId48$ === void 0 ? void 0 : _$appointmentId48$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId49 = _.appointmentId) === null || _$appointmentId49 === void 0 ? void 0 : (_$appointmentId49$ = _$appointmentId49[0]) === null || _$appointmentId49$ === void 0 ? void 0 : _$appointmentId49$.start, "hh:mm A") : ""
39342
+ }),
38995
39343
  visitType: (_$visit_type5 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type5 !== void 0 ? _$visit_type5 : "",
38996
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId47 = _.appointmentId) === null || _$appointmentId47 === void 0 ? void 0 : (_$appointmentId47$ = _$appointmentId47[0]) === null || _$appointmentId47$ === void 0 ? void 0 : (_$appointmentId47$$Sp = _$appointmentId47$.SpecialtyID) === null || _$appointmentId47$$Sp === void 0 ? void 0 : _$appointmentId47$$Sp.map(function (spl) {
38997
- var _spl$coding12, _spl$coding12$;
39344
+ speciality: JSON.stringify({
39345
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId50 = _.appointmentId) === null || _$appointmentId50 === void 0 ? void 0 : (_$appointmentId50$ = _$appointmentId50[0]) === null || _$appointmentId50$ === void 0 ? void 0 : (_$appointmentId50$$Sp = _$appointmentId50$.SpecialtyID) === null || _$appointmentId50$$Sp === void 0 ? void 0 : _$appointmentId50$$Sp.map(function (spl) {
39346
+ var _spl$coding6, _spl$coding6$;
38998
39347
 
38999
- return spl === null || spl === void 0 ? void 0 : (_spl$coding12 = spl.coding) === null || _spl$coding12 === void 0 ? void 0 : (_spl$coding12$ = _spl$coding12[0]) === null || _spl$coding12$ === void 0 ? void 0 : _spl$coding12$.display;
39000
- }).join(", "),
39001
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail9 = _.practitioner_details) === null || _$practitioner_detail9 === void 0 ? void 0 : (_$practitioner_detail10 = _$practitioner_detail9[0]) === null || _$practitioner_detail10 === void 0 ? void 0 : _$practitioner_detail10.clinic) || "",
39002
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status6 = _.status) === null || _$status6 === void 0 ? void 0 : _$status6.display) || "",
39003
- "View Patient": true,
39004
- Attend: true,
39005
- type: "OP",
39006
- appNo: (_$Encounter$appointme12 = _ === null || _ === void 0 ? void 0 : (_$Encounter53 = _.Encounter) === null || _$Encounter53 === void 0 ? void 0 : (_$Encounter53$appoint = _$Encounter53.appointmentId) === null || _$Encounter53$appoint === void 0 ? void 0 : _$Encounter53$appoint[0]) !== null && _$Encounter$appointme12 !== void 0 ? _$Encounter$appointme12 : "",
39007
- data: _,
39008
- enId: _.Encounter.id
39009
- }, _defineProperty(_ref30, "age", getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment71 = _.Appointment) === null || _$Appointment71 === void 0 ? void 0 : (_$Appointment71$Perso = _$Appointment71.PersonID) === null || _$Appointment71$Perso === void 0 ? void 0 : (_$Appointment71$Perso2 = _$Appointment71$Perso[0]) === null || _$Appointment71$Perso2 === void 0 ? void 0 : _$Appointment71$Perso2.birthDay)), _defineProperty(_ref30, "gender", _ === null || _ === void 0 ? void 0 : (_$Appointment72 = _.Appointment) === null || _$Appointment72 === void 0 ? void 0 : (_$Appointment72$Perso = _$Appointment72.PersonID) === null || _$Appointment72$Perso === void 0 ? void 0 : (_$Appointment72$Perso2 = _$Appointment72$Perso[0]) === null || _$Appointment72$Perso2 === void 0 ? void 0 : _$Appointment72$Perso2.gender), _defineProperty(_ref30, "contact", _ === null || _ === void 0 ? void 0 : (_$Encounter54 = _.Encounter) === null || _$Encounter54 === void 0 ? void 0 : (_$Encounter54$patient = _$Encounter54.patient_id) === null || _$Encounter54$patient === void 0 ? void 0 : (_$Encounter54$patient2 = _$Encounter54$patient[0]) === null || _$Encounter54$patient2 === void 0 ? void 0 : (_$Encounter54$patient3 = _$Encounter54$patient2.telecom) === null || _$Encounter54$patient3 === void 0 ? void 0 : (_$Encounter54$patient4 = _$Encounter54$patient3[0]) === null || _$Encounter54$patient4 === void 0 ? void 0 : _$Encounter54$patient4.value), _ref30;
39348
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding6 = spl.coding) === null || _spl$coding6 === void 0 ? void 0 : (_spl$coding6$ = _spl$coding6[0]) === null || _spl$coding6$ === void 0 ? void 0 : _spl$coding6$.display;
39349
+ }).join(", "),
39350
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail11 = _.practitioner_details) === null || _$practitioner_detail11 === void 0 ? void 0 : (_$practitioner_detail12 = _$practitioner_detail11[0]) === null || _$practitioner_detail12 === void 0 ? void 0 : _$practitioner_detail12.clinic) || ""
39351
+ }),
39352
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status5 = _.status) === null || _$status5 === void 0 ? void 0 : _$status5.display) || "",
39353
+ action: true
39354
+ };
39010
39355
  }) : [];
39011
39356
  return _context12.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
39012
39357
  data: returnedData
@@ -39029,7 +39374,7 @@ var GET_WALK_INS_NURSE = createAsyncThunk("appointmentStatsApiSlice/getWalkInsNu
39029
39374
 
39030
39375
  var GET_APPOINTMENTS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getAppointmentsDoctor", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
39031
39376
  var payload,
39032
- _ref32,
39377
+ _ref26,
39033
39378
  rejectWithValue,
39034
39379
  _data$result13,
39035
39380
  data,
@@ -39041,7 +39386,7 @@ var GET_APPOINTMENTS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getAppo
39041
39386
  switch (_context13.prev = _context13.next) {
39042
39387
  case 0:
39043
39388
  payload = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
39044
- _ref32 = _args13.length > 1 ? _args13[1] : undefined, rejectWithValue = _ref32.rejectWithValue;
39389
+ _ref26 = _args13.length > 1 ? _args13[1] : undefined, rejectWithValue = _ref26.rejectWithValue;
39045
39390
  _context13.prev = 2;
39046
39391
  _context13.next = 5;
39047
39392
  return fetchData$3({
@@ -39051,32 +39396,46 @@ var GET_APPOINTMENTS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getAppo
39051
39396
  case 5:
39052
39397
  data = _context13.sent;
39053
39398
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result13 = data.result) === null || _data$result13 === void 0 ? void 0 : _data$result13.map(function (_) {
39054
- var _$appointmentId48, _$appointmentId48$, _$appointmentId48$$Pe, _$appointmentId48$$Pe2, _$appointmentId48$$Pe3, _$appointmentId48$$Pe4, _$appointmentId49, _$appointmentId49$, _$appointmentId49$$Pe, _$appointmentId49$$Pe2, _$appointmentId49$$Pe3, _$appointmentId49$$Pe4, _$patient_id20, _$patient_id20$, _$patient_id20$$name, _$patient_id21, _$patient_id21$, _$appointmentId50, _$appointmentId50$, _$appointmentId51, _$appointmentId51$, _$appointmentId52, _$appointmentId52$, _$appointmentId53, _$appointmentId53$, _$appointmentId54, _$appointmentId54$, _$visit_type6, _$appointmentId55, _$appointmentId55$, _$appointmentId55$$Sp, _$practitioner_detail11, _$practitioner_detail12, _$status7, _$Encounter$appointme13, _$Encounter55, _$Encounter55$appoint, _$Appointment73, _$Appointment73$Perso, _$Appointment73$Perso2, _$Appointment74, _$Appointment74$Perso, _$Appointment74$Perso2, _$Encounter56, _$Encounter56$patient, _$Encounter56$patient2, _$Encounter56$patient3, _$Encounter56$patient4;
39399
+ var _$Appointment69, _$Appointment69$Perso, _$Appointment69$Perso2, _$Appointment69$Perso3, _$Appointment69$Perso4, _$Appointment70, _$Appointment70$Perso, _$Appointment70$Perso2, _$Appointment70$Perso3, _$Appointment70$Perso4, _$Appointment71, _$Appointment71$Perso, _$Appointment71$Perso2, _$Appointment71$Perso3, _$Appointment72, _$Appointment72$Perso, _$Appointment72$Perso2, _$Appointment73, _$Appointment73$Perso, _$Appointment73$Perso2, _$Appointment73$Perso3, _$Appointment$PersonI21, _$Appointment74, _$Appointment74$Perso, _$Appointment74$Perso2, _$Appointment74$Perso3, _$Appointment74$Perso4, _$Appointment75, _$Appointment76, _$Appointment77, _$Appointment78, _$Appointment79, _$Appointment$appoint3, _$Appointment80, _$Appointment$Special2, _$Appointment81, _$Appointment81$Speci, _$Appointment$orgid$n2, _$Appointment82, _$Appointment82$orgid, _$practitioner_detail13, _$practitioner_detail14, _$Appointment83;
39055
39400
 
39056
39401
  return {
39057
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId48 = _.appointmentId) === null || _$appointmentId48 === void 0 ? void 0 : (_$appointmentId48$ = _$appointmentId48[0]) === null || _$appointmentId48$ === void 0 ? void 0 : (_$appointmentId48$$Pe = _$appointmentId48$.PersonID) === null || _$appointmentId48$$Pe === void 0 ? void 0 : (_$appointmentId48$$Pe2 = _$appointmentId48$$Pe[0]) === null || _$appointmentId48$$Pe2 === void 0 ? void 0 : (_$appointmentId48$$Pe3 = _$appointmentId48$$Pe2.photo) === null || _$appointmentId48$$Pe3 === void 0 ? void 0 : (_$appointmentId48$$Pe4 = _$appointmentId48$$Pe3[0]) === null || _$appointmentId48$$Pe4 === void 0 ? void 0 : _$appointmentId48$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId49 = _.appointmentId) === null || _$appointmentId49 === void 0 ? void 0 : (_$appointmentId49$ = _$appointmentId49[0]) === null || _$appointmentId49$ === void 0 ? void 0 : (_$appointmentId49$$Pe = _$appointmentId49$.PersonID) === null || _$appointmentId49$$Pe === void 0 ? void 0 : (_$appointmentId49$$Pe2 = _$appointmentId49$$Pe[0]) === null || _$appointmentId49$$Pe2 === void 0 ? void 0 : (_$appointmentId49$$Pe3 = _$appointmentId49$$Pe2.photo) === null || _$appointmentId49$$Pe3 === void 0 ? void 0 : (_$appointmentId49$$Pe4 = _$appointmentId49$$Pe3[0]) === null || _$appointmentId49$$Pe4 === void 0 ? void 0 : _$appointmentId49$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39058
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id20 = _.patient_id) === null || _$patient_id20 === void 0 ? void 0 : (_$patient_id20$ = _$patient_id20[0]) === null || _$patient_id20$ === void 0 ? void 0 : (_$patient_id20$$name = _$patient_id20$.name) === null || _$patient_id20$$name === void 0 ? void 0 : _$patient_id20$$name[0]) || {}),
39059
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id21 = _.patient_id) === null || _$patient_id21 === void 0 ? void 0 : (_$patient_id21$ = _$patient_id21[0]) === null || _$patient_id21$ === void 0 ? void 0 : _$patient_id21$.MRN) || "",
39060
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId50 = _.appointmentId) === null || _$appointmentId50 === void 0 ? void 0 : (_$appointmentId50$ = _$appointmentId50[0]) === null || _$appointmentId50$ === void 0 ? void 0 : _$appointmentId50$.appno) || "",
39061
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId51 = _.appointmentId) === null || _$appointmentId51 === void 0 ? void 0 : (_$appointmentId51$ = _$appointmentId51[0]) === null || _$appointmentId51$ === void 0 ? void 0 : _$appointmentId51$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId52 = _.appointmentId) === null || _$appointmentId52 === void 0 ? void 0 : (_$appointmentId52$ = _$appointmentId52[0]) === null || _$appointmentId52$ === void 0 ? void 0 : _$appointmentId52$.start, "DD MMM,YYYY") : "",
39062
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId53 = _.appointmentId) === null || _$appointmentId53 === void 0 ? void 0 : (_$appointmentId53$ = _$appointmentId53[0]) === null || _$appointmentId53$ === void 0 ? void 0 : _$appointmentId53$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId54 = _.appointmentId) === null || _$appointmentId54 === void 0 ? void 0 : (_$appointmentId54$ = _$appointmentId54[0]) === null || _$appointmentId54$ === void 0 ? void 0 : _$appointmentId54$.start, "hh:mm A") : "",
39063
- visitType: (_$visit_type6 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type6 !== void 0 ? _$visit_type6 : "",
39064
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId55 = _.appointmentId) === null || _$appointmentId55 === void 0 ? void 0 : (_$appointmentId55$ = _$appointmentId55[0]) === null || _$appointmentId55$ === void 0 ? void 0 : (_$appointmentId55$$Sp = _$appointmentId55$.SpecialtyID) === null || _$appointmentId55$$Sp === void 0 ? void 0 : _$appointmentId55$$Sp.map(function (spl) {
39065
- var _spl$coding13, _spl$coding13$;
39066
-
39067
- return spl === null || spl === void 0 ? void 0 : (_spl$coding13 = spl.coding) === null || _spl$coding13 === void 0 ? void 0 : (_spl$coding13$ = _spl$coding13[0]) === null || _spl$coding13$ === void 0 ? void 0 : _spl$coding13$.display;
39068
- }).join(", "),
39069
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail11 = _.practitioner_details) === null || _$practitioner_detail11 === void 0 ? void 0 : (_$practitioner_detail12 = _$practitioner_detail11[0]) === null || _$practitioner_detail12 === void 0 ? void 0 : _$practitioner_detail12.clinic) || "",
39070
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status7 = _.status) === null || _$status7 === void 0 ? void 0 : _$status7.display) || "",
39402
+ img: (_ === null || _ === void 0 ? void 0 : (_$Appointment69 = _.Appointment) === null || _$Appointment69 === void 0 ? void 0 : (_$Appointment69$Perso = _$Appointment69.PersonID) === null || _$Appointment69$Perso === void 0 ? void 0 : (_$Appointment69$Perso2 = _$Appointment69$Perso[0]) === null || _$Appointment69$Perso2 === void 0 ? void 0 : (_$Appointment69$Perso3 = _$Appointment69$Perso2.photo) === null || _$Appointment69$Perso3 === void 0 ? void 0 : (_$Appointment69$Perso4 = _$Appointment69$Perso3[0]) === null || _$Appointment69$Perso4 === void 0 ? void 0 : _$Appointment69$Perso4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$Appointment70 = _.Appointment) === null || _$Appointment70 === void 0 ? void 0 : (_$Appointment70$Perso = _$Appointment70.PersonID) === null || _$Appointment70$Perso === void 0 ? void 0 : (_$Appointment70$Perso2 = _$Appointment70$Perso[0]) === null || _$Appointment70$Perso2 === void 0 ? void 0 : (_$Appointment70$Perso3 = _$Appointment70$Perso2.photo) === null || _$Appointment70$Perso3 === void 0 ? void 0 : (_$Appointment70$Perso4 = _$Appointment70$Perso3[0]) === null || _$Appointment70$Perso4 === void 0 ? void 0 : _$Appointment70$Perso4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39403
+ name: JSON.stringify({
39404
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$Appointment71 = _.Appointment) === null || _$Appointment71 === void 0 ? void 0 : (_$Appointment71$Perso = _$Appointment71.PersonID) === null || _$Appointment71$Perso === void 0 ? void 0 : (_$Appointment71$Perso2 = _$Appointment71$Perso[0]) === null || _$Appointment71$Perso2 === void 0 ? void 0 : (_$Appointment71$Perso3 = _$Appointment71$Perso2.name) === null || _$Appointment71$Perso3 === void 0 ? void 0 : _$Appointment71$Perso3[0]) || {}),
39405
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment72 = _.Appointment) === null || _$Appointment72 === void 0 ? void 0 : (_$Appointment72$Perso = _$Appointment72.PersonID) === null || _$Appointment72$Perso === void 0 ? void 0 : (_$Appointment72$Perso2 = _$Appointment72$Perso[0]) === null || _$Appointment72$Perso2 === void 0 ? void 0 : _$Appointment72$Perso2.birthDay),
39406
+ mrn: (_$Appointment73 = _.Appointment) === null || _$Appointment73 === void 0 ? void 0 : (_$Appointment73$Perso = _$Appointment73.PersonID) === null || _$Appointment73$Perso === void 0 ? void 0 : (_$Appointment73$Perso2 = _$Appointment73$Perso[0]) === null || _$Appointment73$Perso2 === void 0 ? void 0 : (_$Appointment73$Perso3 = _$Appointment73$Perso2.MRN) === null || _$Appointment73$Perso3 === void 0 ? void 0 : _$Appointment73$Perso3[0],
39407
+ // genderData: "M",
39408
+ contact: (_$Appointment$PersonI21 = (_$Appointment74 = _.Appointment) === null || _$Appointment74 === void 0 ? void 0 : (_$Appointment74$Perso = _$Appointment74.PersonID) === null || _$Appointment74$Perso === void 0 ? void 0 : (_$Appointment74$Perso2 = _$Appointment74$Perso[0]) === null || _$Appointment74$Perso2 === void 0 ? void 0 : (_$Appointment74$Perso3 = _$Appointment74$Perso2.telecom) === null || _$Appointment74$Perso3 === void 0 ? void 0 : (_$Appointment74$Perso4 = _$Appointment74$Perso3[0]) === null || _$Appointment74$Perso4 === void 0 ? void 0 : _$Appointment74$Perso4.value) !== null && _$Appointment$PersonI21 !== void 0 ? _$Appointment$PersonI21 : ""
39409
+ }),
39410
+ // mrn: _?.patient_id?.[0]?.alias || "",
39411
+ // age: _?.patient_id?.[0]?.age,
39412
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$Appointment75 = _.Appointment) === null || _$Appointment75 === void 0 ? void 0 : _$Appointment75.appno) || "",
39413
+ date: JSON.stringify({
39414
+ date: (_ === null || _ === void 0 ? void 0 : (_$Appointment76 = _.Appointment) === null || _$Appointment76 === void 0 ? void 0 : _$Appointment76.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment77 = _.Appointment) === null || _$Appointment77 === void 0 ? void 0 : _$Appointment77.start, "DD MMM,YYYY") : "",
39415
+ time: (_ === null || _ === void 0 ? void 0 : (_$Appointment78 = _.Appointment) === null || _$Appointment78 === void 0 ? void 0 : _$Appointment78.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$Appointment79 = _.Appointment) === null || _$Appointment79 === void 0 ? void 0 : _$Appointment79.start, "hh:mm A") : ""
39416
+ }),
39417
+ visitType: (_$Appointment$appoint3 = _ === null || _ === void 0 ? void 0 : (_$Appointment80 = _.Appointment) === null || _$Appointment80 === void 0 ? void 0 : _$Appointment80.appointmentType) !== null && _$Appointment$appoint3 !== void 0 ? _$Appointment$appoint3 : "",
39418
+ speciality: JSON.stringify({
39419
+ speciality: (_$Appointment$Special2 = _ === null || _ === void 0 ? void 0 : (_$Appointment81 = _.Appointment) === null || _$Appointment81 === void 0 ? void 0 : (_$Appointment81$Speci = _$Appointment81.SpecialtyID) === null || _$Appointment81$Speci === void 0 ? void 0 : _$Appointment81$Speci.map(function (spl) {
39420
+ var _spl$coding7, _spl$coding7$;
39421
+
39422
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding7 = spl.coding) === null || _spl$coding7 === void 0 ? void 0 : (_spl$coding7$ = _spl$coding7[0]) === null || _spl$coding7$ === void 0 ? void 0 : _spl$coding7$.display;
39423
+ }).join(", ")) !== null && _$Appointment$Special2 !== void 0 ? _$Appointment$Special2 : "",
39424
+ clinic: (_$Appointment$orgid$n2 = _ === null || _ === void 0 ? void 0 : (_$Appointment82 = _.Appointment) === null || _$Appointment82 === void 0 ? void 0 : (_$Appointment82$orgid = _$Appointment82.orgid) === null || _$Appointment82$orgid === void 0 ? void 0 : _$Appointment82$orgid.name) !== null && _$Appointment$orgid$n2 !== void 0 ? _$Appointment$orgid$n2 : ""
39425
+ }),
39426
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail13 = _.practitioner_details) === null || _$practitioner_detail13 === void 0 ? void 0 : (_$practitioner_detail14 = _$practitioner_detail13[0]) === null || _$practitioner_detail14 === void 0 ? void 0 : _$practitioner_detail14.clinic) || "",
39427
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$Appointment83 = _.Appointment) === null || _$Appointment83 === void 0 ? void 0 : _$Appointment83.appstatus) || "",
39071
39428
  "View Patient": true,
39072
39429
  Attend: true,
39073
- type: "OP",
39074
- appNo: (_$Encounter$appointme13 = _ === null || _ === void 0 ? void 0 : (_$Encounter55 = _.Encounter) === null || _$Encounter55 === void 0 ? void 0 : (_$Encounter55$appoint = _$Encounter55.appointmentId) === null || _$Encounter55$appoint === void 0 ? void 0 : _$Encounter55$appoint[0]) !== null && _$Encounter$appointme13 !== void 0 ? _$Encounter$appointme13 : "",
39075
- data: _,
39076
- enId: _.Encounter.id,
39077
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment73 = _.Appointment) === null || _$Appointment73 === void 0 ? void 0 : (_$Appointment73$Perso = _$Appointment73.PersonID) === null || _$Appointment73$Perso === void 0 ? void 0 : (_$Appointment73$Perso2 = _$Appointment73$Perso[0]) === null || _$Appointment73$Perso2 === void 0 ? void 0 : _$Appointment73$Perso2.birthDay),
39078
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment74 = _.Appointment) === null || _$Appointment74 === void 0 ? void 0 : (_$Appointment74$Perso = _$Appointment74.PersonID) === null || _$Appointment74$Perso === void 0 ? void 0 : (_$Appointment74$Perso2 = _$Appointment74$Perso[0]) === null || _$Appointment74$Perso2 === void 0 ? void 0 : _$Appointment74$Perso2.gender,
39079
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter56 = _.Encounter) === null || _$Encounter56 === void 0 ? void 0 : (_$Encounter56$patient = _$Encounter56.patient_id) === null || _$Encounter56$patient === void 0 ? void 0 : (_$Encounter56$patient2 = _$Encounter56$patient[0]) === null || _$Encounter56$patient2 === void 0 ? void 0 : (_$Encounter56$patient3 = _$Encounter56$patient2.telecom) === null || _$Encounter56$patient3 === void 0 ? void 0 : (_$Encounter56$patient4 = _$Encounter56$patient3[0]) === null || _$Encounter56$patient4 === void 0 ? void 0 : _$Encounter56$patient4.value
39430
+ action: true,
39431
+ type: "OP" // appNo: _?.id ?? '',
39432
+ // // data: _,
39433
+ // enId: _.id,
39434
+ // age: getAge(_?.PersonID?.[0]?.birthDay),
39435
+ // // gender: _?.PersonID?.[0]?.gender,
39436
+ // contact: _?.PersonID?.[0]?.telecom?.[0]?.value ?? "",
39437
+ // pId : _?.patient_id?.id,
39438
+
39080
39439
  };
39081
39440
  }) : [];
39082
39441
  return _context13.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -39099,7 +39458,7 @@ var GET_APPOINTMENTS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getAppo
39099
39458
  })));
39100
39459
  var GET_FIRST_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getFirstVisitsDoctor", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
39101
39460
  var payload,
39102
- _ref34,
39461
+ _ref28,
39103
39462
  rejectWithValue,
39104
39463
  _data$result14,
39105
39464
  data,
@@ -39111,7 +39470,7 @@ var GET_FIRST_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getFirs
39111
39470
  switch (_context14.prev = _context14.next) {
39112
39471
  case 0:
39113
39472
  payload = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
39114
- _ref34 = _args14.length > 1 ? _args14[1] : undefined, rejectWithValue = _ref34.rejectWithValue;
39473
+ _ref28 = _args14.length > 1 ? _args14[1] : undefined, rejectWithValue = _ref28.rejectWithValue;
39115
39474
  _context14.prev = 2;
39116
39475
  _context14.next = 5;
39117
39476
  return fetchData$3({
@@ -39121,32 +39480,58 @@ var GET_FIRST_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getFirs
39121
39480
  case 5:
39122
39481
  data = _context14.sent;
39123
39482
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result14 = data.result) === null || _data$result14 === void 0 ? void 0 : _data$result14.map(function (_) {
39124
- var _$appointmentId56, _$appointmentId56$, _$appointmentId56$$Pe, _$appointmentId56$$Pe2, _$appointmentId56$$Pe3, _$appointmentId56$$Pe4, _$appointmentId57, _$appointmentId57$, _$appointmentId57$$Pe, _$appointmentId57$$Pe2, _$appointmentId57$$Pe3, _$appointmentId57$$Pe4, _$patient_id22, _$patient_id22$, _$patient_id22$$name, _$patient_id23, _$patient_id23$, _$appointmentId58, _$appointmentId58$, _$appointmentId59, _$appointmentId59$, _$appointmentId60, _$appointmentId60$, _$appointmentId61, _$appointmentId61$, _$appointmentId62, _$appointmentId62$, _$visit_type7, _$appointmentId63, _$appointmentId63$, _$appointmentId63$$Sp, _$practitioner_detail13, _$practitioner_detail14, _$status8, _$Encounter$appointme14, _$Encounter57, _$Encounter57$appoint, _$Appointment75, _$Appointment75$Perso, _$Appointment75$Perso2, _$Appointment76, _$Appointment76$Perso, _$Appointment76$Perso2, _$Encounter58, _$Encounter58$patient, _$Encounter58$patient2, _$Encounter58$patient3, _$Encounter58$patient4;
39483
+ var _$appointmentId51, _$appointmentId51$, _$appointmentId51$$Pe, _$appointmentId51$$Pe2, _$appointmentId51$$Pe3, _$appointmentId51$$Pe4, _$appointmentId52, _$appointmentId52$, _$appointmentId52$$Pe, _$appointmentId52$$Pe2, _$appointmentId52$$Pe3, _$appointmentId52$$Pe4, _$patient_id16, _$patient_id16$, _$patient_id16$$name, _$appointmentId53, _$appointmentId53$, _$appointmentId53$$Pe, _$appointmentId53$$Pe2, _$patient_id17, _$patient_id17$, _$appointmentId$0$Per6, _$appointmentId54, _$appointmentId54$, _$appointmentId54$$Pe, _$appointmentId54$$Pe2, _$patient_id$0$teleco6, _$patient_id18, _$patient_id18$, _$patient_id18$$telec, _$patient_id18$$telec2, _$appointmentId55, _$appointmentId55$, _$appointmentId56, _$appointmentId56$, _$appointmentId57, _$appointmentId57$, _$appointmentId58, _$appointmentId58$, _$appointmentId59, _$appointmentId59$, _$visit_type6, _$appointmentId60, _$appointmentId60$, _$appointmentId60$$Sp, _$practitioner_detail15, _$practitioner_detail16, _$status6;
39125
39484
 
39126
39485
  return {
39127
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId56 = _.appointmentId) === null || _$appointmentId56 === void 0 ? void 0 : (_$appointmentId56$ = _$appointmentId56[0]) === null || _$appointmentId56$ === void 0 ? void 0 : (_$appointmentId56$$Pe = _$appointmentId56$.PersonID) === null || _$appointmentId56$$Pe === void 0 ? void 0 : (_$appointmentId56$$Pe2 = _$appointmentId56$$Pe[0]) === null || _$appointmentId56$$Pe2 === void 0 ? void 0 : (_$appointmentId56$$Pe3 = _$appointmentId56$$Pe2.photo) === null || _$appointmentId56$$Pe3 === void 0 ? void 0 : (_$appointmentId56$$Pe4 = _$appointmentId56$$Pe3[0]) === null || _$appointmentId56$$Pe4 === void 0 ? void 0 : _$appointmentId56$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId57 = _.appointmentId) === null || _$appointmentId57 === void 0 ? void 0 : (_$appointmentId57$ = _$appointmentId57[0]) === null || _$appointmentId57$ === void 0 ? void 0 : (_$appointmentId57$$Pe = _$appointmentId57$.PersonID) === null || _$appointmentId57$$Pe === void 0 ? void 0 : (_$appointmentId57$$Pe2 = _$appointmentId57$$Pe[0]) === null || _$appointmentId57$$Pe2 === void 0 ? void 0 : (_$appointmentId57$$Pe3 = _$appointmentId57$$Pe2.photo) === null || _$appointmentId57$$Pe3 === void 0 ? void 0 : (_$appointmentId57$$Pe4 = _$appointmentId57$$Pe3[0]) === null || _$appointmentId57$$Pe4 === void 0 ? void 0 : _$appointmentId57$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39128
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id22 = _.patient_id) === null || _$patient_id22 === void 0 ? void 0 : (_$patient_id22$ = _$patient_id22[0]) === null || _$patient_id22$ === void 0 ? void 0 : (_$patient_id22$$name = _$patient_id22$.name) === null || _$patient_id22$$name === void 0 ? void 0 : _$patient_id22$$name[0]) || {}),
39129
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id23 = _.patient_id) === null || _$patient_id23 === void 0 ? void 0 : (_$patient_id23$ = _$patient_id23[0]) === null || _$patient_id23$ === void 0 ? void 0 : _$patient_id23$.MRN) || "",
39130
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId58 = _.appointmentId) === null || _$appointmentId58 === void 0 ? void 0 : (_$appointmentId58$ = _$appointmentId58[0]) === null || _$appointmentId58$ === void 0 ? void 0 : _$appointmentId58$.appno) || "",
39131
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId59 = _.appointmentId) === null || _$appointmentId59 === void 0 ? void 0 : (_$appointmentId59$ = _$appointmentId59[0]) === null || _$appointmentId59$ === void 0 ? void 0 : _$appointmentId59$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId60 = _.appointmentId) === null || _$appointmentId60 === void 0 ? void 0 : (_$appointmentId60$ = _$appointmentId60[0]) === null || _$appointmentId60$ === void 0 ? void 0 : _$appointmentId60$.start, "DD MMM,YYYY") : "",
39132
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId61 = _.appointmentId) === null || _$appointmentId61 === void 0 ? void 0 : (_$appointmentId61$ = _$appointmentId61[0]) === null || _$appointmentId61$ === void 0 ? void 0 : _$appointmentId61$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId62 = _.appointmentId) === null || _$appointmentId62 === void 0 ? void 0 : (_$appointmentId62$ = _$appointmentId62[0]) === null || _$appointmentId62$ === void 0 ? void 0 : _$appointmentId62$.start, "hh:mm A") : "",
39133
- visitType: (_$visit_type7 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type7 !== void 0 ? _$visit_type7 : "",
39134
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId63 = _.appointmentId) === null || _$appointmentId63 === void 0 ? void 0 : (_$appointmentId63$ = _$appointmentId63[0]) === null || _$appointmentId63$ === void 0 ? void 0 : (_$appointmentId63$$Sp = _$appointmentId63$.SpecialtyID) === null || _$appointmentId63$$Sp === void 0 ? void 0 : _$appointmentId63$$Sp.map(function (spl) {
39135
- var _spl$coding14, _spl$coding14$;
39486
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId51 = _.appointmentId) === null || _$appointmentId51 === void 0 ? void 0 : (_$appointmentId51$ = _$appointmentId51[0]) === null || _$appointmentId51$ === void 0 ? void 0 : (_$appointmentId51$$Pe = _$appointmentId51$.PersonID) === null || _$appointmentId51$$Pe === void 0 ? void 0 : (_$appointmentId51$$Pe2 = _$appointmentId51$$Pe[0]) === null || _$appointmentId51$$Pe2 === void 0 ? void 0 : (_$appointmentId51$$Pe3 = _$appointmentId51$$Pe2.photo) === null || _$appointmentId51$$Pe3 === void 0 ? void 0 : (_$appointmentId51$$Pe4 = _$appointmentId51$$Pe3[0]) === null || _$appointmentId51$$Pe4 === void 0 ? void 0 : _$appointmentId51$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId52 = _.appointmentId) === null || _$appointmentId52 === void 0 ? void 0 : (_$appointmentId52$ = _$appointmentId52[0]) === null || _$appointmentId52$ === void 0 ? void 0 : (_$appointmentId52$$Pe = _$appointmentId52$.PersonID) === null || _$appointmentId52$$Pe === void 0 ? void 0 : (_$appointmentId52$$Pe2 = _$appointmentId52$$Pe[0]) === null || _$appointmentId52$$Pe2 === void 0 ? void 0 : (_$appointmentId52$$Pe3 = _$appointmentId52$$Pe2.photo) === null || _$appointmentId52$$Pe3 === void 0 ? void 0 : (_$appointmentId52$$Pe4 = _$appointmentId52$$Pe3[0]) === null || _$appointmentId52$$Pe4 === void 0 ? void 0 : _$appointmentId52$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39487
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
39488
+ // mrn: _?.patient_id?.[0]?.MRN || "",
39489
+ // refNo: _?.appointmentId?.[0]?.appno || "",
39490
+ // date: _?.appointmentId?.[0]?.start
39491
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
39492
+ // : "",
39493
+ // time: _?.appointmentId?.[0]?.start
39494
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
39495
+ // : "",
39496
+ // visitType: _?.visit_type ?? "",
39497
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
39498
+ // return spl?.coding?.[0]?.display;
39499
+ // }).join(", "),
39500
+ // clinic: _?.practitioner_details?.[0]?.clinic || "",
39501
+ // appointmentStatus: _?.status?.display || "",
39502
+ // "View Patient": true,
39503
+ // Attend: true,
39504
+ // type: "OP",
39505
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
39506
+ // data: _,
39507
+ // enId: _.id,
39508
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
39509
+ // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
39510
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
39511
+ // pId: _?.patient_id?.id,
39512
+ name: JSON.stringify({
39513
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id16 = _.patient_id) === null || _$patient_id16 === void 0 ? void 0 : (_$patient_id16$ = _$patient_id16[0]) === null || _$patient_id16$ === void 0 ? void 0 : (_$patient_id16$$name = _$patient_id16$.name) === null || _$patient_id16$$name === void 0 ? void 0 : _$patient_id16$$name[0]) || {}),
39514
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId53 = _.appointmentId) === null || _$appointmentId53 === void 0 ? void 0 : (_$appointmentId53$ = _$appointmentId53[0]) === null || _$appointmentId53$ === void 0 ? void 0 : (_$appointmentId53$$Pe = _$appointmentId53$.PersonID) === null || _$appointmentId53$$Pe === void 0 ? void 0 : (_$appointmentId53$$Pe2 = _$appointmentId53$$Pe[0]) === null || _$appointmentId53$$Pe2 === void 0 ? void 0 : _$appointmentId53$$Pe2.birthDay),
39515
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id17 = _.patient_id) === null || _$patient_id17 === void 0 ? void 0 : (_$patient_id17$ = _$patient_id17[0]) === null || _$patient_id17$ === void 0 ? void 0 : _$patient_id17$.MRN) || "",
39516
+ gender: (_$appointmentId$0$Per6 = _ === null || _ === void 0 ? void 0 : (_$appointmentId54 = _.appointmentId) === null || _$appointmentId54 === void 0 ? void 0 : (_$appointmentId54$ = _$appointmentId54[0]) === null || _$appointmentId54$ === void 0 ? void 0 : (_$appointmentId54$$Pe = _$appointmentId54$.PersonID) === null || _$appointmentId54$$Pe === void 0 ? void 0 : (_$appointmentId54$$Pe2 = _$appointmentId54$$Pe[0]) === null || _$appointmentId54$$Pe2 === void 0 ? void 0 : _$appointmentId54$$Pe2.gender) !== null && _$appointmentId$0$Per6 !== void 0 ? _$appointmentId$0$Per6 : "",
39517
+ contact: (_$patient_id$0$teleco6 = _ === null || _ === void 0 ? void 0 : (_$patient_id18 = _.patient_id) === null || _$patient_id18 === void 0 ? void 0 : (_$patient_id18$ = _$patient_id18[0]) === null || _$patient_id18$ === void 0 ? void 0 : (_$patient_id18$$telec = _$patient_id18$.telecom) === null || _$patient_id18$$telec === void 0 ? void 0 : (_$patient_id18$$telec2 = _$patient_id18$$telec[0]) === null || _$patient_id18$$telec2 === void 0 ? void 0 : _$patient_id18$$telec2.value) !== null && _$patient_id$0$teleco6 !== void 0 ? _$patient_id$0$teleco6 : ""
39518
+ }),
39519
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId55 = _.appointmentId) === null || _$appointmentId55 === void 0 ? void 0 : (_$appointmentId55$ = _$appointmentId55[0]) === null || _$appointmentId55$ === void 0 ? void 0 : _$appointmentId55$.appno) || "",
39520
+ date: JSON.stringify({
39521
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId56 = _.appointmentId) === null || _$appointmentId56 === void 0 ? void 0 : (_$appointmentId56$ = _$appointmentId56[0]) === null || _$appointmentId56$ === void 0 ? void 0 : _$appointmentId56$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId57 = _.appointmentId) === null || _$appointmentId57 === void 0 ? void 0 : (_$appointmentId57$ = _$appointmentId57[0]) === null || _$appointmentId57$ === void 0 ? void 0 : _$appointmentId57$.start, "DD MMM,YYYY") : "",
39522
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId58 = _.appointmentId) === null || _$appointmentId58 === void 0 ? void 0 : (_$appointmentId58$ = _$appointmentId58[0]) === null || _$appointmentId58$ === void 0 ? void 0 : _$appointmentId58$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId59 = _.appointmentId) === null || _$appointmentId59 === void 0 ? void 0 : (_$appointmentId59$ = _$appointmentId59[0]) === null || _$appointmentId59$ === void 0 ? void 0 : _$appointmentId59$.start, "hh:mm A") : ""
39523
+ }),
39524
+ visitType: (_$visit_type6 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type6 !== void 0 ? _$visit_type6 : "",
39525
+ speciality: JSON.stringify({
39526
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId60 = _.appointmentId) === null || _$appointmentId60 === void 0 ? void 0 : (_$appointmentId60$ = _$appointmentId60[0]) === null || _$appointmentId60$ === void 0 ? void 0 : (_$appointmentId60$$Sp = _$appointmentId60$.SpecialtyID) === null || _$appointmentId60$$Sp === void 0 ? void 0 : _$appointmentId60$$Sp.map(function (spl) {
39527
+ var _spl$coding8, _spl$coding8$;
39136
39528
 
39137
- return spl === null || spl === void 0 ? void 0 : (_spl$coding14 = spl.coding) === null || _spl$coding14 === void 0 ? void 0 : (_spl$coding14$ = _spl$coding14[0]) === null || _spl$coding14$ === void 0 ? void 0 : _spl$coding14$.display;
39138
- }).join(", "),
39139
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail13 = _.practitioner_details) === null || _$practitioner_detail13 === void 0 ? void 0 : (_$practitioner_detail14 = _$practitioner_detail13[0]) === null || _$practitioner_detail14 === void 0 ? void 0 : _$practitioner_detail14.clinic) || "",
39140
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status8 = _.status) === null || _$status8 === void 0 ? void 0 : _$status8.display) || "",
39141
- "View Patient": true,
39142
- Attend: true,
39143
- type: "OP",
39144
- appNo: (_$Encounter$appointme14 = _ === null || _ === void 0 ? void 0 : (_$Encounter57 = _.Encounter) === null || _$Encounter57 === void 0 ? void 0 : (_$Encounter57$appoint = _$Encounter57.appointmentId) === null || _$Encounter57$appoint === void 0 ? void 0 : _$Encounter57$appoint[0]) !== null && _$Encounter$appointme14 !== void 0 ? _$Encounter$appointme14 : "",
39145
- data: _,
39146
- enId: _.Encounter.id,
39147
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment75 = _.Appointment) === null || _$Appointment75 === void 0 ? void 0 : (_$Appointment75$Perso = _$Appointment75.PersonID) === null || _$Appointment75$Perso === void 0 ? void 0 : (_$Appointment75$Perso2 = _$Appointment75$Perso[0]) === null || _$Appointment75$Perso2 === void 0 ? void 0 : _$Appointment75$Perso2.birthDay),
39148
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment76 = _.Appointment) === null || _$Appointment76 === void 0 ? void 0 : (_$Appointment76$Perso = _$Appointment76.PersonID) === null || _$Appointment76$Perso === void 0 ? void 0 : (_$Appointment76$Perso2 = _$Appointment76$Perso[0]) === null || _$Appointment76$Perso2 === void 0 ? void 0 : _$Appointment76$Perso2.gender,
39149
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter58 = _.Encounter) === null || _$Encounter58 === void 0 ? void 0 : (_$Encounter58$patient = _$Encounter58.patient_id) === null || _$Encounter58$patient === void 0 ? void 0 : (_$Encounter58$patient2 = _$Encounter58$patient[0]) === null || _$Encounter58$patient2 === void 0 ? void 0 : (_$Encounter58$patient3 = _$Encounter58$patient2.telecom) === null || _$Encounter58$patient3 === void 0 ? void 0 : (_$Encounter58$patient4 = _$Encounter58$patient3[0]) === null || _$Encounter58$patient4 === void 0 ? void 0 : _$Encounter58$patient4.value
39529
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding8 = spl.coding) === null || _spl$coding8 === void 0 ? void 0 : (_spl$coding8$ = _spl$coding8[0]) === null || _spl$coding8$ === void 0 ? void 0 : _spl$coding8$.display;
39530
+ }).join(", "),
39531
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail15 = _.practitioner_details) === null || _$practitioner_detail15 === void 0 ? void 0 : (_$practitioner_detail16 = _$practitioner_detail15[0]) === null || _$practitioner_detail16 === void 0 ? void 0 : _$practitioner_detail16.clinic) || ""
39532
+ }),
39533
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status6 = _.status) === null || _$status6 === void 0 ? void 0 : _$status6.display) || "",
39534
+ action: true
39150
39535
  };
39151
39536
  }) : [];
39152
39537
  return _context14.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -39169,7 +39554,7 @@ var GET_FIRST_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getFirs
39169
39554
  })));
39170
39555
  var GET_NEW_PATIENTS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getNewPatientsDoctor", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() {
39171
39556
  var payload,
39172
- _ref36,
39557
+ _ref30,
39173
39558
  rejectWithValue,
39174
39559
  _data$result15,
39175
39560
  data,
@@ -39181,7 +39566,7 @@ var GET_NEW_PATIENTS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getNewP
39181
39566
  switch (_context15.prev = _context15.next) {
39182
39567
  case 0:
39183
39568
  payload = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
39184
- _ref36 = _args15.length > 1 ? _args15[1] : undefined, rejectWithValue = _ref36.rejectWithValue;
39569
+ _ref30 = _args15.length > 1 ? _args15[1] : undefined, rejectWithValue = _ref30.rejectWithValue;
39185
39570
  _context15.prev = 2;
39186
39571
  _context15.next = 5;
39187
39572
  return fetchData$3({
@@ -39191,32 +39576,58 @@ var GET_NEW_PATIENTS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getNewP
39191
39576
  case 5:
39192
39577
  data = _context15.sent;
39193
39578
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result15 = data.result) === null || _data$result15 === void 0 ? void 0 : _data$result15.map(function (_) {
39194
- var _$appointmentId64, _$appointmentId64$, _$appointmentId64$$Pe, _$appointmentId64$$Pe2, _$appointmentId64$$Pe3, _$appointmentId64$$Pe4, _$appointmentId65, _$appointmentId65$, _$appointmentId65$$Pe, _$appointmentId65$$Pe2, _$appointmentId65$$Pe3, _$appointmentId65$$Pe4, _$patient_id24, _$patient_id24$, _$patient_id24$$name, _$patient_id25, _$patient_id25$, _$appointmentId66, _$appointmentId66$, _$appointmentId67, _$appointmentId67$, _$appointmentId68, _$appointmentId68$, _$appointmentId69, _$appointmentId69$, _$appointmentId70, _$appointmentId70$, _$visit_type8, _$appointmentId71, _$appointmentId71$, _$appointmentId71$$Sp, _$practitioner_detail15, _$practitioner_detail16, _$status9, _$Encounter$appointme15, _$Encounter59, _$Encounter59$appoint, _$Appointment77, _$Appointment77$Perso, _$Appointment77$Perso2, _$Appointment78, _$Appointment78$Perso, _$Appointment78$Perso2, _$Encounter60, _$Encounter60$patient, _$Encounter60$patient2, _$Encounter60$patient3, _$Encounter60$patient4;
39579
+ var _$appointmentId61, _$appointmentId61$, _$appointmentId61$$Pe, _$appointmentId61$$Pe2, _$appointmentId61$$Pe3, _$appointmentId61$$Pe4, _$appointmentId62, _$appointmentId62$, _$appointmentId62$$Pe, _$appointmentId62$$Pe2, _$appointmentId62$$Pe3, _$appointmentId62$$Pe4, _$patient_id19, _$patient_id19$, _$patient_id19$$name, _$appointmentId63, _$appointmentId63$, _$appointmentId63$$Pe, _$appointmentId63$$Pe2, _$patient_id20, _$patient_id20$, _$appointmentId$0$Per7, _$appointmentId64, _$appointmentId64$, _$appointmentId64$$Pe, _$appointmentId64$$Pe2, _$patient_id$0$teleco7, _$patient_id21, _$patient_id21$, _$patient_id21$$telec, _$patient_id21$$telec2, _$appointmentId65, _$appointmentId65$, _$appointmentId66, _$appointmentId66$, _$appointmentId67, _$appointmentId67$, _$appointmentId68, _$appointmentId68$, _$appointmentId69, _$appointmentId69$, _$visit_type7, _$appointmentId70, _$appointmentId70$, _$appointmentId70$$Sp, _$practitioner_detail17, _$practitioner_detail18, _$status7;
39195
39580
 
39196
39581
  return {
39197
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId64 = _.appointmentId) === null || _$appointmentId64 === void 0 ? void 0 : (_$appointmentId64$ = _$appointmentId64[0]) === null || _$appointmentId64$ === void 0 ? void 0 : (_$appointmentId64$$Pe = _$appointmentId64$.PersonID) === null || _$appointmentId64$$Pe === void 0 ? void 0 : (_$appointmentId64$$Pe2 = _$appointmentId64$$Pe[0]) === null || _$appointmentId64$$Pe2 === void 0 ? void 0 : (_$appointmentId64$$Pe3 = _$appointmentId64$$Pe2.photo) === null || _$appointmentId64$$Pe3 === void 0 ? void 0 : (_$appointmentId64$$Pe4 = _$appointmentId64$$Pe3[0]) === null || _$appointmentId64$$Pe4 === void 0 ? void 0 : _$appointmentId64$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId65 = _.appointmentId) === null || _$appointmentId65 === void 0 ? void 0 : (_$appointmentId65$ = _$appointmentId65[0]) === null || _$appointmentId65$ === void 0 ? void 0 : (_$appointmentId65$$Pe = _$appointmentId65$.PersonID) === null || _$appointmentId65$$Pe === void 0 ? void 0 : (_$appointmentId65$$Pe2 = _$appointmentId65$$Pe[0]) === null || _$appointmentId65$$Pe2 === void 0 ? void 0 : (_$appointmentId65$$Pe3 = _$appointmentId65$$Pe2.photo) === null || _$appointmentId65$$Pe3 === void 0 ? void 0 : (_$appointmentId65$$Pe4 = _$appointmentId65$$Pe3[0]) === null || _$appointmentId65$$Pe4 === void 0 ? void 0 : _$appointmentId65$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39198
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id24 = _.patient_id) === null || _$patient_id24 === void 0 ? void 0 : (_$patient_id24$ = _$patient_id24[0]) === null || _$patient_id24$ === void 0 ? void 0 : (_$patient_id24$$name = _$patient_id24$.name) === null || _$patient_id24$$name === void 0 ? void 0 : _$patient_id24$$name[0]) || {}),
39199
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id25 = _.patient_id) === null || _$patient_id25 === void 0 ? void 0 : (_$patient_id25$ = _$patient_id25[0]) === null || _$patient_id25$ === void 0 ? void 0 : _$patient_id25$.MRN) || "",
39200
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId66 = _.appointmentId) === null || _$appointmentId66 === void 0 ? void 0 : (_$appointmentId66$ = _$appointmentId66[0]) === null || _$appointmentId66$ === void 0 ? void 0 : _$appointmentId66$.appno) || "",
39201
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId67 = _.appointmentId) === null || _$appointmentId67 === void 0 ? void 0 : (_$appointmentId67$ = _$appointmentId67[0]) === null || _$appointmentId67$ === void 0 ? void 0 : _$appointmentId67$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId68 = _.appointmentId) === null || _$appointmentId68 === void 0 ? void 0 : (_$appointmentId68$ = _$appointmentId68[0]) === null || _$appointmentId68$ === void 0 ? void 0 : _$appointmentId68$.start, "DD MMM,YYYY") : "",
39202
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId69 = _.appointmentId) === null || _$appointmentId69 === void 0 ? void 0 : (_$appointmentId69$ = _$appointmentId69[0]) === null || _$appointmentId69$ === void 0 ? void 0 : _$appointmentId69$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId70 = _.appointmentId) === null || _$appointmentId70 === void 0 ? void 0 : (_$appointmentId70$ = _$appointmentId70[0]) === null || _$appointmentId70$ === void 0 ? void 0 : _$appointmentId70$.start, "hh:mm A") : "",
39203
- visitType: (_$visit_type8 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type8 !== void 0 ? _$visit_type8 : "",
39204
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId71 = _.appointmentId) === null || _$appointmentId71 === void 0 ? void 0 : (_$appointmentId71$ = _$appointmentId71[0]) === null || _$appointmentId71$ === void 0 ? void 0 : (_$appointmentId71$$Sp = _$appointmentId71$.SpecialtyID) === null || _$appointmentId71$$Sp === void 0 ? void 0 : _$appointmentId71$$Sp.map(function (spl) {
39205
- var _spl$coding15, _spl$coding15$;
39582
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId61 = _.appointmentId) === null || _$appointmentId61 === void 0 ? void 0 : (_$appointmentId61$ = _$appointmentId61[0]) === null || _$appointmentId61$ === void 0 ? void 0 : (_$appointmentId61$$Pe = _$appointmentId61$.PersonID) === null || _$appointmentId61$$Pe === void 0 ? void 0 : (_$appointmentId61$$Pe2 = _$appointmentId61$$Pe[0]) === null || _$appointmentId61$$Pe2 === void 0 ? void 0 : (_$appointmentId61$$Pe3 = _$appointmentId61$$Pe2.photo) === null || _$appointmentId61$$Pe3 === void 0 ? void 0 : (_$appointmentId61$$Pe4 = _$appointmentId61$$Pe3[0]) === null || _$appointmentId61$$Pe4 === void 0 ? void 0 : _$appointmentId61$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId62 = _.appointmentId) === null || _$appointmentId62 === void 0 ? void 0 : (_$appointmentId62$ = _$appointmentId62[0]) === null || _$appointmentId62$ === void 0 ? void 0 : (_$appointmentId62$$Pe = _$appointmentId62$.PersonID) === null || _$appointmentId62$$Pe === void 0 ? void 0 : (_$appointmentId62$$Pe2 = _$appointmentId62$$Pe[0]) === null || _$appointmentId62$$Pe2 === void 0 ? void 0 : (_$appointmentId62$$Pe3 = _$appointmentId62$$Pe2.photo) === null || _$appointmentId62$$Pe3 === void 0 ? void 0 : (_$appointmentId62$$Pe4 = _$appointmentId62$$Pe3[0]) === null || _$appointmentId62$$Pe4 === void 0 ? void 0 : _$appointmentId62$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39583
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
39584
+ // mrn: _?.patient_id?.[0]?.MRN || "",
39585
+ // refNo: _?.appointmentId?.[0]?.appno || "",
39586
+ // date: _?.appointmentId?.[0]?.start
39587
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
39588
+ // : "",
39589
+ // time: _?.appointmentId?.[0]?.start
39590
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
39591
+ // : "",
39592
+ // visitType: _?.visit_type ?? "",
39593
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
39594
+ // return spl?.coding?.[0]?.display;
39595
+ // }).join(", "),
39596
+ // clinic: _?.practitioner_details?.[0]?.clinic || "",
39597
+ // appointmentStatus: _?.status?.display || "",
39598
+ // "View Patient": true,
39599
+ // Attend: true,
39600
+ // type: "OP",
39601
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
39602
+ // data: _,
39603
+ // enId: _.id,
39604
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
39605
+ // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
39606
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
39607
+ // pId: _?.patient_id?.id,
39608
+ name: JSON.stringify({
39609
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id19 = _.patient_id) === null || _$patient_id19 === void 0 ? void 0 : (_$patient_id19$ = _$patient_id19[0]) === null || _$patient_id19$ === void 0 ? void 0 : (_$patient_id19$$name = _$patient_id19$.name) === null || _$patient_id19$$name === void 0 ? void 0 : _$patient_id19$$name[0]) || {}),
39610
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId63 = _.appointmentId) === null || _$appointmentId63 === void 0 ? void 0 : (_$appointmentId63$ = _$appointmentId63[0]) === null || _$appointmentId63$ === void 0 ? void 0 : (_$appointmentId63$$Pe = _$appointmentId63$.PersonID) === null || _$appointmentId63$$Pe === void 0 ? void 0 : (_$appointmentId63$$Pe2 = _$appointmentId63$$Pe[0]) === null || _$appointmentId63$$Pe2 === void 0 ? void 0 : _$appointmentId63$$Pe2.birthDay),
39611
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id20 = _.patient_id) === null || _$patient_id20 === void 0 ? void 0 : (_$patient_id20$ = _$patient_id20[0]) === null || _$patient_id20$ === void 0 ? void 0 : _$patient_id20$.MRN) || "",
39612
+ gender: (_$appointmentId$0$Per7 = _ === null || _ === void 0 ? void 0 : (_$appointmentId64 = _.appointmentId) === null || _$appointmentId64 === void 0 ? void 0 : (_$appointmentId64$ = _$appointmentId64[0]) === null || _$appointmentId64$ === void 0 ? void 0 : (_$appointmentId64$$Pe = _$appointmentId64$.PersonID) === null || _$appointmentId64$$Pe === void 0 ? void 0 : (_$appointmentId64$$Pe2 = _$appointmentId64$$Pe[0]) === null || _$appointmentId64$$Pe2 === void 0 ? void 0 : _$appointmentId64$$Pe2.gender) !== null && _$appointmentId$0$Per7 !== void 0 ? _$appointmentId$0$Per7 : "",
39613
+ contact: (_$patient_id$0$teleco7 = _ === null || _ === void 0 ? void 0 : (_$patient_id21 = _.patient_id) === null || _$patient_id21 === void 0 ? void 0 : (_$patient_id21$ = _$patient_id21[0]) === null || _$patient_id21$ === void 0 ? void 0 : (_$patient_id21$$telec = _$patient_id21$.telecom) === null || _$patient_id21$$telec === void 0 ? void 0 : (_$patient_id21$$telec2 = _$patient_id21$$telec[0]) === null || _$patient_id21$$telec2 === void 0 ? void 0 : _$patient_id21$$telec2.value) !== null && _$patient_id$0$teleco7 !== void 0 ? _$patient_id$0$teleco7 : ""
39614
+ }),
39615
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId65 = _.appointmentId) === null || _$appointmentId65 === void 0 ? void 0 : (_$appointmentId65$ = _$appointmentId65[0]) === null || _$appointmentId65$ === void 0 ? void 0 : _$appointmentId65$.appno) || "",
39616
+ date: JSON.stringify({
39617
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId66 = _.appointmentId) === null || _$appointmentId66 === void 0 ? void 0 : (_$appointmentId66$ = _$appointmentId66[0]) === null || _$appointmentId66$ === void 0 ? void 0 : _$appointmentId66$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId67 = _.appointmentId) === null || _$appointmentId67 === void 0 ? void 0 : (_$appointmentId67$ = _$appointmentId67[0]) === null || _$appointmentId67$ === void 0 ? void 0 : _$appointmentId67$.start, "DD MMM,YYYY") : "",
39618
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId68 = _.appointmentId) === null || _$appointmentId68 === void 0 ? void 0 : (_$appointmentId68$ = _$appointmentId68[0]) === null || _$appointmentId68$ === void 0 ? void 0 : _$appointmentId68$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId69 = _.appointmentId) === null || _$appointmentId69 === void 0 ? void 0 : (_$appointmentId69$ = _$appointmentId69[0]) === null || _$appointmentId69$ === void 0 ? void 0 : _$appointmentId69$.start, "hh:mm A") : ""
39619
+ }),
39620
+ visitType: (_$visit_type7 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type7 !== void 0 ? _$visit_type7 : "",
39621
+ speciality: JSON.stringify({
39622
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId70 = _.appointmentId) === null || _$appointmentId70 === void 0 ? void 0 : (_$appointmentId70$ = _$appointmentId70[0]) === null || _$appointmentId70$ === void 0 ? void 0 : (_$appointmentId70$$Sp = _$appointmentId70$.SpecialtyID) === null || _$appointmentId70$$Sp === void 0 ? void 0 : _$appointmentId70$$Sp.map(function (spl) {
39623
+ var _spl$coding9, _spl$coding9$;
39206
39624
 
39207
- return spl === null || spl === void 0 ? void 0 : (_spl$coding15 = spl.coding) === null || _spl$coding15 === void 0 ? void 0 : (_spl$coding15$ = _spl$coding15[0]) === null || _spl$coding15$ === void 0 ? void 0 : _spl$coding15$.display;
39208
- }).join(", "),
39209
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail15 = _.practitioner_details) === null || _$practitioner_detail15 === void 0 ? void 0 : (_$practitioner_detail16 = _$practitioner_detail15[0]) === null || _$practitioner_detail16 === void 0 ? void 0 : _$practitioner_detail16.clinic) || "",
39210
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status9 = _.status) === null || _$status9 === void 0 ? void 0 : _$status9.display) || "",
39211
- "View Patient": true,
39212
- Attend: true,
39213
- type: "OP",
39214
- appNo: (_$Encounter$appointme15 = _ === null || _ === void 0 ? void 0 : (_$Encounter59 = _.Encounter) === null || _$Encounter59 === void 0 ? void 0 : (_$Encounter59$appoint = _$Encounter59.appointmentId) === null || _$Encounter59$appoint === void 0 ? void 0 : _$Encounter59$appoint[0]) !== null && _$Encounter$appointme15 !== void 0 ? _$Encounter$appointme15 : "",
39215
- data: _,
39216
- enId: _.Encounter.id,
39217
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment77 = _.Appointment) === null || _$Appointment77 === void 0 ? void 0 : (_$Appointment77$Perso = _$Appointment77.PersonID) === null || _$Appointment77$Perso === void 0 ? void 0 : (_$Appointment77$Perso2 = _$Appointment77$Perso[0]) === null || _$Appointment77$Perso2 === void 0 ? void 0 : _$Appointment77$Perso2.birthDay),
39218
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment78 = _.Appointment) === null || _$Appointment78 === void 0 ? void 0 : (_$Appointment78$Perso = _$Appointment78.PersonID) === null || _$Appointment78$Perso === void 0 ? void 0 : (_$Appointment78$Perso2 = _$Appointment78$Perso[0]) === null || _$Appointment78$Perso2 === void 0 ? void 0 : _$Appointment78$Perso2.gender,
39219
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter60 = _.Encounter) === null || _$Encounter60 === void 0 ? void 0 : (_$Encounter60$patient = _$Encounter60.patient_id) === null || _$Encounter60$patient === void 0 ? void 0 : (_$Encounter60$patient2 = _$Encounter60$patient[0]) === null || _$Encounter60$patient2 === void 0 ? void 0 : (_$Encounter60$patient3 = _$Encounter60$patient2.telecom) === null || _$Encounter60$patient3 === void 0 ? void 0 : (_$Encounter60$patient4 = _$Encounter60$patient3[0]) === null || _$Encounter60$patient4 === void 0 ? void 0 : _$Encounter60$patient4.value
39625
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding9 = spl.coding) === null || _spl$coding9 === void 0 ? void 0 : (_spl$coding9$ = _spl$coding9[0]) === null || _spl$coding9$ === void 0 ? void 0 : _spl$coding9$.display;
39626
+ }).join(", "),
39627
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail17 = _.practitioner_details) === null || _$practitioner_detail17 === void 0 ? void 0 : (_$practitioner_detail18 = _$practitioner_detail17[0]) === null || _$practitioner_detail18 === void 0 ? void 0 : _$practitioner_detail18.clinic) || ""
39628
+ }),
39629
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status7 = _.status) === null || _$status7 === void 0 ? void 0 : _$status7.display) || "",
39630
+ action: true
39220
39631
  };
39221
39632
  }) : [];
39222
39633
  return _context15.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -39239,7 +39650,7 @@ var GET_NEW_PATIENTS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getNewP
39239
39650
  })));
39240
39651
  var GET_OTHER_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getOtherVisitsDoctor", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
39241
39652
  var payload,
39242
- _ref38,
39653
+ _ref32,
39243
39654
  rejectWithValue,
39244
39655
  _data$result16,
39245
39656
  data,
@@ -39251,7 +39662,7 @@ var GET_OTHER_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getOthe
39251
39662
  switch (_context16.prev = _context16.next) {
39252
39663
  case 0:
39253
39664
  payload = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
39254
- _ref38 = _args16.length > 1 ? _args16[1] : undefined, rejectWithValue = _ref38.rejectWithValue;
39665
+ _ref32 = _args16.length > 1 ? _args16[1] : undefined, rejectWithValue = _ref32.rejectWithValue;
39255
39666
  _context16.prev = 2;
39256
39667
  _context16.next = 5;
39257
39668
  return fetchData$3({
@@ -39261,32 +39672,58 @@ var GET_OTHER_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getOthe
39261
39672
  case 5:
39262
39673
  data = _context16.sent;
39263
39674
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result16 = data.result) === null || _data$result16 === void 0 ? void 0 : _data$result16.map(function (_) {
39264
- var _$appointmentId72, _$appointmentId72$, _$appointmentId72$$Pe, _$appointmentId72$$Pe2, _$appointmentId72$$Pe3, _$appointmentId72$$Pe4, _$appointmentId73, _$appointmentId73$, _$appointmentId73$$Pe, _$appointmentId73$$Pe2, _$appointmentId73$$Pe3, _$appointmentId73$$Pe4, _$patient_id26, _$patient_id26$, _$patient_id26$$name, _$patient_id27, _$patient_id27$, _$appointmentId74, _$appointmentId74$, _$appointmentId75, _$appointmentId75$, _$appointmentId76, _$appointmentId76$, _$appointmentId77, _$appointmentId77$, _$appointmentId78, _$appointmentId78$, _$visit_type9, _$appointmentId79, _$appointmentId79$, _$appointmentId79$$Sp, _$practitioner_detail17, _$practitioner_detail18, _$status10, _$Encounter$appointme16, _$Encounter61, _$Encounter61$appoint, _$Appointment79, _$Appointment79$Perso, _$Appointment79$Perso2, _$Appointment80, _$Appointment80$Perso, _$Appointment80$Perso2, _$Encounter62, _$Encounter62$patient, _$Encounter62$patient2, _$Encounter62$patient3, _$Encounter62$patient4;
39675
+ var _$appointmentId71, _$appointmentId71$, _$appointmentId71$$Pe, _$appointmentId71$$Pe2, _$appointmentId71$$Pe3, _$appointmentId71$$Pe4, _$appointmentId72, _$appointmentId72$, _$appointmentId72$$Pe, _$appointmentId72$$Pe2, _$appointmentId72$$Pe3, _$appointmentId72$$Pe4, _$patient_id22, _$patient_id22$, _$patient_id22$$name, _$appointmentId73, _$appointmentId73$, _$appointmentId73$$Pe, _$appointmentId73$$Pe2, _$patient_id23, _$patient_id23$, _$appointmentId$0$Per8, _$appointmentId74, _$appointmentId74$, _$appointmentId74$$Pe, _$appointmentId74$$Pe2, _$patient_id$0$teleco8, _$patient_id24, _$patient_id24$, _$patient_id24$$telec, _$patient_id24$$telec2, _$appointmentId75, _$appointmentId75$, _$appointmentId76, _$appointmentId76$, _$appointmentId77, _$appointmentId77$, _$appointmentId78, _$appointmentId78$, _$appointmentId79, _$appointmentId79$, _$visit_type8, _$appointmentId80, _$appointmentId80$, _$appointmentId80$$Sp, _$practitioner_detail19, _$practitioner_detail20, _$status8;
39265
39676
 
39266
39677
  return {
39267
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId72 = _.appointmentId) === null || _$appointmentId72 === void 0 ? void 0 : (_$appointmentId72$ = _$appointmentId72[0]) === null || _$appointmentId72$ === void 0 ? void 0 : (_$appointmentId72$$Pe = _$appointmentId72$.PersonID) === null || _$appointmentId72$$Pe === void 0 ? void 0 : (_$appointmentId72$$Pe2 = _$appointmentId72$$Pe[0]) === null || _$appointmentId72$$Pe2 === void 0 ? void 0 : (_$appointmentId72$$Pe3 = _$appointmentId72$$Pe2.photo) === null || _$appointmentId72$$Pe3 === void 0 ? void 0 : (_$appointmentId72$$Pe4 = _$appointmentId72$$Pe3[0]) === null || _$appointmentId72$$Pe4 === void 0 ? void 0 : _$appointmentId72$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId73 = _.appointmentId) === null || _$appointmentId73 === void 0 ? void 0 : (_$appointmentId73$ = _$appointmentId73[0]) === null || _$appointmentId73$ === void 0 ? void 0 : (_$appointmentId73$$Pe = _$appointmentId73$.PersonID) === null || _$appointmentId73$$Pe === void 0 ? void 0 : (_$appointmentId73$$Pe2 = _$appointmentId73$$Pe[0]) === null || _$appointmentId73$$Pe2 === void 0 ? void 0 : (_$appointmentId73$$Pe3 = _$appointmentId73$$Pe2.photo) === null || _$appointmentId73$$Pe3 === void 0 ? void 0 : (_$appointmentId73$$Pe4 = _$appointmentId73$$Pe3[0]) === null || _$appointmentId73$$Pe4 === void 0 ? void 0 : _$appointmentId73$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39268
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id26 = _.patient_id) === null || _$patient_id26 === void 0 ? void 0 : (_$patient_id26$ = _$patient_id26[0]) === null || _$patient_id26$ === void 0 ? void 0 : (_$patient_id26$$name = _$patient_id26$.name) === null || _$patient_id26$$name === void 0 ? void 0 : _$patient_id26$$name[0]) || {}),
39269
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id27 = _.patient_id) === null || _$patient_id27 === void 0 ? void 0 : (_$patient_id27$ = _$patient_id27[0]) === null || _$patient_id27$ === void 0 ? void 0 : _$patient_id27$.MRN) || "",
39270
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId74 = _.appointmentId) === null || _$appointmentId74 === void 0 ? void 0 : (_$appointmentId74$ = _$appointmentId74[0]) === null || _$appointmentId74$ === void 0 ? void 0 : _$appointmentId74$.appno) || "",
39271
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId75 = _.appointmentId) === null || _$appointmentId75 === void 0 ? void 0 : (_$appointmentId75$ = _$appointmentId75[0]) === null || _$appointmentId75$ === void 0 ? void 0 : _$appointmentId75$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId76 = _.appointmentId) === null || _$appointmentId76 === void 0 ? void 0 : (_$appointmentId76$ = _$appointmentId76[0]) === null || _$appointmentId76$ === void 0 ? void 0 : _$appointmentId76$.start, "DD MMM,YYYY") : "",
39272
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId77 = _.appointmentId) === null || _$appointmentId77 === void 0 ? void 0 : (_$appointmentId77$ = _$appointmentId77[0]) === null || _$appointmentId77$ === void 0 ? void 0 : _$appointmentId77$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId78 = _.appointmentId) === null || _$appointmentId78 === void 0 ? void 0 : (_$appointmentId78$ = _$appointmentId78[0]) === null || _$appointmentId78$ === void 0 ? void 0 : _$appointmentId78$.start, "hh:mm A") : "",
39273
- visitType: (_$visit_type9 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type9 !== void 0 ? _$visit_type9 : "",
39274
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId79 = _.appointmentId) === null || _$appointmentId79 === void 0 ? void 0 : (_$appointmentId79$ = _$appointmentId79[0]) === null || _$appointmentId79$ === void 0 ? void 0 : (_$appointmentId79$$Sp = _$appointmentId79$.SpecialtyID) === null || _$appointmentId79$$Sp === void 0 ? void 0 : _$appointmentId79$$Sp.map(function (spl) {
39275
- var _spl$coding16, _spl$coding16$;
39678
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId71 = _.appointmentId) === null || _$appointmentId71 === void 0 ? void 0 : (_$appointmentId71$ = _$appointmentId71[0]) === null || _$appointmentId71$ === void 0 ? void 0 : (_$appointmentId71$$Pe = _$appointmentId71$.PersonID) === null || _$appointmentId71$$Pe === void 0 ? void 0 : (_$appointmentId71$$Pe2 = _$appointmentId71$$Pe[0]) === null || _$appointmentId71$$Pe2 === void 0 ? void 0 : (_$appointmentId71$$Pe3 = _$appointmentId71$$Pe2.photo) === null || _$appointmentId71$$Pe3 === void 0 ? void 0 : (_$appointmentId71$$Pe4 = _$appointmentId71$$Pe3[0]) === null || _$appointmentId71$$Pe4 === void 0 ? void 0 : _$appointmentId71$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId72 = _.appointmentId) === null || _$appointmentId72 === void 0 ? void 0 : (_$appointmentId72$ = _$appointmentId72[0]) === null || _$appointmentId72$ === void 0 ? void 0 : (_$appointmentId72$$Pe = _$appointmentId72$.PersonID) === null || _$appointmentId72$$Pe === void 0 ? void 0 : (_$appointmentId72$$Pe2 = _$appointmentId72$$Pe[0]) === null || _$appointmentId72$$Pe2 === void 0 ? void 0 : (_$appointmentId72$$Pe3 = _$appointmentId72$$Pe2.photo) === null || _$appointmentId72$$Pe3 === void 0 ? void 0 : (_$appointmentId72$$Pe4 = _$appointmentId72$$Pe3[0]) === null || _$appointmentId72$$Pe4 === void 0 ? void 0 : _$appointmentId72$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39679
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
39680
+ // mrn: _?.patient_id?.[0]?.MRN || "",
39681
+ // refNo: _?.appointmentId?.[0]?.appno || "",
39682
+ // date: _?.appointmentId?.[0]?.start
39683
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
39684
+ // : "",
39685
+ // time: _?.appointmentId?.[0]?.start
39686
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
39687
+ // : "",
39688
+ // visitType: _?.visit_type ?? "",
39689
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
39690
+ // return spl?.coding?.[0]?.display;
39691
+ // }).join(", "),
39692
+ // clinic: _?.practitioner_details?.[0]?.clinic || "",
39693
+ // appointmentStatus: _?.status?.display || "",
39694
+ // "View Patient": true,
39695
+ // Attend: true,
39696
+ // type: "OP",
39697
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
39698
+ // data: _,
39699
+ // enId: _.id,
39700
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
39701
+ // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
39702
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
39703
+ // pId: _?.patient_id?.id,
39704
+ name: JSON.stringify({
39705
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id22 = _.patient_id) === null || _$patient_id22 === void 0 ? void 0 : (_$patient_id22$ = _$patient_id22[0]) === null || _$patient_id22$ === void 0 ? void 0 : (_$patient_id22$$name = _$patient_id22$.name) === null || _$patient_id22$$name === void 0 ? void 0 : _$patient_id22$$name[0]) || {}),
39706
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId73 = _.appointmentId) === null || _$appointmentId73 === void 0 ? void 0 : (_$appointmentId73$ = _$appointmentId73[0]) === null || _$appointmentId73$ === void 0 ? void 0 : (_$appointmentId73$$Pe = _$appointmentId73$.PersonID) === null || _$appointmentId73$$Pe === void 0 ? void 0 : (_$appointmentId73$$Pe2 = _$appointmentId73$$Pe[0]) === null || _$appointmentId73$$Pe2 === void 0 ? void 0 : _$appointmentId73$$Pe2.birthDay),
39707
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id23 = _.patient_id) === null || _$patient_id23 === void 0 ? void 0 : (_$patient_id23$ = _$patient_id23[0]) === null || _$patient_id23$ === void 0 ? void 0 : _$patient_id23$.MRN) || "",
39708
+ gender: (_$appointmentId$0$Per8 = _ === null || _ === void 0 ? void 0 : (_$appointmentId74 = _.appointmentId) === null || _$appointmentId74 === void 0 ? void 0 : (_$appointmentId74$ = _$appointmentId74[0]) === null || _$appointmentId74$ === void 0 ? void 0 : (_$appointmentId74$$Pe = _$appointmentId74$.PersonID) === null || _$appointmentId74$$Pe === void 0 ? void 0 : (_$appointmentId74$$Pe2 = _$appointmentId74$$Pe[0]) === null || _$appointmentId74$$Pe2 === void 0 ? void 0 : _$appointmentId74$$Pe2.gender) !== null && _$appointmentId$0$Per8 !== void 0 ? _$appointmentId$0$Per8 : "",
39709
+ contact: (_$patient_id$0$teleco8 = _ === null || _ === void 0 ? void 0 : (_$patient_id24 = _.patient_id) === null || _$patient_id24 === void 0 ? void 0 : (_$patient_id24$ = _$patient_id24[0]) === null || _$patient_id24$ === void 0 ? void 0 : (_$patient_id24$$telec = _$patient_id24$.telecom) === null || _$patient_id24$$telec === void 0 ? void 0 : (_$patient_id24$$telec2 = _$patient_id24$$telec[0]) === null || _$patient_id24$$telec2 === void 0 ? void 0 : _$patient_id24$$telec2.value) !== null && _$patient_id$0$teleco8 !== void 0 ? _$patient_id$0$teleco8 : ""
39710
+ }),
39711
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId75 = _.appointmentId) === null || _$appointmentId75 === void 0 ? void 0 : (_$appointmentId75$ = _$appointmentId75[0]) === null || _$appointmentId75$ === void 0 ? void 0 : _$appointmentId75$.appno) || "",
39712
+ date: JSON.stringify({
39713
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId76 = _.appointmentId) === null || _$appointmentId76 === void 0 ? void 0 : (_$appointmentId76$ = _$appointmentId76[0]) === null || _$appointmentId76$ === void 0 ? void 0 : _$appointmentId76$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId77 = _.appointmentId) === null || _$appointmentId77 === void 0 ? void 0 : (_$appointmentId77$ = _$appointmentId77[0]) === null || _$appointmentId77$ === void 0 ? void 0 : _$appointmentId77$.start, "DD MMM,YYYY") : "",
39714
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId78 = _.appointmentId) === null || _$appointmentId78 === void 0 ? void 0 : (_$appointmentId78$ = _$appointmentId78[0]) === null || _$appointmentId78$ === void 0 ? void 0 : _$appointmentId78$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId79 = _.appointmentId) === null || _$appointmentId79 === void 0 ? void 0 : (_$appointmentId79$ = _$appointmentId79[0]) === null || _$appointmentId79$ === void 0 ? void 0 : _$appointmentId79$.start, "hh:mm A") : ""
39715
+ }),
39716
+ visitType: (_$visit_type8 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type8 !== void 0 ? _$visit_type8 : "",
39717
+ speciality: JSON.stringify({
39718
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId80 = _.appointmentId) === null || _$appointmentId80 === void 0 ? void 0 : (_$appointmentId80$ = _$appointmentId80[0]) === null || _$appointmentId80$ === void 0 ? void 0 : (_$appointmentId80$$Sp = _$appointmentId80$.SpecialtyID) === null || _$appointmentId80$$Sp === void 0 ? void 0 : _$appointmentId80$$Sp.map(function (spl) {
39719
+ var _spl$coding10, _spl$coding10$;
39276
39720
 
39277
- return spl === null || spl === void 0 ? void 0 : (_spl$coding16 = spl.coding) === null || _spl$coding16 === void 0 ? void 0 : (_spl$coding16$ = _spl$coding16[0]) === null || _spl$coding16$ === void 0 ? void 0 : _spl$coding16$.display;
39278
- }).join(", "),
39279
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail17 = _.practitioner_details) === null || _$practitioner_detail17 === void 0 ? void 0 : (_$practitioner_detail18 = _$practitioner_detail17[0]) === null || _$practitioner_detail18 === void 0 ? void 0 : _$practitioner_detail18.clinic) || "",
39280
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status10 = _.status) === null || _$status10 === void 0 ? void 0 : _$status10.display) || "",
39281
- "View Patient": true,
39282
- Attend: true,
39283
- type: "OP",
39284
- appNo: (_$Encounter$appointme16 = _ === null || _ === void 0 ? void 0 : (_$Encounter61 = _.Encounter) === null || _$Encounter61 === void 0 ? void 0 : (_$Encounter61$appoint = _$Encounter61.appointmentId) === null || _$Encounter61$appoint === void 0 ? void 0 : _$Encounter61$appoint[0]) !== null && _$Encounter$appointme16 !== void 0 ? _$Encounter$appointme16 : "",
39285
- data: _,
39286
- enId: _.Encounter.id,
39287
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment79 = _.Appointment) === null || _$Appointment79 === void 0 ? void 0 : (_$Appointment79$Perso = _$Appointment79.PersonID) === null || _$Appointment79$Perso === void 0 ? void 0 : (_$Appointment79$Perso2 = _$Appointment79$Perso[0]) === null || _$Appointment79$Perso2 === void 0 ? void 0 : _$Appointment79$Perso2.birthDay),
39288
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment80 = _.Appointment) === null || _$Appointment80 === void 0 ? void 0 : (_$Appointment80$Perso = _$Appointment80.PersonID) === null || _$Appointment80$Perso === void 0 ? void 0 : (_$Appointment80$Perso2 = _$Appointment80$Perso[0]) === null || _$Appointment80$Perso2 === void 0 ? void 0 : _$Appointment80$Perso2.gender,
39289
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter62 = _.Encounter) === null || _$Encounter62 === void 0 ? void 0 : (_$Encounter62$patient = _$Encounter62.patient_id) === null || _$Encounter62$patient === void 0 ? void 0 : (_$Encounter62$patient2 = _$Encounter62$patient[0]) === null || _$Encounter62$patient2 === void 0 ? void 0 : (_$Encounter62$patient3 = _$Encounter62$patient2.telecom) === null || _$Encounter62$patient3 === void 0 ? void 0 : (_$Encounter62$patient4 = _$Encounter62$patient3[0]) === null || _$Encounter62$patient4 === void 0 ? void 0 : _$Encounter62$patient4.value
39721
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding10 = spl.coding) === null || _spl$coding10 === void 0 ? void 0 : (_spl$coding10$ = _spl$coding10[0]) === null || _spl$coding10$ === void 0 ? void 0 : _spl$coding10$.display;
39722
+ }).join(", "),
39723
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail19 = _.practitioner_details) === null || _$practitioner_detail19 === void 0 ? void 0 : (_$practitioner_detail20 = _$practitioner_detail19[0]) === null || _$practitioner_detail20 === void 0 ? void 0 : _$practitioner_detail20.clinic) || ""
39724
+ }),
39725
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status8 = _.status) === null || _$status8 === void 0 ? void 0 : _$status8.display) || "",
39726
+ action: true
39290
39727
  };
39291
39728
  }) : [];
39292
39729
  return _context16.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -39309,7 +39746,7 @@ var GET_OTHER_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getOthe
39309
39746
  })));
39310
39747
  var GET_TODAY_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getTodayVisitsDoctor", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
39311
39748
  var payload,
39312
- _ref40,
39749
+ _ref34,
39313
39750
  rejectWithValue,
39314
39751
  _data$result17,
39315
39752
  data,
@@ -39321,7 +39758,7 @@ var GET_TODAY_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getToda
39321
39758
  switch (_context17.prev = _context17.next) {
39322
39759
  case 0:
39323
39760
  payload = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
39324
- _ref40 = _args17.length > 1 ? _args17[1] : undefined, rejectWithValue = _ref40.rejectWithValue;
39761
+ _ref34 = _args17.length > 1 ? _args17[1] : undefined, rejectWithValue = _ref34.rejectWithValue;
39325
39762
  _context17.prev = 2;
39326
39763
  _context17.next = 5;
39327
39764
  return fetchData$3({
@@ -39331,32 +39768,58 @@ var GET_TODAY_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getToda
39331
39768
  case 5:
39332
39769
  data = _context17.sent;
39333
39770
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result17 = data.result) === null || _data$result17 === void 0 ? void 0 : _data$result17.map(function (_) {
39334
- var _$appointmentId80, _$appointmentId80$, _$appointmentId80$$Pe, _$appointmentId80$$Pe2, _$appointmentId80$$Pe3, _$appointmentId80$$Pe4, _$appointmentId81, _$appointmentId81$, _$appointmentId81$$Pe, _$appointmentId81$$Pe2, _$appointmentId81$$Pe3, _$appointmentId81$$Pe4, _$patient_id28, _$patient_id28$, _$patient_id28$$name, _$patient_id29, _$patient_id29$, _$appointmentId82, _$appointmentId82$, _$appointmentId83, _$appointmentId83$, _$appointmentId84, _$appointmentId84$, _$appointmentId85, _$appointmentId85$, _$appointmentId86, _$appointmentId86$, _$visit_type10, _$appointmentId87, _$appointmentId87$, _$appointmentId87$$Sp, _$practitioner_detail19, _$practitioner_detail20, _$status11, _$Encounter$appointme17, _$Encounter63, _$Encounter63$appoint, _$Appointment81, _$Appointment81$Perso, _$Appointment81$Perso2, _$Appointment82, _$Appointment82$Perso, _$Appointment82$Perso2, _$Encounter64, _$Encounter64$patient, _$Encounter64$patient2, _$Encounter64$patient3, _$Encounter64$patient4;
39771
+ var _$appointmentId81, _$appointmentId81$, _$appointmentId81$$Pe, _$appointmentId81$$Pe2, _$appointmentId81$$Pe3, _$appointmentId81$$Pe4, _$appointmentId82, _$appointmentId82$, _$appointmentId82$$Pe, _$appointmentId82$$Pe2, _$appointmentId82$$Pe3, _$appointmentId82$$Pe4, _$patient_id25, _$patient_id25$, _$patient_id25$$name, _$appointmentId83, _$appointmentId83$, _$appointmentId83$$Pe, _$appointmentId83$$Pe2, _$patient_id26, _$patient_id26$, _$appointmentId$0$Per9, _$appointmentId84, _$appointmentId84$, _$appointmentId84$$Pe, _$appointmentId84$$Pe2, _$patient_id$0$teleco9, _$patient_id27, _$patient_id27$, _$patient_id27$$telec, _$patient_id27$$telec2, _$appointmentId85, _$appointmentId85$, _$appointmentId86, _$appointmentId86$, _$appointmentId87, _$appointmentId87$, _$appointmentId88, _$appointmentId88$, _$appointmentId89, _$appointmentId89$, _$visit_type9, _$appointmentId90, _$appointmentId90$, _$appointmentId90$$Sp, _$practitioner_detail21, _$practitioner_detail22, _$status9;
39335
39772
 
39336
39773
  return {
39337
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId80 = _.appointmentId) === null || _$appointmentId80 === void 0 ? void 0 : (_$appointmentId80$ = _$appointmentId80[0]) === null || _$appointmentId80$ === void 0 ? void 0 : (_$appointmentId80$$Pe = _$appointmentId80$.PersonID) === null || _$appointmentId80$$Pe === void 0 ? void 0 : (_$appointmentId80$$Pe2 = _$appointmentId80$$Pe[0]) === null || _$appointmentId80$$Pe2 === void 0 ? void 0 : (_$appointmentId80$$Pe3 = _$appointmentId80$$Pe2.photo) === null || _$appointmentId80$$Pe3 === void 0 ? void 0 : (_$appointmentId80$$Pe4 = _$appointmentId80$$Pe3[0]) === null || _$appointmentId80$$Pe4 === void 0 ? void 0 : _$appointmentId80$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId81 = _.appointmentId) === null || _$appointmentId81 === void 0 ? void 0 : (_$appointmentId81$ = _$appointmentId81[0]) === null || _$appointmentId81$ === void 0 ? void 0 : (_$appointmentId81$$Pe = _$appointmentId81$.PersonID) === null || _$appointmentId81$$Pe === void 0 ? void 0 : (_$appointmentId81$$Pe2 = _$appointmentId81$$Pe[0]) === null || _$appointmentId81$$Pe2 === void 0 ? void 0 : (_$appointmentId81$$Pe3 = _$appointmentId81$$Pe2.photo) === null || _$appointmentId81$$Pe3 === void 0 ? void 0 : (_$appointmentId81$$Pe4 = _$appointmentId81$$Pe3[0]) === null || _$appointmentId81$$Pe4 === void 0 ? void 0 : _$appointmentId81$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39338
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id28 = _.patient_id) === null || _$patient_id28 === void 0 ? void 0 : (_$patient_id28$ = _$patient_id28[0]) === null || _$patient_id28$ === void 0 ? void 0 : (_$patient_id28$$name = _$patient_id28$.name) === null || _$patient_id28$$name === void 0 ? void 0 : _$patient_id28$$name[0]) || {}),
39339
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id29 = _.patient_id) === null || _$patient_id29 === void 0 ? void 0 : (_$patient_id29$ = _$patient_id29[0]) === null || _$patient_id29$ === void 0 ? void 0 : _$patient_id29$.MRN) || "",
39340
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId82 = _.appointmentId) === null || _$appointmentId82 === void 0 ? void 0 : (_$appointmentId82$ = _$appointmentId82[0]) === null || _$appointmentId82$ === void 0 ? void 0 : _$appointmentId82$.appno) || "",
39341
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId83 = _.appointmentId) === null || _$appointmentId83 === void 0 ? void 0 : (_$appointmentId83$ = _$appointmentId83[0]) === null || _$appointmentId83$ === void 0 ? void 0 : _$appointmentId83$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId84 = _.appointmentId) === null || _$appointmentId84 === void 0 ? void 0 : (_$appointmentId84$ = _$appointmentId84[0]) === null || _$appointmentId84$ === void 0 ? void 0 : _$appointmentId84$.start, "DD MMM,YYYY") : "",
39342
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId85 = _.appointmentId) === null || _$appointmentId85 === void 0 ? void 0 : (_$appointmentId85$ = _$appointmentId85[0]) === null || _$appointmentId85$ === void 0 ? void 0 : _$appointmentId85$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId86 = _.appointmentId) === null || _$appointmentId86 === void 0 ? void 0 : (_$appointmentId86$ = _$appointmentId86[0]) === null || _$appointmentId86$ === void 0 ? void 0 : _$appointmentId86$.start, "hh:mm A") : "",
39343
- visitType: (_$visit_type10 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type10 !== void 0 ? _$visit_type10 : "",
39344
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId87 = _.appointmentId) === null || _$appointmentId87 === void 0 ? void 0 : (_$appointmentId87$ = _$appointmentId87[0]) === null || _$appointmentId87$ === void 0 ? void 0 : (_$appointmentId87$$Sp = _$appointmentId87$.SpecialtyID) === null || _$appointmentId87$$Sp === void 0 ? void 0 : _$appointmentId87$$Sp.map(function (spl) {
39345
- var _spl$coding17, _spl$coding17$;
39774
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId81 = _.appointmentId) === null || _$appointmentId81 === void 0 ? void 0 : (_$appointmentId81$ = _$appointmentId81[0]) === null || _$appointmentId81$ === void 0 ? void 0 : (_$appointmentId81$$Pe = _$appointmentId81$.PersonID) === null || _$appointmentId81$$Pe === void 0 ? void 0 : (_$appointmentId81$$Pe2 = _$appointmentId81$$Pe[0]) === null || _$appointmentId81$$Pe2 === void 0 ? void 0 : (_$appointmentId81$$Pe3 = _$appointmentId81$$Pe2.photo) === null || _$appointmentId81$$Pe3 === void 0 ? void 0 : (_$appointmentId81$$Pe4 = _$appointmentId81$$Pe3[0]) === null || _$appointmentId81$$Pe4 === void 0 ? void 0 : _$appointmentId81$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId82 = _.appointmentId) === null || _$appointmentId82 === void 0 ? void 0 : (_$appointmentId82$ = _$appointmentId82[0]) === null || _$appointmentId82$ === void 0 ? void 0 : (_$appointmentId82$$Pe = _$appointmentId82$.PersonID) === null || _$appointmentId82$$Pe === void 0 ? void 0 : (_$appointmentId82$$Pe2 = _$appointmentId82$$Pe[0]) === null || _$appointmentId82$$Pe2 === void 0 ? void 0 : (_$appointmentId82$$Pe3 = _$appointmentId82$$Pe2.photo) === null || _$appointmentId82$$Pe3 === void 0 ? void 0 : (_$appointmentId82$$Pe4 = _$appointmentId82$$Pe3[0]) === null || _$appointmentId82$$Pe4 === void 0 ? void 0 : _$appointmentId82$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39775
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
39776
+ // mrn: _?.patient_id?.[0]?.MRN || "",
39777
+ // refNo: _?.appointmentId?.[0]?.appno || "",
39778
+ // date: _?.appointmentId?.[0]?.start
39779
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
39780
+ // : "",
39781
+ // time: _?.appointmentId?.[0]?.start
39782
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
39783
+ // : "",
39784
+ // visitType: _?.visit_type ?? "",
39785
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
39786
+ // return spl?.coding?.[0]?.display;
39787
+ // }).join(", "),
39788
+ // clinic: _?.practitioner_details?.[0]?.clinic || "",
39789
+ // appointmentStatus: _?.status?.display || "",
39790
+ // "View Patient": true,
39791
+ // Attend: true,
39792
+ // type: "OP",
39793
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
39794
+ // data: _,
39795
+ // enId: _.id,
39796
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
39797
+ // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
39798
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
39799
+ // pId: _?.patient_id?.id,
39800
+ name: JSON.stringify({
39801
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id25 = _.patient_id) === null || _$patient_id25 === void 0 ? void 0 : (_$patient_id25$ = _$patient_id25[0]) === null || _$patient_id25$ === void 0 ? void 0 : (_$patient_id25$$name = _$patient_id25$.name) === null || _$patient_id25$$name === void 0 ? void 0 : _$patient_id25$$name[0]) || {}),
39802
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId83 = _.appointmentId) === null || _$appointmentId83 === void 0 ? void 0 : (_$appointmentId83$ = _$appointmentId83[0]) === null || _$appointmentId83$ === void 0 ? void 0 : (_$appointmentId83$$Pe = _$appointmentId83$.PersonID) === null || _$appointmentId83$$Pe === void 0 ? void 0 : (_$appointmentId83$$Pe2 = _$appointmentId83$$Pe[0]) === null || _$appointmentId83$$Pe2 === void 0 ? void 0 : _$appointmentId83$$Pe2.birthDay),
39803
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id26 = _.patient_id) === null || _$patient_id26 === void 0 ? void 0 : (_$patient_id26$ = _$patient_id26[0]) === null || _$patient_id26$ === void 0 ? void 0 : _$patient_id26$.MRN) || "",
39804
+ gender: (_$appointmentId$0$Per9 = _ === null || _ === void 0 ? void 0 : (_$appointmentId84 = _.appointmentId) === null || _$appointmentId84 === void 0 ? void 0 : (_$appointmentId84$ = _$appointmentId84[0]) === null || _$appointmentId84$ === void 0 ? void 0 : (_$appointmentId84$$Pe = _$appointmentId84$.PersonID) === null || _$appointmentId84$$Pe === void 0 ? void 0 : (_$appointmentId84$$Pe2 = _$appointmentId84$$Pe[0]) === null || _$appointmentId84$$Pe2 === void 0 ? void 0 : _$appointmentId84$$Pe2.gender) !== null && _$appointmentId$0$Per9 !== void 0 ? _$appointmentId$0$Per9 : "",
39805
+ contact: (_$patient_id$0$teleco9 = _ === null || _ === void 0 ? void 0 : (_$patient_id27 = _.patient_id) === null || _$patient_id27 === void 0 ? void 0 : (_$patient_id27$ = _$patient_id27[0]) === null || _$patient_id27$ === void 0 ? void 0 : (_$patient_id27$$telec = _$patient_id27$.telecom) === null || _$patient_id27$$telec === void 0 ? void 0 : (_$patient_id27$$telec2 = _$patient_id27$$telec[0]) === null || _$patient_id27$$telec2 === void 0 ? void 0 : _$patient_id27$$telec2.value) !== null && _$patient_id$0$teleco9 !== void 0 ? _$patient_id$0$teleco9 : ""
39806
+ }),
39807
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId85 = _.appointmentId) === null || _$appointmentId85 === void 0 ? void 0 : (_$appointmentId85$ = _$appointmentId85[0]) === null || _$appointmentId85$ === void 0 ? void 0 : _$appointmentId85$.appno) || "",
39808
+ date: JSON.stringify({
39809
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId86 = _.appointmentId) === null || _$appointmentId86 === void 0 ? void 0 : (_$appointmentId86$ = _$appointmentId86[0]) === null || _$appointmentId86$ === void 0 ? void 0 : _$appointmentId86$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId87 = _.appointmentId) === null || _$appointmentId87 === void 0 ? void 0 : (_$appointmentId87$ = _$appointmentId87[0]) === null || _$appointmentId87$ === void 0 ? void 0 : _$appointmentId87$.start, "DD MMM,YYYY") : "",
39810
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId88 = _.appointmentId) === null || _$appointmentId88 === void 0 ? void 0 : (_$appointmentId88$ = _$appointmentId88[0]) === null || _$appointmentId88$ === void 0 ? void 0 : _$appointmentId88$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId89 = _.appointmentId) === null || _$appointmentId89 === void 0 ? void 0 : (_$appointmentId89$ = _$appointmentId89[0]) === null || _$appointmentId89$ === void 0 ? void 0 : _$appointmentId89$.start, "hh:mm A") : ""
39811
+ }),
39812
+ visitType: (_$visit_type9 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type9 !== void 0 ? _$visit_type9 : "",
39813
+ speciality: JSON.stringify({
39814
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId90 = _.appointmentId) === null || _$appointmentId90 === void 0 ? void 0 : (_$appointmentId90$ = _$appointmentId90[0]) === null || _$appointmentId90$ === void 0 ? void 0 : (_$appointmentId90$$Sp = _$appointmentId90$.SpecialtyID) === null || _$appointmentId90$$Sp === void 0 ? void 0 : _$appointmentId90$$Sp.map(function (spl) {
39815
+ var _spl$coding11, _spl$coding11$;
39346
39816
 
39347
- return spl === null || spl === void 0 ? void 0 : (_spl$coding17 = spl.coding) === null || _spl$coding17 === void 0 ? void 0 : (_spl$coding17$ = _spl$coding17[0]) === null || _spl$coding17$ === void 0 ? void 0 : _spl$coding17$.display;
39348
- }).join(", "),
39349
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail19 = _.practitioner_details) === null || _$practitioner_detail19 === void 0 ? void 0 : (_$practitioner_detail20 = _$practitioner_detail19[0]) === null || _$practitioner_detail20 === void 0 ? void 0 : _$practitioner_detail20.clinic) || "",
39350
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status11 = _.status) === null || _$status11 === void 0 ? void 0 : _$status11.display) || "",
39351
- "View Patient": true,
39352
- Attend: true,
39353
- type: "OP",
39354
- appNo: (_$Encounter$appointme17 = _ === null || _ === void 0 ? void 0 : (_$Encounter63 = _.Encounter) === null || _$Encounter63 === void 0 ? void 0 : (_$Encounter63$appoint = _$Encounter63.appointmentId) === null || _$Encounter63$appoint === void 0 ? void 0 : _$Encounter63$appoint[0]) !== null && _$Encounter$appointme17 !== void 0 ? _$Encounter$appointme17 : "",
39355
- data: _,
39356
- enId: _.Encounter.id,
39357
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment81 = _.Appointment) === null || _$Appointment81 === void 0 ? void 0 : (_$Appointment81$Perso = _$Appointment81.PersonID) === null || _$Appointment81$Perso === void 0 ? void 0 : (_$Appointment81$Perso2 = _$Appointment81$Perso[0]) === null || _$Appointment81$Perso2 === void 0 ? void 0 : _$Appointment81$Perso2.birthDay),
39358
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment82 = _.Appointment) === null || _$Appointment82 === void 0 ? void 0 : (_$Appointment82$Perso = _$Appointment82.PersonID) === null || _$Appointment82$Perso === void 0 ? void 0 : (_$Appointment82$Perso2 = _$Appointment82$Perso[0]) === null || _$Appointment82$Perso2 === void 0 ? void 0 : _$Appointment82$Perso2.gender,
39359
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter64 = _.Encounter) === null || _$Encounter64 === void 0 ? void 0 : (_$Encounter64$patient = _$Encounter64.patient_id) === null || _$Encounter64$patient === void 0 ? void 0 : (_$Encounter64$patient2 = _$Encounter64$patient[0]) === null || _$Encounter64$patient2 === void 0 ? void 0 : (_$Encounter64$patient3 = _$Encounter64$patient2.telecom) === null || _$Encounter64$patient3 === void 0 ? void 0 : (_$Encounter64$patient4 = _$Encounter64$patient3[0]) === null || _$Encounter64$patient4 === void 0 ? void 0 : _$Encounter64$patient4.value
39817
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding11 = spl.coding) === null || _spl$coding11 === void 0 ? void 0 : (_spl$coding11$ = _spl$coding11[0]) === null || _spl$coding11$ === void 0 ? void 0 : _spl$coding11$.display;
39818
+ }).join(", "),
39819
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail21 = _.practitioner_details) === null || _$practitioner_detail21 === void 0 ? void 0 : (_$practitioner_detail22 = _$practitioner_detail21[0]) === null || _$practitioner_detail22 === void 0 ? void 0 : _$practitioner_detail22.clinic) || ""
39820
+ }),
39821
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status9 = _.status) === null || _$status9 === void 0 ? void 0 : _$status9.display) || "",
39822
+ action: true
39360
39823
  };
39361
39824
  }) : [];
39362
39825
  return _context17.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -39379,7 +39842,7 @@ var GET_TODAY_VISITS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getToda
39379
39842
  })));
39380
39843
  var GET_WALK_INS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getWalkInsDoctor", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() {
39381
39844
  var payload,
39382
- _ref42,
39845
+ _ref36,
39383
39846
  rejectWithValue,
39384
39847
  _data$result18,
39385
39848
  data,
@@ -39391,7 +39854,7 @@ var GET_WALK_INS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getWalkInsD
39391
39854
  switch (_context18.prev = _context18.next) {
39392
39855
  case 0:
39393
39856
  payload = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
39394
- _ref42 = _args18.length > 1 ? _args18[1] : undefined, rejectWithValue = _ref42.rejectWithValue;
39857
+ _ref36 = _args18.length > 1 ? _args18[1] : undefined, rejectWithValue = _ref36.rejectWithValue;
39395
39858
  _context18.prev = 2;
39396
39859
  _context18.next = 5;
39397
39860
  return fetchData$3({
@@ -39401,32 +39864,58 @@ var GET_WALK_INS_DOCTOR = createAsyncThunk("appointmentStatsApiSlice/getWalkInsD
39401
39864
  case 5:
39402
39865
  data = _context18.sent;
39403
39866
  returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result18 = data.result) === null || _data$result18 === void 0 ? void 0 : _data$result18.map(function (_) {
39404
- var _$appointmentId88, _$appointmentId88$, _$appointmentId88$$Pe, _$appointmentId88$$Pe2, _$appointmentId88$$Pe3, _$appointmentId88$$Pe4, _$appointmentId89, _$appointmentId89$, _$appointmentId89$$Pe, _$appointmentId89$$Pe2, _$appointmentId89$$Pe3, _$appointmentId89$$Pe4, _$patient_id30, _$patient_id30$, _$patient_id30$$name, _$patient_id31, _$patient_id31$, _$appointmentId90, _$appointmentId90$, _$appointmentId91, _$appointmentId91$, _$appointmentId92, _$appointmentId92$, _$appointmentId93, _$appointmentId93$, _$appointmentId94, _$appointmentId94$, _$visit_type11, _$appointmentId95, _$appointmentId95$, _$appointmentId95$$Sp, _$practitioner_detail21, _$practitioner_detail22, _$status12, _$Encounter$appointme18, _$Encounter65, _$Encounter65$appoint, _$Appointment83, _$Appointment83$Perso, _$Appointment83$Perso2, _$Appointment84, _$Appointment84$Perso, _$Appointment84$Perso2, _$Encounter66, _$Encounter66$patient, _$Encounter66$patient2, _$Encounter66$patient3, _$Encounter66$patient4;
39867
+ var _$appointmentId91, _$appointmentId91$, _$appointmentId91$$Pe, _$appointmentId91$$Pe2, _$appointmentId91$$Pe3, _$appointmentId91$$Pe4, _$appointmentId92, _$appointmentId92$, _$appointmentId92$$Pe, _$appointmentId92$$Pe2, _$appointmentId92$$Pe3, _$appointmentId92$$Pe4, _$patient_id28, _$patient_id28$, _$patient_id28$$name, _$appointmentId93, _$appointmentId93$, _$appointmentId93$$Pe, _$appointmentId93$$Pe2, _$patient_id29, _$patient_id29$, _$appointmentId$0$Per10, _$appointmentId94, _$appointmentId94$, _$appointmentId94$$Pe, _$appointmentId94$$Pe2, _$patient_id$0$teleco10, _$patient_id30, _$patient_id30$, _$patient_id30$$telec, _$patient_id30$$telec2, _$appointmentId95, _$appointmentId95$, _$appointmentId96, _$appointmentId96$, _$appointmentId97, _$appointmentId97$, _$appointmentId98, _$appointmentId98$, _$appointmentId99, _$appointmentId99$, _$visit_type10, _$appointmentId100, _$appointmentId100$, _$appointmentId100$$S, _$practitioner_detail23, _$practitioner_detail24, _$status10;
39405
39868
 
39406
39869
  return {
39407
- img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId88 = _.appointmentId) === null || _$appointmentId88 === void 0 ? void 0 : (_$appointmentId88$ = _$appointmentId88[0]) === null || _$appointmentId88$ === void 0 ? void 0 : (_$appointmentId88$$Pe = _$appointmentId88$.PersonID) === null || _$appointmentId88$$Pe === void 0 ? void 0 : (_$appointmentId88$$Pe2 = _$appointmentId88$$Pe[0]) === null || _$appointmentId88$$Pe2 === void 0 ? void 0 : (_$appointmentId88$$Pe3 = _$appointmentId88$$Pe2.photo) === null || _$appointmentId88$$Pe3 === void 0 ? void 0 : (_$appointmentId88$$Pe4 = _$appointmentId88$$Pe3[0]) === null || _$appointmentId88$$Pe4 === void 0 ? void 0 : _$appointmentId88$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId89 = _.appointmentId) === null || _$appointmentId89 === void 0 ? void 0 : (_$appointmentId89$ = _$appointmentId89[0]) === null || _$appointmentId89$ === void 0 ? void 0 : (_$appointmentId89$$Pe = _$appointmentId89$.PersonID) === null || _$appointmentId89$$Pe === void 0 ? void 0 : (_$appointmentId89$$Pe2 = _$appointmentId89$$Pe[0]) === null || _$appointmentId89$$Pe2 === void 0 ? void 0 : (_$appointmentId89$$Pe3 = _$appointmentId89$$Pe2.photo) === null || _$appointmentId89$$Pe3 === void 0 ? void 0 : (_$appointmentId89$$Pe4 = _$appointmentId89$$Pe3[0]) === null || _$appointmentId89$$Pe4 === void 0 ? void 0 : _$appointmentId89$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39408
- name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id30 = _.patient_id) === null || _$patient_id30 === void 0 ? void 0 : (_$patient_id30$ = _$patient_id30[0]) === null || _$patient_id30$ === void 0 ? void 0 : (_$patient_id30$$name = _$patient_id30$.name) === null || _$patient_id30$$name === void 0 ? void 0 : _$patient_id30$$name[0]) || {}),
39409
- mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id31 = _.patient_id) === null || _$patient_id31 === void 0 ? void 0 : (_$patient_id31$ = _$patient_id31[0]) === null || _$patient_id31$ === void 0 ? void 0 : _$patient_id31$.MRN) || "",
39410
- refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId90 = _.appointmentId) === null || _$appointmentId90 === void 0 ? void 0 : (_$appointmentId90$ = _$appointmentId90[0]) === null || _$appointmentId90$ === void 0 ? void 0 : _$appointmentId90$.appno) || "",
39411
- date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId91 = _.appointmentId) === null || _$appointmentId91 === void 0 ? void 0 : (_$appointmentId91$ = _$appointmentId91[0]) === null || _$appointmentId91$ === void 0 ? void 0 : _$appointmentId91$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId92 = _.appointmentId) === null || _$appointmentId92 === void 0 ? void 0 : (_$appointmentId92$ = _$appointmentId92[0]) === null || _$appointmentId92$ === void 0 ? void 0 : _$appointmentId92$.start, "DD MMM,YYYY") : "",
39412
- time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId93 = _.appointmentId) === null || _$appointmentId93 === void 0 ? void 0 : (_$appointmentId93$ = _$appointmentId93[0]) === null || _$appointmentId93$ === void 0 ? void 0 : _$appointmentId93$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId94 = _.appointmentId) === null || _$appointmentId94 === void 0 ? void 0 : (_$appointmentId94$ = _$appointmentId94[0]) === null || _$appointmentId94$ === void 0 ? void 0 : _$appointmentId94$.start, "hh:mm A") : "",
39413
- visitType: (_$visit_type11 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type11 !== void 0 ? _$visit_type11 : "",
39414
- speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId95 = _.appointmentId) === null || _$appointmentId95 === void 0 ? void 0 : (_$appointmentId95$ = _$appointmentId95[0]) === null || _$appointmentId95$ === void 0 ? void 0 : (_$appointmentId95$$Sp = _$appointmentId95$.SpecialtyID) === null || _$appointmentId95$$Sp === void 0 ? void 0 : _$appointmentId95$$Sp.map(function (spl) {
39415
- var _spl$coding18, _spl$coding18$;
39416
-
39417
- return spl === null || spl === void 0 ? void 0 : (_spl$coding18 = spl.coding) === null || _spl$coding18 === void 0 ? void 0 : (_spl$coding18$ = _spl$coding18[0]) === null || _spl$coding18$ === void 0 ? void 0 : _spl$coding18$.display;
39418
- }).join(", "),
39419
- clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail21 = _.practitioner_details) === null || _$practitioner_detail21 === void 0 ? void 0 : (_$practitioner_detail22 = _$practitioner_detail21[0]) === null || _$practitioner_detail22 === void 0 ? void 0 : _$practitioner_detail22.clinic) || "",
39420
- appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status12 = _.status) === null || _$status12 === void 0 ? void 0 : _$status12.display) || "",
39421
- "View Patient": true,
39422
- Attend: true,
39423
- type: "OP",
39424
- appNo: (_$Encounter$appointme18 = _ === null || _ === void 0 ? void 0 : (_$Encounter65 = _.Encounter) === null || _$Encounter65 === void 0 ? void 0 : (_$Encounter65$appoint = _$Encounter65.appointmentId) === null || _$Encounter65$appoint === void 0 ? void 0 : _$Encounter65$appoint[0]) !== null && _$Encounter$appointme18 !== void 0 ? _$Encounter$appointme18 : "",
39425
- data: _,
39426
- enId: _.Encounter.id,
39427
- age: getAge(_ === null || _ === void 0 ? void 0 : (_$Appointment83 = _.Appointment) === null || _$Appointment83 === void 0 ? void 0 : (_$Appointment83$Perso = _$Appointment83.PersonID) === null || _$Appointment83$Perso === void 0 ? void 0 : (_$Appointment83$Perso2 = _$Appointment83$Perso[0]) === null || _$Appointment83$Perso2 === void 0 ? void 0 : _$Appointment83$Perso2.birthDay),
39428
- gender: _ === null || _ === void 0 ? void 0 : (_$Appointment84 = _.Appointment) === null || _$Appointment84 === void 0 ? void 0 : (_$Appointment84$Perso = _$Appointment84.PersonID) === null || _$Appointment84$Perso === void 0 ? void 0 : (_$Appointment84$Perso2 = _$Appointment84$Perso[0]) === null || _$Appointment84$Perso2 === void 0 ? void 0 : _$Appointment84$Perso2.gender,
39429
- contact: _ === null || _ === void 0 ? void 0 : (_$Encounter66 = _.Encounter) === null || _$Encounter66 === void 0 ? void 0 : (_$Encounter66$patient = _$Encounter66.patient_id) === null || _$Encounter66$patient === void 0 ? void 0 : (_$Encounter66$patient2 = _$Encounter66$patient[0]) === null || _$Encounter66$patient2 === void 0 ? void 0 : (_$Encounter66$patient3 = _$Encounter66$patient2.telecom) === null || _$Encounter66$patient3 === void 0 ? void 0 : (_$Encounter66$patient4 = _$Encounter66$patient3[0]) === null || _$Encounter66$patient4 === void 0 ? void 0 : _$Encounter66$patient4.value
39870
+ img: (_ === null || _ === void 0 ? void 0 : (_$appointmentId91 = _.appointmentId) === null || _$appointmentId91 === void 0 ? void 0 : (_$appointmentId91$ = _$appointmentId91[0]) === null || _$appointmentId91$ === void 0 ? void 0 : (_$appointmentId91$$Pe = _$appointmentId91$.PersonID) === null || _$appointmentId91$$Pe === void 0 ? void 0 : (_$appointmentId91$$Pe2 = _$appointmentId91$$Pe[0]) === null || _$appointmentId91$$Pe2 === void 0 ? void 0 : (_$appointmentId91$$Pe3 = _$appointmentId91$$Pe2.photo) === null || _$appointmentId91$$Pe3 === void 0 ? void 0 : (_$appointmentId91$$Pe4 = _$appointmentId91$$Pe3[0]) === null || _$appointmentId91$$Pe4 === void 0 ? void 0 : _$appointmentId91$$Pe4.fileid) ? getImgUrl(_ === null || _ === void 0 ? void 0 : (_$appointmentId92 = _.appointmentId) === null || _$appointmentId92 === void 0 ? void 0 : (_$appointmentId92$ = _$appointmentId92[0]) === null || _$appointmentId92$ === void 0 ? void 0 : (_$appointmentId92$$Pe = _$appointmentId92$.PersonID) === null || _$appointmentId92$$Pe === void 0 ? void 0 : (_$appointmentId92$$Pe2 = _$appointmentId92$$Pe[0]) === null || _$appointmentId92$$Pe2 === void 0 ? void 0 : (_$appointmentId92$$Pe3 = _$appointmentId92$$Pe2.photo) === null || _$appointmentId92$$Pe3 === void 0 ? void 0 : (_$appointmentId92$$Pe4 = _$appointmentId92$$Pe3[0]) === null || _$appointmentId92$$Pe4 === void 0 ? void 0 : _$appointmentId92$$Pe4.fileid) : "https://worthingtonmotorcycles.com.au/wp-content/uploads/2017/06/tlc-perth-user-icon-im2.png",
39871
+ // name: makeName(_?.patient_id?.[0]?.name?.[0] || {}),
39872
+ // mrn: _?.patient_id?.[0]?.MRN || "",
39873
+ // refNo: _?.appointmentId?.[0]?.appno || "",
39874
+ // date: _?.appointmentId?.[0]?.start
39875
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "DD MMM,YYYY")
39876
+ // : "",
39877
+ // time: _?.appointmentId?.[0]?.start
39878
+ // ? utcTOLocal(_?.appointmentId?.[0]?.start, "hh:mm A")
39879
+ // : "",
39880
+ // visitType: _?.visit_type ?? "",
39881
+ // speciality: _?.appointmentId?.[0]?.SpecialtyID?.map((spl) => {
39882
+ // return spl?.coding?.[0]?.display;
39883
+ // }).join(", "),
39884
+ // clinic: _?.practitioner_details?.[0]?.clinic || "",
39885
+ // appointmentStatus: _?.status?.display || "",
39886
+ // "View Patient": true,
39887
+ // Attend: true,
39888
+ // type: "OP",
39889
+ // appNo: _?.appointmentId?.[0]?.id ?? '',
39890
+ // data: _,
39891
+ // enId: _.id,
39892
+ // age: getAge(_?.appointmentId?.[0]?.PersonID?.[0]?.birthDay),
39893
+ // gender: _?.appointmentId?.[0]?.PersonID?.[0]?.gender,
39894
+ // contact: _?.patient_id?.[0]?.telecom?.[0]?.value ?? "",
39895
+ // pId: _?.patient_id?.id,
39896
+ name: JSON.stringify({
39897
+ name: makeName((_ === null || _ === void 0 ? void 0 : (_$patient_id28 = _.patient_id) === null || _$patient_id28 === void 0 ? void 0 : (_$patient_id28$ = _$patient_id28[0]) === null || _$patient_id28$ === void 0 ? void 0 : (_$patient_id28$$name = _$patient_id28$.name) === null || _$patient_id28$$name === void 0 ? void 0 : _$patient_id28$$name[0]) || {}),
39898
+ age: getAge(_ === null || _ === void 0 ? void 0 : (_$appointmentId93 = _.appointmentId) === null || _$appointmentId93 === void 0 ? void 0 : (_$appointmentId93$ = _$appointmentId93[0]) === null || _$appointmentId93$ === void 0 ? void 0 : (_$appointmentId93$$Pe = _$appointmentId93$.PersonID) === null || _$appointmentId93$$Pe === void 0 ? void 0 : (_$appointmentId93$$Pe2 = _$appointmentId93$$Pe[0]) === null || _$appointmentId93$$Pe2 === void 0 ? void 0 : _$appointmentId93$$Pe2.birthDay),
39899
+ mrn: (_ === null || _ === void 0 ? void 0 : (_$patient_id29 = _.patient_id) === null || _$patient_id29 === void 0 ? void 0 : (_$patient_id29$ = _$patient_id29[0]) === null || _$patient_id29$ === void 0 ? void 0 : _$patient_id29$.MRN) || "",
39900
+ gender: (_$appointmentId$0$Per10 = _ === null || _ === void 0 ? void 0 : (_$appointmentId94 = _.appointmentId) === null || _$appointmentId94 === void 0 ? void 0 : (_$appointmentId94$ = _$appointmentId94[0]) === null || _$appointmentId94$ === void 0 ? void 0 : (_$appointmentId94$$Pe = _$appointmentId94$.PersonID) === null || _$appointmentId94$$Pe === void 0 ? void 0 : (_$appointmentId94$$Pe2 = _$appointmentId94$$Pe[0]) === null || _$appointmentId94$$Pe2 === void 0 ? void 0 : _$appointmentId94$$Pe2.gender) !== null && _$appointmentId$0$Per10 !== void 0 ? _$appointmentId$0$Per10 : "",
39901
+ contact: (_$patient_id$0$teleco10 = _ === null || _ === void 0 ? void 0 : (_$patient_id30 = _.patient_id) === null || _$patient_id30 === void 0 ? void 0 : (_$patient_id30$ = _$patient_id30[0]) === null || _$patient_id30$ === void 0 ? void 0 : (_$patient_id30$$telec = _$patient_id30$.telecom) === null || _$patient_id30$$telec === void 0 ? void 0 : (_$patient_id30$$telec2 = _$patient_id30$$telec[0]) === null || _$patient_id30$$telec2 === void 0 ? void 0 : _$patient_id30$$telec2.value) !== null && _$patient_id$0$teleco10 !== void 0 ? _$patient_id$0$teleco10 : ""
39902
+ }),
39903
+ refNo: (_ === null || _ === void 0 ? void 0 : (_$appointmentId95 = _.appointmentId) === null || _$appointmentId95 === void 0 ? void 0 : (_$appointmentId95$ = _$appointmentId95[0]) === null || _$appointmentId95$ === void 0 ? void 0 : _$appointmentId95$.appno) || "",
39904
+ date: JSON.stringify({
39905
+ date: (_ === null || _ === void 0 ? void 0 : (_$appointmentId96 = _.appointmentId) === null || _$appointmentId96 === void 0 ? void 0 : (_$appointmentId96$ = _$appointmentId96[0]) === null || _$appointmentId96$ === void 0 ? void 0 : _$appointmentId96$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId97 = _.appointmentId) === null || _$appointmentId97 === void 0 ? void 0 : (_$appointmentId97$ = _$appointmentId97[0]) === null || _$appointmentId97$ === void 0 ? void 0 : _$appointmentId97$.start, "DD MMM,YYYY") : "",
39906
+ time: (_ === null || _ === void 0 ? void 0 : (_$appointmentId98 = _.appointmentId) === null || _$appointmentId98 === void 0 ? void 0 : (_$appointmentId98$ = _$appointmentId98[0]) === null || _$appointmentId98$ === void 0 ? void 0 : _$appointmentId98$.start) ? utcTOLocal$1(_ === null || _ === void 0 ? void 0 : (_$appointmentId99 = _.appointmentId) === null || _$appointmentId99 === void 0 ? void 0 : (_$appointmentId99$ = _$appointmentId99[0]) === null || _$appointmentId99$ === void 0 ? void 0 : _$appointmentId99$.start, "hh:mm A") : ""
39907
+ }),
39908
+ visitType: (_$visit_type10 = _ === null || _ === void 0 ? void 0 : _.visit_type) !== null && _$visit_type10 !== void 0 ? _$visit_type10 : "",
39909
+ speciality: JSON.stringify({
39910
+ speciality: _ === null || _ === void 0 ? void 0 : (_$appointmentId100 = _.appointmentId) === null || _$appointmentId100 === void 0 ? void 0 : (_$appointmentId100$ = _$appointmentId100[0]) === null || _$appointmentId100$ === void 0 ? void 0 : (_$appointmentId100$$S = _$appointmentId100$.SpecialtyID) === null || _$appointmentId100$$S === void 0 ? void 0 : _$appointmentId100$$S.map(function (spl) {
39911
+ var _spl$coding12, _spl$coding12$;
39912
+
39913
+ return spl === null || spl === void 0 ? void 0 : (_spl$coding12 = spl.coding) === null || _spl$coding12 === void 0 ? void 0 : (_spl$coding12$ = _spl$coding12[0]) === null || _spl$coding12$ === void 0 ? void 0 : _spl$coding12$.display;
39914
+ }).join(", "),
39915
+ clinic: (_ === null || _ === void 0 ? void 0 : (_$practitioner_detail23 = _.practitioner_details) === null || _$practitioner_detail23 === void 0 ? void 0 : (_$practitioner_detail24 = _$practitioner_detail23[0]) === null || _$practitioner_detail24 === void 0 ? void 0 : _$practitioner_detail24.clinic) || ""
39916
+ }),
39917
+ appointmentStatus: (_ === null || _ === void 0 ? void 0 : (_$status10 = _.status) === null || _$status10 === void 0 ? void 0 : _$status10.display) || "",
39918
+ action: true
39430
39919
  };
39431
39920
  }) : [];
39432
39921
  return _context18.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {