primary_care_admin_binder 0.1.7 → 0.1.8

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 +263 -215
  2. package/package.json +3 -2
package/dist/index.cjs.js CHANGED
@@ -2273,143 +2273,6 @@ var __keyClockblockappointment__ = "".concat(process.env.REACT_APP_KEY_CLOCK_API
2273
2273
  var refreshOrgToken = "".concat(__nifiUrl__, "/api/v1/refreshOrgAuthToken");
2274
2274
  var refreshUserToken = "".concat(__nifiUrl__, "/api/v1/refreshAuthToken");
2275
2275
 
2276
- var fetchData = /*#__PURE__*/function () {
2277
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(input) {
2278
- var url,
2279
- __options,
2280
- res,
2281
- data,
2282
- _args = arguments;
2283
-
2284
- return regeneratorRuntime.wrap(function _callee$(_context) {
2285
- while (1) {
2286
- switch (_context.prev = _context.next) {
2287
- case 0:
2288
- url = _args.length > 1 && _args[1] !== undefined ? _args[1] : __baseUrl__;
2289
- __options = {
2290
- method: "POST",
2291
- headers: {
2292
- "Content-Type": "application/json"
2293
- },
2294
- body: {}
2295
- };
2296
- _context.next = 4;
2297
- return fetch(url, _objectSpread2(_objectSpread2({}, __options), input));
2298
-
2299
- case 4:
2300
- res = _context.sent;
2301
- _context.next = 7;
2302
- return res.json();
2303
-
2304
- case 7:
2305
- data = _context.sent;
2306
- return _context.abrupt("return", data);
2307
-
2308
- case 9:
2309
- case "end":
2310
- return _context.stop();
2311
- }
2312
- }
2313
- }, _callee);
2314
- }));
2315
-
2316
- return function fetchData(_x) {
2317
- return _ref3.apply(this, arguments);
2318
- };
2319
- }();
2320
-
2321
- var queries$n = {
2322
- rolelist: function rolelist(type) {
2323
- return {
2324
- db_name: dbName,
2325
- entity: "CodeableConceptMaster",
2326
- filter: "CodeableConceptMaster.Type=='".concat(type, "'"),
2327
- return_fields: "MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})"
2328
- };
2329
- },
2330
- upsert: function upsert(data) {
2331
- var filter = {};
2332
- var _key = {};
2333
-
2334
- if (data._key) {
2335
- filter = {
2336
- filter: {
2337
- _key: data._key
2338
- }
2339
- };
2340
- }
2341
-
2342
- if (data !== null && data !== void 0 && data.coding_key) {
2343
- _key = {
2344
- _key: data === null || data === void 0 ? void 0 : data.coding_key
2345
- };
2346
- }
2347
-
2348
- if (data.id) {
2349
- ({
2350
- id: data.id
2351
- });
2352
- }
2353
-
2354
- return [_objectSpread2(_objectSpread2({
2355
- db_name: "primarycare",
2356
- entity: "CodeableConceptMaster",
2357
- is_metadata: true,
2358
- metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd"
2359
- }, filter), {}, {
2360
- doc: {
2361
- text: "",
2362
- _id: "",
2363
- id: 0,
2364
- coding: [_objectSpread2({
2365
- system: "",
2366
- version: "1",
2367
- code: data.code,
2368
- display: data.description,
2369
- userSelected: true,
2370
- Type: data.type,
2371
- id: data.id,
2372
- status: data.status
2373
- }, _key)],
2374
- Type: data.type,
2375
- status: data.status
2376
- }
2377
- })];
2378
- },
2379
- practitioner_by_id: function practitioner_by_id(id) {
2380
- return {
2381
- db_name: dbName,
2382
- entity: "Practitioner",
2383
- filter: "Practitioner._key=='".concat(id, "' && Practitioner.activestatus==true"),
2384
- return_fields: "merge(Practitioner,{identifier:(for doc in IdentifierMaster filter doc._id in Practitioner.identifier return merge(doc,{period:(for cod in doc.period return document(cod))})),address:(for a in Practitioner.address return document(a)),communication:( FOR cod IN CodeableConceptMaster filter cod._id in Practitioner.communication RETURN MERGE(cod,{coding:(FOR d IN cod.coding RETURN DOCUMENT(d))})),marital_status:(FOR cod IN CodeableConceptMaster filter cod._id==Practitioner.marital_status RETURN MERGE(cod,{coding:(FOR d IN cod.coding RETURN DOCUMENT(d))})),name:(for a in Practitioner.name return document(a)),nationality:(FOR cod IN SMGeographicMaster filter cod._id==Practitioner.nationality RETURN cod),photo:(for a in Practitioner.photo return document(a)),position:(for pt in CodeableConceptMaster filter pt._id==Practitioner.position return merge(pt,{coding:(FOR d IN pt.coding RETURN DOCUMENT(d))})),practitioner_type:(for pt in CodeableConceptMaster filter pt._id==Practitioner.practitioner_type return merge(pt,{coding:(FOR d IN pt.coding RETURN DOCUMENT(d))})),telecom:(for a in Practitioner.telecom return document(a)),job_experience:(for c in Practitioner.job_experience RETURN merge(c,{jobexperience_contact_details:(for con in c.jobexperience_contact_details return document(con)), jobexperience_address:(for add in c.jobexperience_address return document(add))})),training_details:(for c in Practitioner.training_details RETURN merge(c,{training_contact_details:(for con in c.training_contact_details return document(con)), training_address:(for add in c.training_address return document(add))})),practitioner_role:(for doc in PractitionerRole filter doc._id IN Practitioner.practitioner_role return MERGE(doc,{telecom:(for rol in ContactPointMaster filter rol._id in doc.telecom return rol),role:(for cod in CodeableConceptMaster filter cod._id==doc.role return merge(cod,{coding:(for code in CodingMaster filter code._id in cod.coding return code)})),period:(for per in periodMaster filter per._id in doc.period return per)})),gender:(FOR cod IN CodeableConceptMaster filter cod._id==Practitioner.gender RETURN MERGE(cod,{coding:(FOR d IN cod.coding RETURN DOCUMENT(d))})),employee_status:(for pt in CodeableConceptMaster filter pt._id==Practitioner.employee_status return merge(pt,{coding:(FOR d IN pt.coding RETURN DOCUMENT(d))}))})"
2385
- };
2386
- },
2387
- practitioner_list: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"Practitioner\",\n \"sort\":\"Practitioner.createddate\",\n \"filter\": \"Practitioner.activestatus==true\",\n \"return_fields\": \"{id:Practitioner.id,name:(FOR nam IN TO_ARRAY(Practitioner.name) RETURN DOCUMENT(nam).text)[0],type: (for t in CodeableConceptMaster filter t._id == Practitioner.practitioner_type return merge(t,{coding:(for cod in CodingMaster filter cod._id in t.coding return cod.display)})),_key:Practitioner._key,status:Practitioner.status,Practitionerrole:(for pr in PractitionerRole filter pr._id in Practitioner.practitioner_role && pr.primary_specialty==true return merge(pr,{SpecialtyID:(for spe in CodeableConceptMaster filter spe._id ==pr.SpecialtyID return merge(spe,{coding:(for cod in CodingMaster filter cod._id in spe.coding return cod.display)}))}))}\"\n }"),
2388
- status_update_practitioner: function status_update_practitioner(data) {
2389
- return [{
2390
- db_name: dbName,
2391
- entity: "Practitioner",
2392
- filter: {
2393
- _key: data._key
2394
- },
2395
- is_metadata: true,
2396
- metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd",
2397
- doc: {
2398
- status: data.status
2399
- }
2400
- }];
2401
- },
2402
- get_entity_by_id: function get_entity_by_id(id) {
2403
- return {
2404
- "db_name": dbName,
2405
- "entity": "Organization",
2406
- "sort": "Organization.name",
2407
- "filter": "Organization.activestatus==true && Organization.OrgType any =='".concat(id, "'"),
2408
- "return_fields": "{_id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,alias:Organization.alias}"
2409
- };
2410
- }
2411
- };
2412
-
2413
2276
  var moment = createCommonjsModule(function (module, exports) {
2414
2277
  (function (global, factory) {
2415
2278
  module.exports = factory() ;
@@ -8074,6 +7937,186 @@ var moment = createCommonjsModule(function (module, exports) {
8074
7937
  })));
8075
7938
  });
8076
7939
 
7940
+ var fetchData = /*#__PURE__*/function () {
7941
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(input) {
7942
+ var url,
7943
+ __options,
7944
+ res,
7945
+ data,
7946
+ _args = arguments;
7947
+
7948
+ return regeneratorRuntime.wrap(function _callee$(_context) {
7949
+ while (1) {
7950
+ switch (_context.prev = _context.next) {
7951
+ case 0:
7952
+ url = _args.length > 1 && _args[1] !== undefined ? _args[1] : __baseUrl__;
7953
+ __options = {
7954
+ method: "POST",
7955
+ headers: {
7956
+ "Content-Type": "application/json"
7957
+ },
7958
+ body: {}
7959
+ };
7960
+ _context.next = 4;
7961
+ return fetch(url, _objectSpread2(_objectSpread2({}, __options), input));
7962
+
7963
+ case 4:
7964
+ res = _context.sent;
7965
+ _context.next = 7;
7966
+ return res.json();
7967
+
7968
+ case 7:
7969
+ data = _context.sent;
7970
+ return _context.abrupt("return", data);
7971
+
7972
+ case 9:
7973
+ case "end":
7974
+ return _context.stop();
7975
+ }
7976
+ }
7977
+ }, _callee);
7978
+ }));
7979
+
7980
+ return function fetchData(_x) {
7981
+ return _ref3.apply(this, arguments);
7982
+ };
7983
+ }();
7984
+
7985
+ var makeName = function makeName() {
7986
+ var _prefix$coding, _prefix$coding$, _suffix$coding, _suffix$coding$;
7987
+
7988
+ var nameObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7989
+ var _nameObj$prefix = nameObj.prefix,
7990
+ prefix = _nameObj$prefix === void 0 ? "" : _nameObj$prefix,
7991
+ _nameObj$given = nameObj.given,
7992
+ given = _nameObj$given === void 0 ? "" : _nameObj$given,
7993
+ _nameObj$text = nameObj.text,
7994
+ text = _nameObj$text === void 0 ? "" : _nameObj$text,
7995
+ _nameObj$suffix = nameObj.suffix,
7996
+ suffix = _nameObj$suffix === void 0 ? "" : _nameObj$suffix;
7997
+ var prefixVal = (prefix === null || prefix === void 0 ? void 0 : (_prefix$coding = prefix.coding) === null || _prefix$coding === void 0 ? void 0 : (_prefix$coding$ = _prefix$coding[0]) === null || _prefix$coding$ === void 0 ? void 0 : _prefix$coding$.display) || "";
7998
+ var suffixVal = (suffix === null || suffix === void 0 ? void 0 : (_suffix$coding = suffix.coding) === null || _suffix$coding === void 0 ? void 0 : (_suffix$coding$ = _suffix$coding[0]) === null || _suffix$coding$ === void 0 ? void 0 : _suffix$coding$.display) || "";
7999
+ return "".concat(prefixVal && prefixVal + ".").concat(text && text + " ").concat(given && given + " ").concat(suffixVal && suffixVal);
8000
+ };
8001
+
8002
+ var getUtcTime = function getUtcTime(date) {
8003
+ if (date) {
8004
+ return moment.utc(date).unix();
8005
+ } else {
8006
+ return moment.utc().unix();
8007
+ }
8008
+ };
8009
+
8010
+ var utcTOLocal = function utcTOLocal(date, format) {
8011
+ var Ndate = new Date();
8012
+
8013
+ if (typeof date === "number") {
8014
+ Ndate = moment.unix(date);
8015
+ } else {
8016
+ Ndate = moment(date);
8017
+ }
8018
+
8019
+ var fmt = format ? format : "DD-MM-YYYY";
8020
+
8021
+ if (format) {
8022
+ return moment.utc(Ndate).local().format(fmt);
8023
+ } else {
8024
+ return moment.utc(Ndate).local();
8025
+ }
8026
+ };
8027
+
8028
+ var queries$n = {
8029
+ rolelist: function rolelist(type) {
8030
+ return {
8031
+ db_name: dbName,
8032
+ entity: "CodeableConceptMaster",
8033
+ filter: "CodeableConceptMaster.Type=='".concat(type, "'"),
8034
+ return_fields: "MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})"
8035
+ };
8036
+ },
8037
+ upsert: function upsert(data) {
8038
+ var filter = {};
8039
+ var _key = {};
8040
+
8041
+ if (data._key) {
8042
+ filter = {
8043
+ filter: {
8044
+ _key: data._key
8045
+ }
8046
+ };
8047
+ }
8048
+
8049
+ if (data !== null && data !== void 0 && data.coding_key) {
8050
+ _key = {
8051
+ _key: data === null || data === void 0 ? void 0 : data.coding_key
8052
+ };
8053
+ }
8054
+
8055
+ if (data.id) {
8056
+ ({
8057
+ id: data.id
8058
+ });
8059
+ }
8060
+
8061
+ return [_objectSpread2(_objectSpread2({
8062
+ db_name: "primarycare",
8063
+ entity: "CodeableConceptMaster",
8064
+ is_metadata: true,
8065
+ metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd"
8066
+ }, filter), {}, {
8067
+ doc: {
8068
+ text: "",
8069
+ _id: "",
8070
+ id: 0,
8071
+ coding: [_objectSpread2({
8072
+ system: "",
8073
+ version: "1",
8074
+ code: data.code,
8075
+ display: data.description,
8076
+ userSelected: true,
8077
+ Type: data.type,
8078
+ id: data.id,
8079
+ status: data.status
8080
+ }, _key)],
8081
+ Type: data.type,
8082
+ status: data.status
8083
+ }
8084
+ })];
8085
+ },
8086
+ practitioner_by_id: function practitioner_by_id(id) {
8087
+ return {
8088
+ db_name: dbName,
8089
+ entity: "Practitioner",
8090
+ filter: "Practitioner._key=='".concat(id, "' && Practitioner.activestatus==true"),
8091
+ return_fields: "merge(Practitioner,{identifier:(for doc in IdentifierMaster filter doc._id in Practitioner.identifier return merge(doc,{period:(for cod in doc.period return document(cod))})),address:(for a in Practitioner.address return document(a)),communication:( FOR cod IN CodeableConceptMaster filter cod._id in Practitioner.communication RETURN MERGE(cod,{coding:(FOR d IN cod.coding RETURN DOCUMENT(d))})),marital_status:(FOR cod IN CodeableConceptMaster filter cod._id==Practitioner.marital_status RETURN MERGE(cod,{coding:(FOR d IN cod.coding RETURN DOCUMENT(d))})),name:(for a in Practitioner.name return document(a)),nationality:(FOR cod IN SMGeographicMaster filter cod._id==Practitioner.nationality RETURN cod),photo:(for a in Practitioner.photo return document(a)),position:(for pt in CodeableConceptMaster filter pt._id==Practitioner.position return merge(pt,{coding:(FOR d IN pt.coding RETURN DOCUMENT(d))})),practitioner_type:(for pt in CodeableConceptMaster filter pt._id==Practitioner.practitioner_type return merge(pt,{coding:(FOR d IN pt.coding RETURN DOCUMENT(d))})),telecom:(for a in Practitioner.telecom return document(a)),job_experience:(for c in Practitioner.job_experience RETURN merge(c,{jobexperience_contact_details:(for con in c.jobexperience_contact_details return document(con)), jobexperience_address:(for add in c.jobexperience_address return document(add))})),training_details:(for c in Practitioner.training_details RETURN merge(c,{training_contact_details:(for con in c.training_contact_details return document(con)), training_address:(for add in c.training_address return document(add))})),practitioner_role:(for doc in PractitionerRole filter doc._id IN Practitioner.practitioner_role return MERGE(doc,{telecom:(for rol in ContactPointMaster filter rol._id in doc.telecom return rol),role:(for cod in CodeableConceptMaster filter cod._id==doc.role return merge(cod,{coding:(for code in CodingMaster filter code._id in cod.coding return code)})),period:(for per in periodMaster filter per._id in doc.period return per)})),gender:(FOR cod IN CodeableConceptMaster filter cod._id==Practitioner.gender RETURN MERGE(cod,{coding:(FOR d IN cod.coding RETURN DOCUMENT(d))})),employee_status:(for pt in CodeableConceptMaster filter pt._id==Practitioner.employee_status return merge(pt,{coding:(FOR d IN pt.coding RETURN DOCUMENT(d))}))})"
8092
+ };
8093
+ },
8094
+ practitioner_list: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"Practitioner\",\n \"sort\":\"Practitioner.createddate\",\n \"filter\": \"Practitioner.activestatus==true\",\n \"return_fields\": \"{id:Practitioner.id,name:(FOR nam IN TO_ARRAY(Practitioner.name) RETURN DOCUMENT(nam).text)[0],type: (for t in CodeableConceptMaster filter t._id == Practitioner.practitioner_type return merge(t,{coding:(for cod in CodingMaster filter cod._id in t.coding return cod.display)})),_key:Practitioner._key,status:Practitioner.status,Practitionerrole:(for pr in PractitionerRole filter pr._id in Practitioner.practitioner_role && pr.primary_specialty==true return merge(pr,{SpecialtyID:(for spe in CodeableConceptMaster filter spe._id ==pr.SpecialtyID return merge(spe,{coding:(for cod in CodingMaster filter cod._id in spe.coding return cod.display)}))}))}\"\n }"),
8095
+ status_update_practitioner: function status_update_practitioner(data) {
8096
+ return [{
8097
+ db_name: dbName,
8098
+ entity: "Practitioner",
8099
+ filter: {
8100
+ _key: data._key
8101
+ },
8102
+ is_metadata: true,
8103
+ metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd",
8104
+ doc: {
8105
+ status: data.status
8106
+ }
8107
+ }];
8108
+ },
8109
+ get_entity_by_id: function get_entity_by_id(id) {
8110
+ return {
8111
+ "db_name": dbName,
8112
+ "entity": "Organization",
8113
+ "sort": "Organization.name",
8114
+ "filter": "Organization.activestatus==true && Organization.OrgType any =='".concat(id, "'"),
8115
+ "return_fields": "{_id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,alias:Organization.alias}"
8116
+ };
8117
+ }
8118
+ };
8119
+
8077
8120
  var contactList = function contactList(data) {
8078
8121
  var contactLists = [];
8079
8122
 
@@ -8088,8 +8131,8 @@ var contactList = function contactList(data) {
8088
8131
  "valueprefix": val.country_code ? val.country_code.value : "",
8089
8132
  "period": [{
8090
8133
  // "_id": "string",
8091
- "start": moment().unix(),
8092
- "end": moment().endOf('day').unix() // "id": "number"
8134
+ "start": getUtcTime(),
8135
+ "end": getUtcTime(moment().endOf('day')) // "id": "number"
8093
8136
 
8094
8137
  }] // "id": "number"
8095
8138
 
@@ -8165,7 +8208,7 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8165
8208
  ({
8166
8209
  "IDType": val.id_type.value ? val.id_type.value : "",
8167
8210
  "IDNumber": val.id_number ? val.id_number : "",
8168
- "ExpiryDate": val.expiry_date ? moment(val.expiry_date).unix() : null // doc
8211
+ "ExpiryDate": val.expiry_date ? getUtcTime(moment(val.expiry_date)) : null // doc
8169
8212
  // "files": val.doc ? val.doc : []
8170
8213
 
8171
8214
  });
@@ -8184,8 +8227,8 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8184
8227
  "files": val.doc ? val.doc : [],
8185
8228
  "period": [{
8186
8229
  // "_id": "string",
8187
- "start": moment().unix(),
8188
- "end": val.expiry_date ? moment(val.expiry_date).unix() : null // "id": "number"
8230
+ "start": getUtcTime(),
8231
+ "end": val.expiry_date ? getUtcTime(moment(val.expiry_date)) : null // "id": "number"
8189
8232
 
8190
8233
  }] // "assigner": "string",
8191
8234
  // "Type": "string",
@@ -8211,8 +8254,8 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8211
8254
  "suffix": val.suffix ? val.suffix.value : "",
8212
8255
  "period": [{
8213
8256
  // "_id": "",
8214
- "start": moment().unix(),
8215
- "end": moment().endOf('day').unix() // "id": "number"
8257
+ "start": getUtcTime(),
8258
+ "end": getUtcTime(moment().endOf('day')) // "id": "number"
8216
8259
 
8217
8260
  }]
8218
8261
  };
@@ -8244,8 +8287,8 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8244
8287
  "valueprefix": val.country_code ? val.country_code.value : "",
8245
8288
  "period": [{
8246
8289
  // "_id": "string",
8247
- "start": moment().unix(),
8248
- "end": moment().endOf('day').unix() // "id": "number"
8290
+ "start": getUtcTime(),
8291
+ "end": getUtcTime(moment().endOf('day')) // "id": "number"
8249
8292
 
8250
8293
  }] // "id": "number"
8251
8294
 
@@ -8277,8 +8320,8 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8277
8320
  // "EntityName": val.entity_name ? val.entity_name.value : "",
8278
8321
  period: [{
8279
8322
  // "_id": "string",
8280
- start: val.start_date ? moment(val.start_date).unix() : null,
8281
- end: val.end_date ? moment(val.end_date).unix() : null // "id": "number"
8323
+ start: val.start_date ? getUtcTime(moment(val.start_date)) : null,
8324
+ end: val.end_date ? getUtcTime(moment(val.end_date)) : null // "id": "number"
8282
8325
 
8283
8326
  }],
8284
8327
  SpecialtyID: val.speciality ? val.speciality.value : "",
@@ -8326,9 +8369,9 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8326
8369
  var qualificationData = {
8327
8370
  "name": val.name ? val.name : "",
8328
8371
  "university_board": val.qualification_name ? val.qualification_name : "",
8329
- "issue_date": val.issued_by ? moment(val.issued_by).unix() : null,
8330
- "valid_from": val.start_date ? moment(val.start_date).unix() : null,
8331
- "valid_to": val.end_date ? moment(val.end_date).unix() : null,
8372
+ "issue_date": val.issued_by ? getUtcTime(moment(val.issued_by)) : null,
8373
+ "valid_from": val.start_date ? getUtcTime(moment(val.start_date)) : null,
8374
+ "valid_to": val.end_date ? getUtcTime(moment(val.end_date)) : null,
8332
8375
  "files": val.doc ? val.doc : []
8333
8376
  };
8334
8377
  qualification_list.push(qualificationData);
@@ -8357,10 +8400,10 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8357
8400
  "organization": val.organization ? val.organization : "",
8358
8401
  "course_name": val.course_name ? val.course_name : "",
8359
8402
  "responsible_person": val.responsible_person ? val.responsible_person : "",
8360
- "course_start_date": val.course_start_date ? moment(val.course_start_date).unix() : null,
8361
- "course_end_date": val.course_end_date ? moment(val.course_end_date).unix() : null,
8362
- "certificate_issued_date": val.certificate_issue_date ? moment(val.certificate_issue_date).unix() : null,
8363
- "certificate_expiry_date": val.certificate_expiry_date ? moment(val.certificate_expiry_date).unix() : null,
8403
+ "course_start_date": val.course_start_date ? getUtcTime(moment(val.course_start_date)) : null,
8404
+ "course_end_date": val.course_end_date ? getUtcTime(moment(val.course_end_date)) : null,
8405
+ "certificate_issued_date": val.certificate_issue_date ? getUtcTime(moment(val.certificate_issue_date)) : null,
8406
+ "certificate_expiry_date": val.certificate_expiry_date ? getUtcTime(moment(val.certificate_expiry_date)) : null,
8364
8407
  "files": val.doc ? val.doc : [],
8365
8408
  "training_contact_details": contactList(val.contact),
8366
8409
  "training_address": addresslist(val.address)
@@ -8379,8 +8422,8 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8379
8422
  "department": val.department ? val.department : "",
8380
8423
  "designation": val.designation ? val.designation : "",
8381
8424
  "role": val.role ? val.role : "",
8382
- "start_date": val.start_date ? moment(val.start_date).unix() : null,
8383
- "end_date": val.end_date ? moment(val.end_date).unix() : null,
8425
+ "start_date": val.start_date ? getUtcTime(moment(val.start_date)) : null,
8426
+ "end_date": val.end_date ? getUtcTime(moment(val.end_date)) : null,
8384
8427
  "report_to": val.reporting_to ? val.reporting_to : "",
8385
8428
  "grade": val.grade ? val.grade : "",
8386
8429
  "pay_scale": val.pay_scale ? val.pay_scale : "",
@@ -8404,7 +8447,7 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8404
8447
  "type": val.type ? val.type : "",
8405
8448
  "title": val.title ? val.title : "",
8406
8449
  "note": val.notes ? val.notes : "",
8407
- "date": val.date ? moment(val.date).unix() : null,
8450
+ "date": val.date ? getUtcTime(moment(val.date)) : null,
8408
8451
  "files": val.doc ? val.doc : []
8409
8452
  };
8410
8453
  awardsList.push(awardsData);
@@ -8952,7 +8995,7 @@ var generateReadJSON$4 = function generateReadJSON(data, masters) {
8952
8995
  return idlabel.value === val.user;
8953
8996
  })[0] : {},
8954
8997
  "id_number": val.value,
8955
- "expiry_date": val.period[0].end ? moment.unix(val.period[0].end).format("YYYY-MM-DD") : null,
8998
+ "expiry_date": val.period[0].end ? utcTOLocal(val.period[0].end, "YYYY-MM-DD") : null,
8956
8999
  "doc": val.files
8957
9000
  };
8958
9001
  identifier.push(identifierData);
@@ -9025,8 +9068,8 @@ var generateReadJSON$4 = function generateReadJSON(data, masters) {
9025
9068
  primary_specialty: val.primary_specialty ? val.primary_specialty : false,
9026
9069
  select_role: getmasterOprions("role", val.role && ((_val$role = val.role) === null || _val$role === void 0 ? void 0 : _val$role.length) > 0 ? val.role[0]._id : null, masters)[0],
9027
9070
  status: val.active ? val.active : false,
9028
- start_date: val.period && ((_val$period = val.period) === null || _val$period === void 0 ? void 0 : _val$period.length) > 0 && val.period[0].start ? moment.unix(val.period[0].start).format("YYYY-MM-DD") : null,
9029
- end_date: val.period && ((_val$period2 = val.period) === null || _val$period2 === void 0 ? void 0 : _val$period2.length) > 0 && val.period[0].end ? moment.unix(val.period[0].end).format("YYYY-MM-DD") : null,
9071
+ start_date: val.period && ((_val$period = val.period) === null || _val$period === void 0 ? void 0 : _val$period.length) > 0 && val.period[0].start ? utcTOLocal(val.period[0].start, "YYYY-MM-DD") : null,
9072
+ end_date: val.period && ((_val$period2 = val.period) === null || _val$period2 === void 0 ? void 0 : _val$period2.length) > 0 && val.period[0].end ? utcTOLocal(val.period[0].end, "YYYY-MM-DD") : null,
9030
9073
  contact: contactListData(val.telecom, masters),
9031
9074
  doc: val.files ? val.files : [],
9032
9075
  // "telecom": contactList(val.contact),
@@ -9064,9 +9107,9 @@ var generateReadJSON$4 = function generateReadJSON(data, masters) {
9064
9107
  var qualificationData = {
9065
9108
  "name": val.name ? val.name : "",
9066
9109
  "qualification_name": val.university_board ? val.university_board : "",
9067
- "issued_by": val.issue_date ? moment.unix(val.issue_date).format("YYYY-MM-DD") : null,
9068
- "start_date": val.valid_from ? moment.unix(val.valid_from).format("YYYY-MM-DD") : null,
9069
- "end_date": val.valid_to ? moment.unix(val.valid_to).format("YYYY-MM-DD") : null,
9110
+ "issued_by": val.issue_date ? utcTOLocal(val.issue_date, "YYYY-MM-DD") : null,
9111
+ "start_date": val.valid_from ? utcTOLocal(val.valid_from, "YYYY-MM-DD") : null,
9112
+ "end_date": val.valid_to ? utcTOLocal(val.valid_to, "YYYY-MM-DD") : null,
9070
9113
  "doc": val.files ? val.files : []
9071
9114
  };
9072
9115
  qualificationList.push(qualificationData);
@@ -9093,10 +9136,10 @@ var generateReadJSON$4 = function generateReadJSON(data, masters) {
9093
9136
  "organization": val.organization ? val.organization : "",
9094
9137
  "course_name": val.course_name ? val.course_name : "",
9095
9138
  "responsible_person": val.responsible_person ? val.responsible_person : "",
9096
- "course_start_date": val.course_start_date ? moment.unix(val.course_start_date).format("YYYY-MM-DD") : null,
9097
- "course_end_date": val.course_end_date ? moment.unix(val.course_end_date).format("YYYY-MM-DD") : null,
9098
- "certificate_issue_date": val.certificate_issued_date ? moment.unix(val.certificate_issued_date).format("YYYY-MM-DD") : null,
9099
- "certificate_expiry_date": val.certificate_expiry_date ? moment.unix(val.certificate_expiry_date).format("YYYY-MM-DD") : null,
9139
+ "course_start_date": val.course_start_date ? utcTOLocal(val.course_start_date, "YYYY-MM-DD") : null,
9140
+ "course_end_date": val.course_end_date ? utcTOLocal(val.course_end_date, "YYYY-MM-DD") : null,
9141
+ "certificate_issue_date": val.certificate_issued_date ? utcTOLocal(val.certificate_issued_date, "YYYY-MM-DD") : null,
9142
+ "certificate_expiry_date": val.certificate_expiry_date ? utcTOLocal(val.certificate_expiry_date, "YYYY-MM-DD") : null,
9100
9143
  "doc": val.files ? val.files : [],
9101
9144
  "contact": contactListData(val.training_contact_details, masters),
9102
9145
  "address": addressListData(val.training_address, masters)
@@ -9114,8 +9157,8 @@ var generateReadJSON$4 = function generateReadJSON(data, masters) {
9114
9157
  "department": val.department ? val.department : "",
9115
9158
  "designation": val.designation ? val.designation : "",
9116
9159
  "role": val.role ? val.role : "",
9117
- "start_date": val.start_date ? moment.unix(val.start_date).format("YYYY-MM-DD") : null,
9118
- "end_date": val.end_date ? moment.unix(val.end_date).format("YYYY-MM-DD") : null,
9160
+ "start_date": val.start_date ? utcTOLocal(val.start_date, "YYYY-MM-DD") : null,
9161
+ "end_date": val.end_date ? utcTOLocal(val.end_date, "YYYY-MM-DD") : null,
9119
9162
  "reporting_to": val.report_to ? val.report_to : "",
9120
9163
  "grade": val.grade ? val.grade : "",
9121
9164
  "pay_scale": val.pay_scale ? val.pay_scale : "",
@@ -9138,7 +9181,7 @@ var generateReadJSON$4 = function generateReadJSON(data, masters) {
9138
9181
  "type": val.type ? val.type : "",
9139
9182
  "title": val.title ? val.title : "",
9140
9183
  "notes": val.note ? val.note : "",
9141
- "date": val.date ? moment.unix(val.date).format("YYYY-MM-DD") : null,
9184
+ "date": val.date ? utcTOLocal(val.date, "YYYY-MM-DD") : null,
9142
9185
  "doc": val.files ? val.files : []
9143
9186
  };
9144
9187
  awardsList.push(awardsListData);
@@ -11862,8 +11905,8 @@ var timeslotList = function timeslotList(data) {
11862
11905
  if (data && data.length > 0) {
11863
11906
  data.map(function (val) {
11864
11907
  var timelot_obj = {
11865
- ovrfromtime: val.fromTime ? moment(val.fromTime).unix() : null,
11866
- ovrtotime: val.toTime ? moment(val.toTime).unix() : null // ovrfromtime: val.fromTime
11908
+ ovrfromtime: val.fromTime ? getUtcTime(moment(val.fromTime)) : null,
11909
+ ovrtotime: val.toTime ? getUtcTime(moment(val.toTime)) : null // ovrfromtime: val.fromTime
11867
11910
  // ? parseFloat(val.fromTime.replace(":", "."))
11868
11911
  // : null,
11869
11912
  // ovrtotime: val.toTime ? parseFloat(val.toTime.replace(":", ".")) : null,
@@ -11882,8 +11925,8 @@ var workday_timeslot = function workday_timeslot(data) {
11882
11925
  if (data && data.length > 0) {
11883
11926
  data.map(function (val) {
11884
11927
  var workday_timeslot_obj = {
11885
- openingtime: val.fromTime ? moment(val.fromTime).unix() : null,
11886
- closingtime: val.toTime ? moment(val.toTime).unix() : null // openingtime: val.fromTime
11928
+ openingtime: val.fromTime ? getUtcTime(moment(val.fromTime)) : null,
11929
+ closingtime: val.toTime ? getUtcTime(moment(val.toTime)) : null // openingtime: val.fromTime
11887
11930
  // ? parseFloat(val.fromTime.replace(":", "."))
11888
11931
  // : null,
11889
11932
  // closingtime: val.toTime
@@ -11919,8 +11962,8 @@ var generateJSON = function generateJSON(data, _key) {
11919
11962
  value: "",
11920
11963
  period: [{
11921
11964
  //_id: "",
11922
- start: moment().unix(),
11923
- end: moment().endOf("day").unix() //id: "",
11965
+ start: getUtcTime(),
11966
+ end: getUtcTime(moment().endOf("day")) //id: "",
11924
11967
 
11925
11968
  }] // assigner: "",
11926
11969
  // Type: "",
@@ -11948,8 +11991,8 @@ var generateJSON = function generateJSON(data, _key) {
11948
11991
  rank: val.priority.value.value ? val.priority.value.value : "",
11949
11992
  period: [{
11950
11993
  //_id: "",
11951
- start: moment().unix(),
11952
- end: moment().endOf("day").unix() //id: "",
11994
+ start: getUtcTime(),
11995
+ end: getUtcTime(moment().endOf("day")) //id: "",
11953
11996
 
11954
11997
  }],
11955
11998
  //id: "",
@@ -11989,7 +12032,7 @@ var generateJSON = function generateJSON(data, _key) {
11989
12032
  if (val.type === "singleDate") {
11990
12033
  final_obj = {
11991
12034
  overridetype: "Single",
11992
- ovrfromdate: val.selectDate ? moment(val.selectDate).unix() : null,
12035
+ ovrfromdate: val.selectDate ? getUtcTime(moment(val.selectDate)) : null,
11993
12036
  ovrtodate: 0,
11994
12037
  operationTime: [{
11995
12038
  ovrday: "Monday",
@@ -12000,8 +12043,8 @@ var generateJSON = function generateJSON(data, _key) {
12000
12043
  } else if (val.type === "dateRange") {
12001
12044
  final_obj = {
12002
12045
  overridetype: "Multiple",
12003
- ovrfromdate: val.fromDate ? moment(val.fromDate).unix() : null,
12004
- ovrtodate: val.toDate ? moment(val.toDate).unix() : null,
12046
+ ovrfromdate: val.fromDate ? getUtcTime(moment(val.fromDate)) : null,
12047
+ ovrtodate: val.toDate ? getUtcTime(moment(val.toDate)) : null,
12005
12048
  operationTime: dayslotlist(val.daySlots)
12006
12049
  };
12007
12050
  overRideArr.push(final_obj);
@@ -14693,7 +14736,7 @@ var queries$i = {
14693
14736
  "doc": _objectSpread2(_objectSpread2({
14694
14737
  // "_id": "string",
14695
14738
  // "CalYear": "number",
14696
- "CalDate": data.date ? moment(data.date).unix() : null,
14739
+ "CalDate": data.date ? getUtcTime(moment(data.date)) : null,
14697
14740
  "CalDay": data.date ? moment(data.date).format("dddd") : "",
14698
14741
  "HolidayType": data.holiday_type,
14699
14742
  "HoidayReason": data.holiday_reason,
@@ -15147,7 +15190,7 @@ var HOLIDAY_READ = createAsyncThunk("holidaySlice/holidy_list", /*#__PURE__*/_as
15147
15190
  data.result.map(function (val) {
15148
15191
  if (val._key) {
15149
15192
  arry.push({
15150
- "date": val.CalDate ? moment.unix(val.CalDate).format("DD-MM-YY") : null,
15193
+ "date": val.CalDate ? utcTOLocal(val.CalDate, "DD-MM-YY") : null,
15151
15194
  "CalDate": val.CalDate ? val.CalDate : null,
15152
15195
  "day": val.CalDay ? val.CalDay : "",
15153
15196
  "holiday_reason": val.HoidayReason ? val.HoidayReason : "",
@@ -17321,7 +17364,7 @@ var DfltFreqbyPatAttribFun = function DfltFreqbyPatAttribFun(val, dataval) {
17321
17364
  };
17322
17365
 
17323
17366
  var generateDrugMasterJSON = function generateDrugMasterJSON(data, _key, draft) {
17324
- var _data$phDrugMaster, _data$phDrugMaster$ro, _data$phDrugMaster2, _data$alternateDrugs, _data$phDrugMaster4, _data$availableStreng, _data$phDrugMaster5, _data$instructions, _data$frequencyRules, _data$dispensesRules, _data$phDrugMaster6, _data$phDrugMaster6$s, _data$mappedStack, _data$phDrugMaster$co, _data$phDrugMaster8, _data$phDrugMaster$sh, _data$phDrugMaster9, _data$phDrugMaster$lo, _data$phDrugMaster10, _data$phDrugMaster$in, _data$phDrugMaster11, _data$phDrugMaster$dr, _data$phDrugMaster12, _data$phDrugMaster$cl, _data$phDrugMaster13, _data$phDrugMaster13$, _data$phDrugMaster$ty, _data$phDrugMaster14, _data$phDrugMaster14$, _data$phDrugMaster$ca, _data$phDrugMaster15, _data$phDrugMaster15$, _data$phDrugMaster16, _data$phDrugMaster16$, _data$phDrugMaster17, _data$phDrugMaster18, _data$phDrugMaster18$, _data$phDrugMaster19, _data$phDrugMaster19$, _data$phDrugMaster20, _data$phDrugMaster21, _data$phDrugMaster21$, _data$drugOtherAttrib, _data$phDrugMaster22, _data$drugOtherAttrib2, _data$drugOtherAttrib3, _data$phDrugMaster23, _data$drugOtherAttrib4, _data$drugOtherAttrib5, _data$phDrugMaster24, _data$drugOtherAttrib6, _data$drugOtherAttrib7, _data$phDrugMaster25, _data$drugOtherAttrib8, _data$drugOtherAttrib9, _data$phDrugMaster26, _data$drugOtherAttrib10, _data$status$status$v, _data$status, _data$status$status, _data$status2, _moment$unix, _data$status3, _data$status4, _moment$unix2, _data$status5, _data$status$reason, _data$status6;
17367
+ var _data$phDrugMaster, _data$phDrugMaster$ro, _data$phDrugMaster2, _data$alternateDrugs, _data$phDrugMaster4, _data$availableStreng, _data$phDrugMaster5, _data$instructions, _data$frequencyRules, _data$dispensesRules, _data$phDrugMaster6, _data$phDrugMaster6$s, _data$mappedStack, _data$phDrugMaster$co, _data$phDrugMaster8, _data$phDrugMaster$sh, _data$phDrugMaster9, _data$phDrugMaster$lo, _data$phDrugMaster10, _data$phDrugMaster$in, _data$phDrugMaster11, _data$phDrugMaster$dr, _data$phDrugMaster12, _data$phDrugMaster$cl, _data$phDrugMaster13, _data$phDrugMaster13$, _data$phDrugMaster$ty, _data$phDrugMaster14, _data$phDrugMaster14$, _data$phDrugMaster$ca, _data$phDrugMaster15, _data$phDrugMaster15$, _data$phDrugMaster16, _data$phDrugMaster16$, _data$phDrugMaster17, _data$phDrugMaster18, _data$phDrugMaster18$, _data$phDrugMaster19, _data$phDrugMaster19$, _data$phDrugMaster20, _data$phDrugMaster21, _data$phDrugMaster21$, _data$drugOtherAttrib, _data$phDrugMaster22, _data$drugOtherAttrib2, _data$drugOtherAttrib3, _data$phDrugMaster23, _data$drugOtherAttrib4, _data$drugOtherAttrib5, _data$phDrugMaster24, _data$drugOtherAttrib6, _data$drugOtherAttrib7, _data$phDrugMaster25, _data$drugOtherAttrib8, _data$drugOtherAttrib9, _data$phDrugMaster26, _data$drugOtherAttrib10, _data$status$status$v, _data$status, _data$status$status, _data$status2, _getUtcTime, _data$status3, _data$status4, _getUtcTime2, _data$status5, _data$status$reason, _data$status6;
17325
17368
 
17326
17369
  var statusactive = true;
17327
17370
  var filter = {};
@@ -17534,8 +17577,8 @@ var generateDrugMasterJSON = function generateDrugMasterJSON(data, _key, draft)
17534
17577
  "DrugDispRules": DrugDispRulesData,
17535
17578
  //STATUS
17536
17579
  "Status": (_data$status$status$v = data === null || data === void 0 ? void 0 : (_data$status = data.status) === null || _data$status === void 0 ? void 0 : (_data$status$status = _data$status.status) === null || _data$status$status === void 0 ? void 0 : _data$status$status.value) !== null && _data$status$status$v !== void 0 ? _data$status$status$v : "",
17537
- "EffectiveFrom": data !== null && data !== void 0 && (_data$status2 = data.status) !== null && _data$status2 !== void 0 && _data$status2.effectiveFrom ? (_moment$unix = moment(data === null || data === void 0 ? void 0 : (_data$status3 = data.status) === null || _data$status3 === void 0 ? void 0 : _data$status3.effectiveFrom).unix()) !== null && _moment$unix !== void 0 ? _moment$unix : null : null,
17538
- "EffectiveTo": data !== null && data !== void 0 && (_data$status4 = data.status) !== null && _data$status4 !== void 0 && _data$status4.effectiveTo ? (_moment$unix2 = moment(data === null || data === void 0 ? void 0 : (_data$status5 = data.status) === null || _data$status5 === void 0 ? void 0 : _data$status5.effectiveTo).unix()) !== null && _moment$unix2 !== void 0 ? _moment$unix2 : null : null,
17580
+ "EffectiveFrom": data !== null && data !== void 0 && (_data$status2 = data.status) !== null && _data$status2 !== void 0 && _data$status2.effectiveFrom ? (_getUtcTime = getUtcTime(moment(data === null || data === void 0 ? void 0 : (_data$status3 = data.status) === null || _data$status3 === void 0 ? void 0 : _data$status3.effectiveFrom))) !== null && _getUtcTime !== void 0 ? _getUtcTime : null : null,
17581
+ "EffectiveTo": data !== null && data !== void 0 && (_data$status4 = data.status) !== null && _data$status4 !== void 0 && _data$status4.effectiveTo ? (_getUtcTime2 = getUtcTime(moment(data === null || data === void 0 ? void 0 : (_data$status5 = data.status) === null || _data$status5 === void 0 ? void 0 : _data$status5.effectiveTo))) !== null && _getUtcTime2 !== void 0 ? _getUtcTime2 : null : null,
17539
17582
  "InactiveReason": (_data$status$reason = data === null || data === void 0 ? void 0 : (_data$status6 = data.status) === null || _data$status6 === void 0 ? void 0 : _data$status6.reason) !== null && _data$status$reason !== void 0 ? _data$status$reason : "",
17540
17583
  "statusactive": statusactive,
17541
17584
  // save type
@@ -17826,8 +17869,8 @@ var readDrugMasterJSON = function readDrugMasterJSON(data, state) {
17826
17869
  "SourceOfDrugOrderCatalog": data === null || data === void 0 ? void 0 : data.SourceOfDrugOrderCatalog,
17827
17870
  "status": {
17828
17871
  "status": data !== null && data !== void 0 && data.Status ? singelOptionComLable(data === null || data === void 0 ? void 0 : data.Status, state === null || state === void 0 ? void 0 : (_state$drug_master11 = state.drug_master) === null || _state$drug_master11 === void 0 ? void 0 : (_state$drug_master11$ = _state$drug_master11.data) === null || _state$drug_master11$ === void 0 ? void 0 : _state$drug_master11$.status) : [],
17829
- "effectiveFrom": data !== null && data !== void 0 && data.EffectiveFrom ? moment.unix(data === null || data === void 0 ? void 0 : data.EffectiveFrom).format("YYYY-MM-DD") : null,
17830
- "effectiveTo": data !== null && data !== void 0 && data.EffectiveTo ? moment.unix(data === null || data === void 0 ? void 0 : data.EffectiveTo).format("YYYY-MM-DD") : null,
17872
+ "effectiveFrom": data !== null && data !== void 0 && data.EffectiveFrom ? utcTOLocal(data === null || data === void 0 ? void 0 : data.EffectiveFrom, "YYYY-MM-DD") : null,
17873
+ "effectiveTo": data !== null && data !== void 0 && data.EffectiveTo ? utcTOLocal(data === null || data === void 0 ? void 0 : data.EffectiveTo, "YYYY-MM-DD") : null,
17831
17874
  "reason": (_data$InactiveReason = data === null || data === void 0 ? void 0 : data.InactiveReason) !== null && _data$InactiveReason !== void 0 ? _data$InactiveReason : ""
17832
17875
  },
17833
17876
  "drugOtherAttributes": {
@@ -19070,8 +19113,8 @@ var getAvailability = function getAvailability(data) {
19070
19113
  apptreqd: v.appointment,
19071
19114
  apptDurnInMinutes: parseInt(v.duration),
19072
19115
  perfOrganizationEntity: v.entity_type.value,
19073
- EffFrDate: v.effective_from ? moment(v.effective_from).unix() : null,
19074
- EffToDate: v.effective_to ? moment(v.effective_to).unix() : null
19116
+ EffFrDate: v.effective_from ? getUtcTime(moment(v.effective_from)) : null,
19117
+ EffToDate: v.effective_to ? getUtcTime(moment(v.effective_to)) : null
19075
19118
  };
19076
19119
  });
19077
19120
  return arr;
@@ -19458,8 +19501,8 @@ var generatefaciltity = function generatefaciltity(data, state) {
19458
19501
  } : null,
19459
19502
  appointment: v.apptreqd,
19460
19503
  duration: v.apptDurnInMinutes,
19461
- effective_from: new Date(moment.unix(v.EffFrDate)).toLocaleDateString(),
19462
- effective_to: new Date(moment.unix(v.EffToDate)).toLocaleDateString()
19504
+ effective_from: new Date(utcTOLocal(v.EffFrDate)).toLocaleDateString(),
19505
+ effective_to: new Date(utcTOLocal(v.EffToDate)).toLocaleDateString()
19463
19506
  };
19464
19507
  });
19465
19508
  return facilityArr;
@@ -20725,8 +20768,8 @@ var upsertData = function upsertData(payload) {
20725
20768
  "ResourceType": (_payload$basicDetails4 = payload === null || payload === void 0 ? void 0 : (_payload$basicDetails5 = payload.basicDetails) === null || _payload$basicDetails5 === void 0 ? void 0 : (_payload$basicDetails6 = _payload$basicDetails5.resource_type) === null || _payload$basicDetails6 === void 0 ? void 0 : _payload$basicDetails6.value) !== null && _payload$basicDetails4 !== void 0 ? _payload$basicDetails4 : "",
20726
20769
  "ResourceRole": (_payload$basicDetails7 = payload === null || payload === void 0 ? void 0 : (_payload$basicDetails8 = payload.basicDetails) === null || _payload$basicDetails8 === void 0 ? void 0 : (_payload$basicDetails9 = _payload$basicDetails8.resource_role) === null || _payload$basicDetails9 === void 0 ? void 0 : _payload$basicDetails9.value) !== null && _payload$basicDetails7 !== void 0 ? _payload$basicDetails7 : "",
20727
20770
  "Resource_Criteria": (_ruleSet = ruleSet) !== null && _ruleSet !== void 0 ? _ruleSet : [],
20728
- "EffectiveFrom": moment(payload.scheduledPeriod.start_date).unix(),
20729
- "EffectiveTo": payload.scheduledPeriod.end_date ? moment(payload.scheduledPeriod.end_date).unix() : 0,
20771
+ "EffectiveFrom": getUtcTime(moment(payload.scheduledPeriod.start_date)),
20772
+ "EffectiveTo": payload.scheduledPeriod.end_date ? getUtcTime(moment(payload.scheduledPeriod.end_date)) : 0,
20730
20773
  "Schedulemode": (_payload$scheduledPer = payload === null || payload === void 0 ? void 0 : (_payload$scheduledPer2 = payload.scheduledPeriod) === null || _payload$scheduledPer2 === void 0 ? void 0 : (_payload$scheduledPer3 = _payload$scheduledPer2.schedule_mode) === null || _payload$scheduledPer3 === void 0 ? void 0 : _payload$scheduledPer3.value) !== null && _payload$scheduledPer !== void 0 ? _payload$scheduledPer : "",
20731
20774
  "scheduleappmang": parseInt((_payload$scheduledPer4 = payload === null || payload === void 0 ? void 0 : (_payload$scheduledPer5 = payload.scheduledPeriod) === null || _payload$scheduledPer5 === void 0 ? void 0 : _payload$scheduledPer5.availablity_management) !== null && _payload$scheduledPer4 !== void 0 ? _payload$scheduledPer4 : 0),
20732
20775
  "Remarks": "",
@@ -20899,8 +20942,8 @@ var makeJson = function makeJson(data) {
20899
20942
  var _val$ResourceType, _val$ResourceRole$dis, _val$ResourceRole, _val$ResourceRole2;
20900
20943
 
20901
20944
  return _objectSpread2(_objectSpread2({}, val), {}, {
20902
- start_date: moment.unix(val.EffectiveFrom).format("DD-MM-YYYY"),
20903
- end_date: val.EffectiveTo ? moment.unix(val.EffectiveTo).format("DD-MM-YYYY") : "",
20945
+ start_date: utcTOLocal(val.EffectiveFrom, "DD-MM-YYYY"),
20946
+ end_date: val.EffectiveTo ? utcTOLocal(val.EffectiveTo, "DD-MM-YYYY") : "",
20904
20947
  resource_type: val === null || val === void 0 ? void 0 : (_val$ResourceType = val.ResourceType) === null || _val$ResourceType === void 0 ? void 0 : _val$ResourceType.display,
20905
20948
  resource_role: (_val$ResourceRole$dis = val === null || val === void 0 ? void 0 : (_val$ResourceRole = val.ResourceRole) === null || _val$ResourceRole === void 0 ? void 0 : _val$ResourceRole.display) !== null && _val$ResourceRole$dis !== void 0 ? _val$ResourceRole$dis : val === null || val === void 0 ? void 0 : (_val$ResourceRole2 = val.ResourceRole) === null || _val$ResourceRole2 === void 0 ? void 0 : _val$ResourceRole2.shortdesc
20906
20949
  });
@@ -21333,11 +21376,12 @@ var ALL_PRACTITIONER = createAsyncThunk("scheduleManagementApiSlice/allPractitio
21333
21376
  data = _context2.sent;
21334
21377
  arr = [];
21335
21378
  data && data.result.map(function (val) {
21336
- var _val$name$0$prefix$0$, _val$name, _val$name$, _val$name$$prefix, _val$name$$prefix$, _val$name$$prefix$$co, _val$name$$prefix$$co2, _val$name$0$text, _val$name2, _val$name2$, _val$name$0$given, _val$name3, _val$name$0$family, _val$name4, _val$name4$, _val$name$0$suffix$0$, _val$name5, _val$name5$, _val$name5$$suffix, _val$name5$$suffix$, _val$name5$$suffix$$c, _val$name5$$suffix$$c2;
21379
+ var _val$name;
21337
21380
 
21338
21381
  arr.push({
21339
21382
  value: val._id,
21340
- label: ((_val$name$0$prefix$0$ = val === null || val === void 0 ? void 0 : (_val$name = val.name) === null || _val$name === void 0 ? void 0 : (_val$name$ = _val$name[0]) === null || _val$name$ === void 0 ? void 0 : (_val$name$$prefix = _val$name$.prefix) === null || _val$name$$prefix === void 0 ? void 0 : (_val$name$$prefix$ = _val$name$$prefix[0]) === null || _val$name$$prefix$ === void 0 ? void 0 : (_val$name$$prefix$$co = _val$name$$prefix$.coding) === null || _val$name$$prefix$$co === void 0 ? void 0 : (_val$name$$prefix$$co2 = _val$name$$prefix$$co[0]) === null || _val$name$$prefix$$co2 === void 0 ? void 0 : _val$name$$prefix$$co2.display) !== null && _val$name$0$prefix$0$ !== void 0 ? _val$name$0$prefix$0$ : "") + " " + ((_val$name$0$text = val === null || val === void 0 ? void 0 : (_val$name2 = val.name) === null || _val$name2 === void 0 ? void 0 : (_val$name2$ = _val$name2[0]) === null || _val$name2$ === void 0 ? void 0 : _val$name2$.text) !== null && _val$name$0$text !== void 0 ? _val$name$0$text : "") + " " + ((_val$name$0$given = val === null || val === void 0 ? void 0 : (_val$name3 = val.name) === null || _val$name3 === void 0 ? void 0 : _val$name3[0].given) !== null && _val$name$0$given !== void 0 ? _val$name$0$given : "") + " " + ((_val$name$0$family = val === null || val === void 0 ? void 0 : (_val$name4 = val.name) === null || _val$name4 === void 0 ? void 0 : (_val$name4$ = _val$name4[0]) === null || _val$name4$ === void 0 ? void 0 : _val$name4$.family) !== null && _val$name$0$family !== void 0 ? _val$name$0$family : "") + " " + ((_val$name$0$suffix$0$ = val === null || val === void 0 ? void 0 : (_val$name5 = val.name) === null || _val$name5 === void 0 ? void 0 : (_val$name5$ = _val$name5[0]) === null || _val$name5$ === void 0 ? void 0 : (_val$name5$$suffix = _val$name5$.suffix) === null || _val$name5$$suffix === void 0 ? void 0 : (_val$name5$$suffix$ = _val$name5$$suffix[0]) === null || _val$name5$$suffix$ === void 0 ? void 0 : (_val$name5$$suffix$$c = _val$name5$$suffix$.coding) === null || _val$name5$$suffix$$c === void 0 ? void 0 : (_val$name5$$suffix$$c2 = _val$name5$$suffix$$c[0]) === null || _val$name5$$suffix$$c2 === void 0 ? void 0 : _val$name5$$suffix$$c2.display) !== null && _val$name$0$suffix$0$ !== void 0 ? _val$name$0$suffix$0$ : ""),
21383
+ label: makeName(val === null || val === void 0 ? void 0 : (_val$name = val.name) === null || _val$name === void 0 ? void 0 : _val$name[0]),
21384
+ //(val?.name?.[0]?.prefix?.[0]?.coding?.[0]?.display??"")+ " " + (val?.name?.[0]?.text??"") + " " + (val?.name?.[0].given??"") + " " + (val?.name?.[0]?.family??"") + " " + (val?.name?.[0]?.suffix?.[0]?.coding?.[0]?.display??""),
21341
21385
  // label:
21342
21386
  // val.name.length > 0
21343
21387
  // ? val.name[0].prefix.length > 0
@@ -22143,8 +22187,8 @@ var generateJson$7 = {
22143
22187
  user: v === null || v === void 0 ? void 0 : (_v$use2 = v.use) === null || _v$use2 === void 0 ? void 0 : _v$use2.value,
22144
22188
  value: v === null || v === void 0 ? void 0 : v.idnumber,
22145
22189
  period: [{
22146
- start: moment(v === null || v === void 0 ? void 0 : v.startdate).unix(),
22147
- end: moment(v === null || v === void 0 ? void 0 : v.enddate).unix(),
22190
+ start: getUtcTime(moment(v === null || v === void 0 ? void 0 : v.startdate)),
22191
+ end: getUtcTime(moment(v === null || v === void 0 ? void 0 : v.enddate)),
22148
22192
  id: 0
22149
22193
  }],
22150
22194
  Type: v === null || v === void 0 ? void 0 : (_v$idtype = v.idtype) === null || _v$idtype === void 0 ? void 0 : _v$idtype.value
@@ -22157,8 +22201,8 @@ var generateJson$7 = {
22157
22201
  return {
22158
22202
  aliasType: v === null || v === void 0 ? void 0 : (_v$aliastype = v.aliastype) === null || _v$aliastype === void 0 ? void 0 : _v$aliastype.value,
22159
22203
  aliasDesc: v === null || v === void 0 ? void 0 : v.aliasname,
22160
- aliasStart: moment(v === null || v === void 0 ? void 0 : v.startdate).unix(),
22161
- aliasEnd: moment(v === null || v === void 0 ? void 0 : v.enddate).unix()
22204
+ aliasStart: getUtcTime(moment(v === null || v === void 0 ? void 0 : v.startdate)),
22205
+ aliasEnd: getUtcTime(moment(v === null || v === void 0 ? void 0 : v.enddate))
22162
22206
  };
22163
22207
  });
22164
22208
  var addressArr = data === null || data === void 0 ? void 0 : (_data$Address = data.Address) === null || _data$Address === void 0 ? void 0 : _data$Address.map(function (val, i) {
@@ -22230,8 +22274,8 @@ var generateJson$7 = {
22230
22274
  var specialtyDetailsArr = data === null || data === void 0 ? void 0 : (_data$specialtyDetail = data.specialtyDetails) === null || _data$specialtyDetail === void 0 ? void 0 : _data$specialtyDetail.map(function (val, i) {
22231
22275
  return {
22232
22276
  specialty: val === null || val === void 0 ? void 0 : val.dropdown.id,
22233
- effFrom: moment(val === null || val === void 0 ? void 0 : val.fromDate).unix(),
22234
- effTo: moment(val === null || val === void 0 ? void 0 : val.toDate).unix(),
22277
+ effFrom: getUtcTime(moment(val === null || val === void 0 ? void 0 : val.fromDate)),
22278
+ effTo: getUtcTime(moment(val === null || val === void 0 ? void 0 : val.toDate)),
22235
22279
  external: false
22236
22280
  };
22237
22281
  });
@@ -22296,8 +22340,10 @@ var generateReadJson$2 = {
22296
22340
 
22297
22341
  // IdentificationArr readdd
22298
22342
  return {
22299
- startdate: moment().utc(v === null || v === void 0 ? void 0 : (_v$period$ = v.period[0]) === null || _v$period$ === void 0 ? void 0 : _v$period$.start, "DD-MM-YYYY")._d,
22300
- enddate: moment().utc(v === null || v === void 0 ? void 0 : (_v$period$2 = v.period[0]) === null || _v$period$2 === void 0 ? void 0 : _v$period$2.end, "DD-MM-YYYY")._d,
22343
+ startdate: moment.utc(moment.unix(v === null || v === void 0 ? void 0 : (_v$period$ = v.period[0]) === null || _v$period$ === void 0 ? void 0 : _v$period$.start)).local()._d,
22344
+ // startdate: moment().utc(v?.period[0]?.start, "DD-MM-YYYY")._d,
22345
+ enddate: moment.utc(moment.unix(v === null || v === void 0 ? void 0 : (_v$period$2 = v.period[0]) === null || _v$period$2 === void 0 ? void 0 : _v$period$2.end)).local()._d,
22346
+ // enddate: moment().utc(v?.period[0]?.end, "DD-MM-YYYY")._d,
22301
22347
  use: {
22302
22348
  title: v === null || v === void 0 ? void 0 : (_v$user = v.user) === null || _v$user === void 0 ? void 0 : _v$user.display,
22303
22349
  value: v === null || v === void 0 ? void 0 : (_v$user2 = v.user) === null || _v$user2 === void 0 ? void 0 : _v$user2._id
@@ -22440,13 +22486,15 @@ var generateReadJson$2 = {
22440
22486
 
22441
22487
  // specialtyDetailsarr
22442
22488
  return {
22443
- effFrom: moment(moment.unix(val === null || val === void 0 ? void 0 : val.effFrom)._d).format("DD-MM-YYYY"),
22444
- effTo: moment(moment.unix(val === null || val === void 0 ? void 0 : val.effTo)._d).format("DD-MM-YYYY"),
22489
+ effFrom: utcTOLocal(val === null || val === void 0 ? void 0 : val.effFrom, "DD-MM-YYYY"),
22490
+ effTo: utcTOLocal(val === null || val === void 0 ? void 0 : val.effTo, "DD-MM-YYYY"),
22445
22491
  specialty: val === null || val === void 0 ? void 0 : (_val$specialty = val.specialty) === null || _val$specialty === void 0 ? void 0 : _val$specialty.display,
22446
22492
  code: val === null || val === void 0 ? void 0 : (_val$specialty2 = val.specialty) === null || _val$specialty2 === void 0 ? void 0 : _val$specialty2.code,
22447
22493
  specialty_id: val === null || val === void 0 ? void 0 : (_val$specialty3 = val.specialty) === null || _val$specialty3 === void 0 ? void 0 : _val$specialty3._id,
22448
- fromDate: moment.unix(val === null || val === void 0 ? void 0 : val.effFrom)._d,
22449
- toDate: moment.unix(val.effTo)._d,
22494
+ fromDate: moment(utcTOLocal(val === null || val === void 0 ? void 0 : val.effFrom, "DD-MM-YYYY"))._d,
22495
+ // moment(val?.effFrom)._d,
22496
+ toDate: moment(utcTOLocal(val === null || val === void 0 ? void 0 : val.effTo, "DD-MM-YYYY"))._d,
22497
+ //moment(val.effTo)._d,
22450
22498
  dropdown: {
22451
22499
  label: (val === null || val === void 0 ? void 0 : (_val$specialty4 = val.specialty) === null || _val$specialty4 === void 0 ? void 0 : _val$specialty4.display) + " (" + (val === null || val === void 0 ? void 0 : (_val$specialty5 = val.specialty) === null || _val$specialty5 === void 0 ? void 0 : _val$specialty5.code) + ")",
22452
22500
  value: val === null || val === void 0 ? void 0 : (_val$specialty6 = val.specialty) === null || _val$specialty6 === void 0 ? void 0 : _val$specialty6.code,
@@ -31684,7 +31732,7 @@ var VIEW_PENDING_PATIENT_LIST = createAsyncThunk("getPendingRescheduleListApiSli
31684
31732
  case 5:
31685
31733
  data = _context2.sent;
31686
31734
  returnedData = data !== null && data !== 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 (_) {
31687
- var _$Patient$name$0$give, _$Patient, _$Patient$name, _$Patient$name$, _$Patient$alias, _$Patient2, _$Patient$age, _$Patient3, _$Patient$telecom$0$v, _$Patient4, _$Patient4$telecom, _$Patient4$telecom$, _$appno, _moment$unix, _$Patient$slotID$0$bl, _$Patient5, _$Patient5$slotID, _$Patient5$slotID$, _$Patient5$slotID$$bl, _$Patient$gender$, _$Patient6, _$Patient6$gender, _$id2;
31735
+ var _$Patient$name$0$give, _$Patient, _$Patient$name, _$Patient$name$, _$Patient$alias, _$Patient2, _$Patient$age, _$Patient3, _$Patient$telecom$0$v, _$Patient4, _$Patient4$telecom, _$Patient4$telecom$, _$appno, _$Patient$slotID$0$bl, _$Patient5, _$Patient5$slotID, _$Patient5$slotID$, _$Patient5$slotID$$bl, _$Patient$gender$, _$Patient6, _$Patient6$gender, _$id2;
31688
31736
 
31689
31737
  return {
31690
31738
  "select": false,
@@ -31693,7 +31741,7 @@ var VIEW_PENDING_PATIENT_LIST = createAsyncThunk("getPendingRescheduleListApiSli
31693
31741
  "age": (_$Patient$age = _ === null || _ === void 0 ? void 0 : (_$Patient3 = _.Patient) === null || _$Patient3 === void 0 ? void 0 : _$Patient3.age) !== null && _$Patient$age !== void 0 ? _$Patient$age : '',
31694
31742
  "mobile no": (_$Patient$telecom$0$v = _ === null || _ === void 0 ? void 0 : (_$Patient4 = _.Patient) === null || _$Patient4 === void 0 ? void 0 : (_$Patient4$telecom = _$Patient4.telecom) === null || _$Patient4$telecom === void 0 ? void 0 : (_$Patient4$telecom$ = _$Patient4$telecom[0]) === null || _$Patient4$telecom$ === void 0 ? void 0 : _$Patient4$telecom$.value) !== null && _$Patient$telecom$0$v !== void 0 ? _$Patient$telecom$0$v : '',
31695
31743
  "appt ref no.": (_$appno = _ === null || _ === void 0 ? void 0 : _.appno) !== null && _$appno !== void 0 ? _$appno : '',
31696
- "appt date & time": _ !== null && _ !== void 0 && _.start ? (_moment$unix = moment.unix(_ === null || _ === void 0 ? void 0 : _.start)) === null || _moment$unix === void 0 ? void 0 : _moment$unix.format('DD MMM,YYYY hh:mm A') : '',
31744
+ "appt date & time": _ !== null && _ !== void 0 && _.start ? utcTOLocal(_ === null || _ === void 0 ? void 0 : _.start, 'DD MMM,YYYY hh:mm A') : '',
31697
31745
  "reason": (_$Patient$slotID$0$bl = _ === null || _ === void 0 ? void 0 : (_$Patient5 = _.Patient) === null || _$Patient5 === void 0 ? void 0 : (_$Patient5$slotID = _$Patient5.slotID) === null || _$Patient5$slotID === void 0 ? void 0 : (_$Patient5$slotID$ = _$Patient5$slotID[0]) === null || _$Patient5$slotID$ === void 0 ? void 0 : (_$Patient5$slotID$$bl = _$Patient5$slotID$.blockreason) === null || _$Patient5$slotID$$bl === void 0 ? void 0 : _$Patient5$slotID$$bl.display) !== null && _$Patient$slotID$0$bl !== void 0 ? _$Patient$slotID$0$bl : '',
31698
31746
  "gender": (_$Patient$gender$ = _ === null || _ === void 0 ? void 0 : (_$Patient6 = _.Patient) === null || _$Patient6 === void 0 ? void 0 : (_$Patient6$gender = _$Patient6.gender) === null || _$Patient6$gender === void 0 ? void 0 : _$Patient6$gender[0]) !== null && _$Patient$gender$ !== void 0 ? _$Patient$gender$ : '',
31699
31747
  "appointmentId": (_$id2 = _ === null || _ === void 0 ? void 0 : _.id) !== null && _$id2 !== void 0 ? _$id2 : ''
@@ -31745,10 +31793,10 @@ var GET_PRACTITIONER_AGAINST_SPECIALITY = createAsyncThunk("getPendingReschedule
31745
31793
  case 5:
31746
31794
  data = _context3.sent;
31747
31795
  returnedData = data !== null && data !== void 0 && (_data$result2 = data.result) !== null && _data$result2 !== void 0 && (_data$result2$ = _data$result2[0]) !== null && _data$result2$ !== void 0 && _data$result2$.Practitioner ? data === null || data === void 0 ? void 0 : (_data$result3 = data.result) === null || _data$result3 === void 0 ? void 0 : (_data$result3$ = _data$result3[0]) === null || _data$result3$ === void 0 ? void 0 : (_data$result3$$Practi = _data$result3$.Practitioner) === null || _data$result3$$Practi === void 0 ? void 0 : _data$result3$$Practi.map(function (_) {
31748
- var _$name$0$text2, _$name2, _$name2$, _$practitioner_role$c, _$practitioner_role, _$practitioner_role$c2, _$practitioner_role$c3, _$id3, _$practitioner_role$S, _$practitioner_role2, _$practitioner_role2$;
31796
+ var _$name2, _$practitioner_role$c, _$practitioner_role, _$practitioner_role$c2, _$practitioner_role$c3, _$id3, _$practitioner_role$S, _$practitioner_role2, _$practitioner_role2$;
31749
31797
 
31750
31798
  return {
31751
- label: (_$name$0$text2 = _ === null || _ === void 0 ? void 0 : (_$name2 = _.name) === null || _$name2 === void 0 ? void 0 : (_$name2$ = _$name2[0]) === null || _$name2$ === void 0 ? void 0 : _$name2$.text) !== null && _$name$0$text2 !== void 0 ? _$name$0$text2 : '',
31799
+ label: makeName(_ === null || _ === void 0 ? void 0 : (_$name2 = _.name) === null || _$name2 === void 0 ? void 0 : _$name2[0]),
31752
31800
  //name
31753
31801
  value: (_$practitioner_role$c = _ === null || _ === void 0 ? void 0 : (_$practitioner_role = _.practitioner_role) === null || _$practitioner_role === void 0 ? void 0 : (_$practitioner_role$c2 = _$practitioner_role.coding) === null || _$practitioner_role$c2 === void 0 ? void 0 : (_$practitioner_role$c3 = _$practitioner_role$c2[0]) === null || _$practitioner_role$c3 === void 0 ? void 0 : _$practitioner_role$c3.display) !== null && _$practitioner_role$c !== void 0 ? _$practitioner_role$c : '',
31754
31802
  //role
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primary_care_admin_binder",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -8,7 +8,8 @@
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
9
  "docs": "jsdoc -c jsdoc.conf.json",
10
10
  "build": "rollup -c rollup.config.js",
11
- "start": "rollup -c -w"
11
+ "start": "rollup -c -w",
12
+ "local:link": "npm run build && npm link && npm start"
12
13
  },
13
14
  "keywords": [],
14
15
  "author": "",