primary_care_admin_binder 0.1.139 → 0.1.141

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 +492 -490
  2. package/package.json +2 -1
package/dist/index.cjs.js CHANGED
@@ -8450,9 +8450,11 @@ var queries$o = {
8450
8450
  practitioner_by_id: function practitioner_by_id(id) {
8451
8451
  return {
8452
8452
  db_name: dbName,
8453
- entity: "Practitioner",
8454
- filter: "Practitioner._key=='".concat(id, "' && Practitioner.activestatus==true"),
8455
- return_fields: "merge(adqolcPractitioner,{identifier:(FOR iden IN DOCUMENT(adqolcPractitioner.personid).identifier RETURN MERGE(iden,{code:KEEP(DOCUMENT(iden.code),'_id','display'),use:KEEP(DOCUMENT(iden.use),'_id','display'),attachments:(for att in iden.attachments FILTER document(att).activestatus == true RETURN KEEP(document(att),'url','fileName','fileid','objectid','filetype','_id'))})),address:(FOR addr IN document(adqolcPractitioner.personid).address RETURN MERGE(addr,{use:KEEP(DOCUMENT(addr.use),'_id','display'),type:KEEP(DOCUMENT(addr.type),'_id','display'),city:KEEP(DOCUMENT(addr.city),'_id','geogLevelName'),district:KEEP(DOCUMENT(addr.district),'_id','geogLevelName'),state:KEEP(DOCUMENT(addr.state),'_id','geogLevelName'),postalcode:KEEP(DOCUMENT(addr.postalcode),'_id','geogLevelName'),country:KEEP(DOCUMENT(addr.country),'_id','geogLevelName')})),communication:(FOR coms IN DOCUMENT(adqolcPractitioner.personid).communicationlanguage RETURN KEEP(DOCUMENT(coms),'_id','display')),marital_status:KEEP(DOCUMENT(DOCUMENT(adqolcPractitioner.personid).maritalstatus),'_id','display'),birthdate:DOCUMENT(adqolcPractitioner.personid).birthdate,name:(FOR name IN DOCUMENT(adqolcPractitioner.personid).name RETURN MERGE(name,{use:KEEP(DOCUMENT(name.use),'_id','display'),prefix:KEEP(DOCUMENT(name.prefix),'_id','display')})),nationality:KEEP(DOCUMENT(DOCUMENT(adqolcPractitioner.personid).nationality),'_id','geogLevelName'),practitioner_type:KEEP(DOCUMENT(adqolcPractitioner.practitioner_type),'_id','display'),gender:KEEP(DOCUMENT(DOCUMENT(adqolcPractitioner.personid).gender),'_id','display'),practitioner_role:(FOR pro IN adqolcPractitioner.practitioner_role RETURN MERGE(pro,{role:KEEP(DOCUMENT(pro.role),'_id','display'),specialtyid:KEEP(DOCUMENT(pro.specialtyid),'_id','display'),entitytype:KEEP(DOCUMENT(pro.entitytype),'_id','display'),entityname:DOCUMENT(pro.entityname),locationid:dOCUMENT(pro.locationid)})),telecom:(FOR tel IN DOCUMENT(adqolcPractitioner.personid).telecom RETURN MERGE(tel,{system:KEEP(DOCUMENT(tel.system),'_id','display'),use:KEEP(DOCUMENT(tel.use),'_id','display')})),photo:DOCUMENT(DOCUMENT(adqolcPractitioner.personid).photo)})"
8453
+ queryid: "4daba280-4b41-40a5-94bc-75b2ae38e8db",
8454
+ filter: {
8455
+ key: "".concat(id),
8456
+ activestatus: true
8457
+ }
8456
8458
  };
8457
8459
  },
8458
8460
  practitioner_list: function practitioner_list() {
@@ -8461,14 +8463,12 @@ var queries$o = {
8461
8463
  var search = arguments.length > 2 ? arguments[2] : undefined;
8462
8464
  return {
8463
8465
  db_name: dbName,
8464
- entity: "Practitioner",
8465
- sort: "adqolcPractitioner .createddate desc",
8466
- filter: "(like(FIRST(DOCUMENT(adqolcPractitioner .personid).name[*].fulname),'%".concat(search, "%',true) || like(DOCUMENT(adqolcPractitioner .practitioner_type).display,'%").concat(search, "%',true) || like(document(document(document(adqolcPractitioner .practitioner_role[0]).specialtyid).coding[0]).display,'%").concat(search, "%',true)|| LIKE(document(adqolcPractitioner .practitioner_role[0].specialtyid).display,'%").concat(search, "%',TRUE)) && adqolcPractitioner .activestatus==true"),
8467
- limit: {
8468
- "offset": page,
8469
- "count": perPage
8470
- },
8471
- return_fields: "{TotalCount:count(FOR prt IN Practitioner FILTER (like(FIRST(DOCUMENT(prt.personid).name[*].fulname),'%%',true) || like(DOCUMENT(prt.practitioner_type).display,'%%',true) || like(document(document(document(prt.practitioner_role[0]).specialtyid).coding[0]).display,'%%',true)|| LIKE(document(prt.practitioner_role[0].specialtyid).display,'%%',TRUE)) && prt.activestatus==true return prt._id),id:adqolcPractitioner ._id,name:CONCAT(FIRST(DOCUMENT(DOCUMENT(adqolcPractitioner .personid).name[*].prefix)[*].display),' ',FIRST(DOCUMENT(adqolcPractitioner .personid).name[*].fulname)),type:DOCUMENT(adqolcPractitioner .practitioner_type).display,_key:adqolcPractitioner ._key,status:adqolcPractitioner.active,Practitionerrole:(FOR rle IN adqolcPractitioner .practitioner_role RETURN MERGE(rle,{role:KEEP(DOCUMENT(rle.role),'_id','display'),specialtyid:KEEP(DOCUMENt(rle.specialtyid),'_id','display')}))}"
8466
+ queryid: "b1b6a289-71c1-449a-be57-c6b7cddff699",
8467
+ filter: {
8468
+ search: "".concat(search),
8469
+ offset: page,
8470
+ count: perPage
8471
+ }
8472
8472
  };
8473
8473
  },
8474
8474
  status_update_practitioner: function status_update_practitioner(data) {
@@ -8488,11 +8488,12 @@ var queries$o = {
8488
8488
  },
8489
8489
  get_entity_by_id: function get_entity_by_id(id) {
8490
8490
  return {
8491
- "db_name": dbName,
8492
- "entity": "Organization",
8493
- "sort": "Organization.name",
8494
- "filter": "Organization.activestatus==true && Organization.OrgType any =='".concat(id, "'"),
8495
- "return_fields": "{_id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,alias:Organization.alias}"
8491
+ db_name: dbName,
8492
+ queryid: "3265e287-5a0e-482d-a2e9-d6ee96e83c9a",
8493
+ filter: {
8494
+ activestatus: true,
8495
+ orgType: "".concat(id)
8496
+ }
8496
8497
  };
8497
8498
  }
8498
8499
  };
@@ -8611,11 +8612,11 @@ var PRACTITIONER_LIST_READ = createAsyncThunk("practitionerSlice/practitioner",
8611
8612
  _context3.n = 2;
8612
8613
  return fetchData({
8613
8614
  body: JSON.stringify(queries$o.practitioner_list(payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.search ? payload === null || payload === void 0 ? void 0 : payload.search : ''))
8614
- }, __readDocumentUrl__);
8615
+ }, __baseUrl__$1);
8615
8616
  case 2:
8616
8617
  data = _context3.v;
8617
8618
  arry = [];
8618
- data.result.map(function (val) {
8619
+ data.map(function (val) {
8619
8620
  var _val$Practitionerrole;
8620
8621
  // if(val.name){
8621
8622
  arry.push({
@@ -8730,11 +8731,11 @@ var GET_ENTITY_BY_ID = createAsyncThunk("practitionerSlice/get_entity_id", /*#__
8730
8731
  _context6.n = 2;
8731
8732
  return fetchData({
8732
8733
  body: JSON.stringify(queries$o.get_entity_by_id(id))
8733
- }, __readDocumentUrl__);
8734
+ }, __baseUrl__$1);
8734
8735
  case 2:
8735
8736
  data = _context6.v;
8736
8737
  arry = [];
8737
- data.result.map(function (value) {
8738
+ data.map(function (value) {
8738
8739
  var _value$name, _value$_id;
8739
8740
  arry.push(_objectSpread2({
8740
8741
  label: (_value$name = value === null || value === void 0 ? void 0 : value.name) !== null && _value$name !== void 0 ? _value$name : "",
@@ -8811,150 +8812,88 @@ var practitionerActions$1 = {
8811
8812
  };
8812
8813
  var practitionerSlice$1 = practitionerSlice.reducer;
8813
8814
 
8815
+ var codingMasterFilter = function codingMasterFilter(type) {
8816
+ return {
8817
+ db_name: _dbName,
8818
+ queryid: "95931016-caf1-413c-8bf5-96f05c5709fb",
8819
+ filter: {
8820
+ type: type,
8821
+ status: true,
8822
+ activestatus: true
8823
+ }
8824
+ };
8825
+ };
8814
8826
  var masterQuery$7 = {
8815
- "id_type": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='ALTERNATEIDTYPE' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8816
- "id_number": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='RELATIONSHIP' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8817
- "prefix": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='NAMEPREFIX' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8818
- "suffix": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='NAMESUFFIX' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8819
- "gender": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='GENDER' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8820
- "use": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='USE' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8821
- "practitioner_type": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='PRACTTYPE' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8822
- "Communication_languages": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='LANGUAGE' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8823
- "speciality": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='SPECIALTY' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8824
- // "entity": `{
8825
- // "db_name": "${_dbName}",
8826
- // "entity": "Organization",
8827
- // "filter": "Organization.OrgType!=[]",
8828
- // "return_fields": "DISTINCT Organization.OrgType[0]"
8829
- // }`,
8830
- "entity": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='ORGTYPE' && CodingMaster.status==true && CodingMaster.activestatus==true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8831
- // "entity_name": `{
8832
- // "db_name": "${_dbName}",
8833
- // "entity": "Organization",
8834
- // "filter": "'Hospital' IN Organization.OrgType",
8835
- // "return_fields": "{OrgID:Organization.id,name:Organization.name}"
8836
- // }`,
8837
- "entity_name": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"Organization\",\n \"filter\": \"Organization.activestatus==true\",\n \"return_fields\": \"{_id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,alias:Organization.alias}\"\n }"),
8838
- "Address_use": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='USE' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8839
- "contact_mode": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='CONTACTSYSTEM' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8840
- "priority": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='PRIORITY' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8841
- "address_type": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='ADDRESSTYPE' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8842
- "role": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='PRACTROLE' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8843
- "location": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"LocationMaster\",\n \"sort\":\"LocationMaster.shortdesc\",\n \"filter\": \"LocationMaster.activestatus==true && lower(LocationMaster.status)=='active' && LocationMaster.parentLocationID_desc == '' && LocationMaster.locationType != null\", \n \"return_fields\": \"LocationMaster\"\n }"),
8844
- // "city": `{
8845
- // "db_name": "${_dbName}",
8846
- // "entity": "SMGeographicMaster",
8847
- // "sort":"SMGeographicMaster.geogLevelName",
8848
- // "filter": "SMGeographicMaster.geogLevelType=='CITY' && SMGeographicMaster.activestatus == true",
8849
- // "return_fields": "{_id:SMGeographicMaster._id,id:SMGeographicMaster.id,geogLevelName:SMGeographicMaster.geogLevelName,parentGeogLevelType:SMGeographicMaster.parentGeogLevelType,parentGeogLevelCode:SMGeographicMaster.parentGeogLevelCode}"
8850
- // }`,
8851
- // "district": `{
8852
- // "db_name": "${_dbName}",
8853
- // "entity": "SMGeographicMaster",
8854
- // "sort":"SMGeographicMaster.geogLevelName",
8855
- // "filter": "SMGeographicMaster.geogLevelType=='DISTRICT' && SMGeographicMaster.geogLevelCode=='BLR' && SMGeographicMaster.activestatus == true",
8856
- // "return_fields": "{_id:SMGeographicMaster._id,id:SMGeographicMaster.id,geogLevelName:SMGeographicMaster.geogLevelName,parentGeogLevelType:SMGeographicMaster.parentGeogLevelType,parentGeogLevelCode:SMGeographicMaster.parentGeogLevelCode}"
8857
- // }`,
8858
- // "state": `{
8859
- // "db_name": "${_dbName}",
8860
- // "entity": "SMGeographicMaster",
8861
- // "sort":"SMGeographicMaster.geogLevelName",
8862
- // "filter": "SMGeographicMaster.geogLevelType=='STATE' && SMGeographicMaster.geogLevelCode=='KAR' && SMGeographicMaster.activestatus == true",
8863
- // "return_fields": "{_id:SMGeographicMaster._id,id:SMGeographicMaster.id,geogLevelName:SMGeographicMaster.geogLevelName,parentGeogLevelType:SMGeographicMaster.parentGeogLevelType,parentGeogLevelCode:SMGeographicMaster.parentGeogLevelCode}"
8864
- // }`,
8865
- // "country": `{
8866
- // "db_name": "${_dbName}",
8867
- // "entity": "SMGeographicMaster",
8868
- // "sort":"SMGeographicMaster.geogLevelName",
8869
- // "filter": "SMGeographicMaster.geogLevelType=='COUNTRY' && SMGeographicMaster.activestatus == true",
8870
- // "return_fields": "{_id:SMGeographicMaster._id,id:SMGeographicMaster.id,geogLevelName:SMGeographicMaster.geogLevelName,parentGeogLevelType:SMGeographicMaster.parentGeogLevelType,parentGeogLevelCode:SMGeographicMaster.parentGeogLevelCode}"
8871
- // }`,
8872
- // "country": `{
8873
- // "db_name": "primarycare",
8874
- // "entity": "SMGeographicMaster",
8875
- // "sort": "SMGeographicMaster.geogLevelName",
8876
- // "filter": "document(SMGeographicMaster.geogLevelType).code=='GE002' && SMGeographicMaster.activestatus == true",
8877
- // "return_fields": "{_id:SMGeographicMaster._id,id:SMGeographicMaster.id,geogLevelName:SMGeographicMaster.geogLevelName,geogLevelCode:SMGeographicMaster.geogLevelCode,parentGeogLevelType:SMGeographicMaster.parentGeogLevelType,parentGeogLevelCode:SMGeographicMaster.parentGeogLevelCode}"
8878
- // }`,
8879
- "position": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='POSITION' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8880
- "employee_type": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='EMPSTATUS' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8881
- "marital_status": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"CodingMaster\",\n \"sort\":\"CodingMaster.display\",\n \"filter\": \"CodingMaster.Type=='MARITALSTATUS' && CodingMaster.status == true && CodingMaster.activestatus == true\",\n \"return_fields\": \"CodingMaster\"\n }"),
8882
- "nationality": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"SMGeographicMaster\",\n \"sort\": \"SMGeographicMaster.geogLevelName\",\n \"filter\": \"lower(document(SMGeographicMaster.geogLevelType).display)=='country' && SMGeographicMaster.activestatus == true && SMGeographicMaster.active== true\",\n \"return_fields\": \"{_id:SMGeographicMaster._id,id:SMGeographicMaster.id,geogLevelName:SMGeographicMaster.geogLevelName,parentGeogLevelType:SMGeographicMaster.parentGeogLevelType,parentGeogLevelCode:SMGeographicMaster.parentGeogLevelCode}\"\n }"),
8883
- "country_code": "{\n \"db_name\": \"".concat(_dbName, "\",\n \"entity\": \"SMGeographicMaster\",\n \"sort\": \"SMGeographicMaster.GeoLocationISDCode\",\n \"filter\": \"lower(document(SMGeographicMaster.geogLevelType).display)=='country' && SMGeographicMaster.activestatus == true && SMGeographicMaster.active == true\",\n \"return_fields\": \"{_id:SMGeographicMaster._id,id:SMGeographicMaster.id,geogLevelName:SMGeographicMaster.geogLevelName,parentGeogLevelType:SMGeographicMaster.parentGeogLevelType,parentGeogLevelCode:SMGeographicMaster.parentGeogLevelCode,GeoLocationISDCode:SMGeographicMaster.GeoLocationISDCode}\"\n }")
8827
+ id_type: JSON.stringify(codingMasterFilter("ALTERNATEIDTYPE")),
8828
+ id_number: JSON.stringify(codingMasterFilter("RELATIONSHIP")),
8829
+ prefix: JSON.stringify(codingMasterFilter("NAMEPREFIX")),
8830
+ suffix: JSON.stringify(codingMasterFilter("NAMESUFFIX")),
8831
+ gender: JSON.stringify(codingMasterFilter("GENDER")),
8832
+ use: JSON.stringify(codingMasterFilter("USE")),
8833
+ practitioner_type: JSON.stringify(codingMasterFilter("PRACTTYPE")),
8834
+ Communication_languages: JSON.stringify(codingMasterFilter("LANGUAGE")),
8835
+ speciality: JSON.stringify(codingMasterFilter("SPECIALTY")),
8836
+ entity: JSON.stringify(codingMasterFilter("ORGTYPE")),
8837
+ Address_use: JSON.stringify(codingMasterFilter("USE")),
8838
+ contact_mode: JSON.stringify(codingMasterFilter("CONTACTSYSTEM")),
8839
+ priority: JSON.stringify(codingMasterFilter("PRIORITY")),
8840
+ address_type: JSON.stringify(codingMasterFilter("ADDRESSTYPE")),
8841
+ role: JSON.stringify(codingMasterFilter("PRACTROLE")),
8842
+ position: JSON.stringify(codingMasterFilter("POSITION")),
8843
+ employee_type: JSON.stringify(codingMasterFilter("EMPSTATUS")),
8844
+ marital_status: JSON.stringify(codingMasterFilter("MARITALSTATUS")),
8845
+ entity_name: "{\n \"db_name\": \"".concat(_dbName, "\",\n \"queryid\": \"9f065c19-10c9-41e1-b925-53458964974f\", \n \"filter\": {\n \"activestatus\": true\n }\n }"),
8846
+ location: "{\n \"db_name\": \"".concat(_dbName, "\",\n \"queryid\": \"c27d71be-6c29-4024-aab3-1dd0a0a88c32\", \n \"filter\": {\n \"activestatus\": true, \n \"status\": \"active\", \n \"parentLocationId\": \"\",\n \"locationtype\": null,\n \"organizationId\": null\n }\n }"),
8847
+ nationality: "{\n \"db_name\": \"".concat(_dbName, "\",\n \"queryid\": \"d3659637-f0aa-4e0d-86d6-61fd445f7dd5\",\n \"filter\":{\n \"display\": \"country\",\n \"activestatus\": true,\n \"active\": true,\n \"sort\":\"geogLevelName\"\n }\n }"),
8848
+ country_code: "{\n \"db_name\": \"".concat(_dbName, "\",\n \"queryid\": \"d3659637-f0aa-4e0d-86d6-61fd445f7dd5\",\n \"filter\":{\n \"display\": \"country\",\n \"activestatus\": true,\n \"active\": true,\n \"sort\":\"GeoLocationISDCode\"\n }\n }")
8849
+ };
8850
+ var geoQuery = function geoQuery(display, geogLevelCode) {
8851
+ return {
8852
+ db_name: _dbName,
8853
+ queryid: "ad647bcf-edcc-44ac-9ca9-67c3b277b8df",
8854
+ filter: _objectSpread2({
8855
+ activestatus: true,
8856
+ display: display
8857
+ }, geogLevelCode ? {
8858
+ geoglevelcode: geogLevelCode
8859
+ } : {})
8860
+ };
8884
8861
  };
8885
8862
  var masterqueries = {
8886
8863
  country: function country() {
8887
8864
  return {
8888
- "db_name": _dbName,
8889
- "entity": "SMGeographicMaster",
8890
- "sort": "SMGeographicMaster.geogLevelName",
8891
- "filter": "document(SMGeographicMaster.geogLevelType).code=='GE002' && SMGeographicMaster.activestatus == true",
8892
- "return_fields": "{_id:SMGeographicMaster._id,id:SMGeographicMaster.id,geogLevelName:SMGeographicMaster.geogLevelName,geogLevelCode:SMGeographicMaster.geogLevelCode,parentGeogLevelType:SMGeographicMaster.parentGeogLevelType,parentGeogLevelCode:SMGeographicMaster.parentGeogLevelCode}"
8865
+ db_name: _dbName,
8866
+ queryid: "2daa7e4a-bff4-4d1c-a5f9-d0fa6c82bd4a",
8867
+ filter: {
8868
+ code: "GE002",
8869
+ activestatus: true
8870
+ }
8893
8871
  };
8894
8872
  },
8895
- state_by_country: function state_by_country(geogLevelCode) {
8896
- return {
8897
- "db_name": _dbName,
8898
- "entity": "SMGeographicMaster",
8899
- "filter": "SMGeographicMaster.activestatus==true && lower(document(SMGeographicMaster.geogLevelType).display)=='state' && lower(document(SMGeographicMaster.parentGeogLevelCode).geogLevelCode)==lower('".concat(geogLevelCode, "')"),
8900
- "return_fields": "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.activestatus,_key:SMGeographicMaster._key}"
8901
- };
8873
+ state_by_country: function state_by_country(code) {
8874
+ return geoQuery("state", code);
8902
8875
  },
8903
- district_by_state: function district_by_state(geogLevelCode) {
8904
- return {
8905
- "db_name": _dbName,
8906
- "entity": "SMGeographicMaster",
8907
- "filter": "SMGeographicMaster.activestatus==true && lower(document(SMGeographicMaster.geogLevelType).display)=='district' && lower(document(SMGeographicMaster.parentGeogLevelCode).geogLevelCode)==lower('".concat(geogLevelCode, "')"),
8908
- "return_fields": "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.activestatus,_key:SMGeographicMaster._key}"
8909
- };
8876
+ district_by_state: function district_by_state(code) {
8877
+ return geoQuery("district", code);
8910
8878
  },
8911
- city_by_district: function city_by_district(geogLevelCode) {
8912
- return {
8913
- "db_name": _dbName,
8914
- "entity": "SMGeographicMaster",
8915
- "filter": "SMGeographicMaster.activestatus==true && lower(document(SMGeographicMaster.geogLevelType).display)=='city' && lower(document(SMGeographicMaster.parentGeogLevelCode).geogLevelCode)==lower('".concat(geogLevelCode, "')"),
8916
- "return_fields": "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.activestatus,_key:SMGeographicMaster._key}"
8917
- };
8879
+ city_by_district: function city_by_district(code) {
8880
+ return geoQuery("city", code);
8918
8881
  },
8919
- pincode_by_city: function pincode_by_city(geogLevelCode) {
8920
- return {
8921
- "db_name": _dbName,
8922
- "entity": "SMGeographicMaster",
8923
- "filter": "SMGeographicMaster.activestatus==true && lower(document(SMGeographicMaster.geogLevelType).display)=='pincode' && lower(document(SMGeographicMaster.parentGeogLevelCode).geogLevelCode)==lower('".concat(geogLevelCode, "')"),
8924
- "return_fields": "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.activestatus,_key:SMGeographicMaster._key}"
8925
- };
8882
+ pincode_by_city: function pincode_by_city(code) {
8883
+ return geoQuery("pincode", code);
8926
8884
  },
8885
+ // without parent code
8927
8886
  state_by_country_: function state_by_country_() {
8928
- return {
8929
- "db_name": _dbName,
8930
- "entity": "SMGeographicMaster",
8931
- "filter": "SMGeographicMaster.activestatus==true && lower(document(SMGeographicMaster.geogLevelType).display)=='state'",
8932
- "return_fields": "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.activestatus,_key:SMGeographicMaster._key}"
8933
- };
8887
+ return geoQuery("state");
8934
8888
  },
8935
8889
  district_by_state_: function district_by_state_() {
8936
- return {
8937
- "db_name": _dbName,
8938
- "entity": "SMGeographicMaster",
8939
- "filter": "SMGeographicMaster.activestatus==true && lower(document(SMGeographicMaster.geogLevelType).display)=='district'",
8940
- "return_fields": "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.activestatus,_key:SMGeographicMaster._key}"
8941
- };
8890
+ return geoQuery("district");
8942
8891
  },
8943
8892
  city_by_district_: function city_by_district_() {
8944
- return {
8945
- "db_name": _dbName,
8946
- "entity": "SMGeographicMaster",
8947
- "filter": "SMGeographicMaster.activestatus==true && lower(document(SMGeographicMaster.geogLevelType).display)=='city'",
8948
- "return_fields": "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.activestatus,_key:SMGeographicMaster._key}"
8949
- };
8893
+ return geoQuery("city");
8950
8894
  },
8951
8895
  pincode_by_city_: function pincode_by_city_() {
8952
- return {
8953
- "db_name": _dbName,
8954
- "entity": "SMGeographicMaster",
8955
- "filter": "SMGeographicMaster.activestatus==true && lower(document(SMGeographicMaster.geogLevelType).display)=='pincode'",
8956
- "return_fields": "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.activestatus,_key:SMGeographicMaster._key}"
8957
- };
8896
+ return geoQuery("pincode");
8958
8897
  }
8959
8898
  };
8960
8899
 
@@ -9361,11 +9300,11 @@ var fetchMaster$8 = function fetchMaster(name, query) {
9361
9300
  _context3.n = 1;
9362
9301
  return fetchData({
9363
9302
  body: query
9364
- }, __readDocumentUrl__);
9303
+ }, __baseUrl__$1);
9365
9304
  case 1:
9366
9305
  data = _context3.v;
9367
9306
  resolve({
9368
- data: data.result,
9307
+ data: data,
9369
9308
  name: name
9370
9309
  });
9371
9310
  case 2:
@@ -9413,13 +9352,7 @@ var PRACTITIONER_GET_BY_ID = createAsyncThunk("practitionerMasterSlice/practitio
9413
9352
  _ref7,
9414
9353
  rejectWithValue,
9415
9354
  id,
9416
- masterlist,
9417
9355
  data,
9418
- country_data,
9419
- state_data,
9420
- district_data,
9421
- city_data,
9422
- pincode_data,
9423
9356
  readJSON,
9424
9357
  _args5 = arguments,
9425
9358
  _t2;
@@ -9433,44 +9366,44 @@ var PRACTITIONER_GET_BY_ID = createAsyncThunk("practitionerMasterSlice/practitio
9433
9366
  _context5.n = 2;
9434
9367
  return loopMasters$8();
9435
9368
  case 2:
9436
- masterlist = _context5.v;
9369
+ _context5.v;
9437
9370
  _context5.n = 3;
9438
9371
  return fetchData({
9439
9372
  body: JSON.stringify(queries$o.practitioner_by_id(id))
9440
- }, __readDocumentUrl__);
9373
+ }, __baseUrl__$1);
9441
9374
  case 3:
9442
9375
  data = _context5.v;
9443
9376
  _context5.n = 4;
9444
9377
  return fetchData({
9445
9378
  body: JSON.stringify(masterqueries.country())
9446
- }, __readDocumentUrl__);
9379
+ }, __baseUrl__$1);
9447
9380
  case 4:
9448
- country_data = _context5.v;
9381
+ _context5.v;
9449
9382
  _context5.n = 5;
9450
9383
  return fetchData({
9451
9384
  body: JSON.stringify(masterqueries.state_by_country_())
9452
- }, __readDocumentUrl__);
9385
+ }, __baseUrl__$1);
9453
9386
  case 5:
9454
- state_data = _context5.v;
9387
+ _context5.v;
9455
9388
  _context5.n = 6;
9456
9389
  return fetchData({
9457
9390
  body: JSON.stringify(masterqueries.district_by_state_())
9458
- }, __readDocumentUrl__);
9391
+ }, __baseUrl__$1);
9459
9392
  case 6:
9460
- district_data = _context5.v;
9393
+ _context5.v;
9461
9394
  _context5.n = 7;
9462
9395
  return fetchData({
9463
9396
  body: JSON.stringify(masterqueries.city_by_district_())
9464
- }, __readDocumentUrl__);
9397
+ }, __baseUrl__$1);
9465
9398
  case 7:
9466
- city_data = _context5.v;
9399
+ _context5.v;
9467
9400
  _context5.n = 8;
9468
9401
  return fetchData({
9469
9402
  body: JSON.stringify(masterqueries.pincode_by_city_())
9470
- }, __readDocumentUrl__);
9403
+ }, __baseUrl__$1);
9471
9404
  case 8:
9472
- pincode_data = _context5.v;
9473
- readJSON = generateReadJSON$5(data.result[0] ? data.result[0] : null, masterlist, country_data === null || country_data === void 0 ? void 0 : country_data.result, state_data === null || state_data === void 0 ? void 0 : state_data.result, district_data === null || district_data === void 0 ? void 0 : district_data.result, city_data === null || city_data === void 0 ? void 0 : city_data.result, pincode_data === null || pincode_data === void 0 ? void 0 : pincode_data.result);
9405
+ _context5.v;
9406
+ readJSON = generateReadJSON$5(data[0] ? data[0] : null);
9474
9407
  return _context5.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
9475
9408
  data: readJSON
9476
9409
  }));
@@ -9487,7 +9420,6 @@ var PRACTITIONER_COUNTRY_MASTER = createAsyncThunk("practitionerMasterSlice/prac
9487
9420
  var payload,
9488
9421
  _ref9,
9489
9422
  rejectWithValue,
9490
- _data$result,
9491
9423
  data,
9492
9424
  arr,
9493
9425
  _args6 = arguments,
@@ -9502,12 +9434,12 @@ var PRACTITIONER_COUNTRY_MASTER = createAsyncThunk("practitionerMasterSlice/prac
9502
9434
  _context6.n = 2;
9503
9435
  return fetchData({
9504
9436
  body: JSON.stringify(masterqueries.country())
9505
- }, __readDocumentUrl__);
9437
+ }, __baseUrl__$1);
9506
9438
  case 2:
9507
9439
  data = _context6.v;
9508
9440
  arr = [];
9509
- if (Array.isArray(data.result) && (data === null || data === void 0 || (_data$result = data.result) === null || _data$result === void 0 ? void 0 : _data$result.length) > 0) {
9510
- data === null || data === void 0 || data.result.map(function (val) {
9441
+ if (Array.isArray(data) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
9442
+ data === null || data === void 0 || data.map(function (val) {
9511
9443
  arr.push(_objectSpread2({
9512
9444
  label: val.geogLevelName,
9513
9445
  value: val._id
@@ -9530,7 +9462,6 @@ var PRACTITIONER_STATE_MASTER = createAsyncThunk("practitionerMasterSlice/practi
9530
9462
  var payload,
9531
9463
  _ref1,
9532
9464
  rejectWithValue,
9533
- _data$result2,
9534
9465
  geogLevelCode,
9535
9466
  data,
9536
9467
  arr,
@@ -9546,12 +9477,12 @@ var PRACTITIONER_STATE_MASTER = createAsyncThunk("practitionerMasterSlice/practi
9546
9477
  _context7.n = 2;
9547
9478
  return fetchData({
9548
9479
  body: JSON.stringify(masterqueries.state_by_country(geogLevelCode))
9549
- }, __readDocumentUrl__);
9480
+ }, __baseUrl__$1);
9550
9481
  case 2:
9551
9482
  data = _context7.v;
9552
9483
  arr = [];
9553
- if (Array.isArray(data.result) && (data === null || data === void 0 || (_data$result2 = data.result) === null || _data$result2 === void 0 ? void 0 : _data$result2.length) > 0) {
9554
- data === null || data === void 0 || data.result.map(function (val) {
9484
+ if (Array.isArray(data) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
9485
+ data === null || data === void 0 || data.map(function (val) {
9555
9486
  arr.push(_objectSpread2({
9556
9487
  label: val.geogLevelName,
9557
9488
  value: val._id
@@ -9574,7 +9505,6 @@ var PRACTITIONER_DISTRICT_MASTER = createAsyncThunk("practitionerMasterSlice/pra
9574
9505
  var payload,
9575
9506
  _ref11,
9576
9507
  rejectWithValue,
9577
- _data$result3,
9578
9508
  geogLevelCode,
9579
9509
  data,
9580
9510
  arr,
@@ -9590,12 +9520,12 @@ var PRACTITIONER_DISTRICT_MASTER = createAsyncThunk("practitionerMasterSlice/pra
9590
9520
  _context8.n = 2;
9591
9521
  return fetchData({
9592
9522
  body: JSON.stringify(masterqueries.district_by_state(geogLevelCode))
9593
- }, __readDocumentUrl__);
9523
+ }, __baseUrl__$1);
9594
9524
  case 2:
9595
9525
  data = _context8.v;
9596
9526
  arr = [];
9597
- if (Array.isArray(data.result) && (data === null || data === void 0 || (_data$result3 = data.result) === null || _data$result3 === void 0 ? void 0 : _data$result3.length) > 0) {
9598
- data === null || data === void 0 || data.result.map(function (val) {
9527
+ if (Array.isArray(data) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
9528
+ data === null || data === void 0 || data.map(function (val) {
9599
9529
  arr.push(_objectSpread2({
9600
9530
  label: val.geogLevelName,
9601
9531
  value: val._id
@@ -9618,7 +9548,6 @@ var PRACTITIONER_CITY_MASTER = createAsyncThunk("practitionerMasterSlice/practit
9618
9548
  var payload,
9619
9549
  _ref13,
9620
9550
  rejectWithValue,
9621
- _data$result4,
9622
9551
  geogLevelCode,
9623
9552
  data,
9624
9553
  arr,
@@ -9634,12 +9563,12 @@ var PRACTITIONER_CITY_MASTER = createAsyncThunk("practitionerMasterSlice/practit
9634
9563
  _context9.n = 2;
9635
9564
  return fetchData({
9636
9565
  body: JSON.stringify(masterqueries.city_by_district(geogLevelCode))
9637
- }, __readDocumentUrl__);
9566
+ }, __baseUrl__$1);
9638
9567
  case 2:
9639
9568
  data = _context9.v;
9640
9569
  arr = [];
9641
- if (Array.isArray(data.result) && (data === null || data === void 0 || (_data$result4 = data.result) === null || _data$result4 === void 0 ? void 0 : _data$result4.length) > 0) {
9642
- data === null || data === void 0 || data.result.map(function (val) {
9570
+ if (Array.isArray(data) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
9571
+ data === null || data === void 0 || data.map(function (val) {
9643
9572
  arr.push(_objectSpread2({
9644
9573
  label: val.geogLevelName,
9645
9574
  value: val._id
@@ -9662,7 +9591,6 @@ var PRACTITIONER_PINCODE_MASTER = createAsyncThunk("practitionerMasterSlice/prac
9662
9591
  var payload,
9663
9592
  _ref15,
9664
9593
  rejectWithValue,
9665
- _data$result5,
9666
9594
  geogLevelCode,
9667
9595
  data,
9668
9596
  arr,
@@ -9678,12 +9606,12 @@ var PRACTITIONER_PINCODE_MASTER = createAsyncThunk("practitionerMasterSlice/prac
9678
9606
  _context0.n = 2;
9679
9607
  return fetchData({
9680
9608
  body: JSON.stringify(masterqueries.pincode_by_city(geogLevelCode))
9681
- }, __readDocumentUrl__);
9609
+ }, __baseUrl__$1);
9682
9610
  case 2:
9683
9611
  data = _context0.v;
9684
9612
  arr = [];
9685
- if (Array.isArray(data.result) && (data === null || data === void 0 || (_data$result5 = data.result) === null || _data$result5 === void 0 ? void 0 : _data$result5.length) > 0) {
9686
- data === null || data === void 0 || data.result.map(function (val) {
9613
+ if (Array.isArray(data) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
9614
+ data === null || data === void 0 || data.map(function (val) {
9687
9615
  arr.push(_objectSpread2({
9688
9616
  label: val.geogLevelName,
9689
9617
  value: val._id
@@ -26655,30 +26583,33 @@ var queries$d = {
26655
26583
  getTreeStuct: function getTreeStuct(type) {
26656
26584
  return {
26657
26585
  db_name: dbName,
26658
- entity: "Organization",
26659
- // filter: "'CodingMaster/11898' IN Organization.OrgType",
26660
- filter: "Organization.ParentOrgID ==[] && Organization.activestatus==true && Organization.isExternal==".concat(type.isexternal),
26661
- // return_fields: "MERGE(Organization,{Organization:(FOR org IN Organization FILTER Organization.id IN org.ParentOrgID AND 'CodingMaster/11899' IN org.OrgType RETURN MERGE(org,{facility:(FOR fac IN Organization FILTER 'CodingMaster/11058' IN fac.OrgType AND org.id IN fac.ParentOrgID RETURN fac)}) )})",
26662
- return_fields: "MERGE(Organization,{Organization:(FOR org IN Organization FILTER Organization.id IN org.ParentOrgID RETURN MERGE(org,{facility:(FOR fac IN Organization FILTER org.id IN fac.ParentOrgID RETURN fac)}) )})",
26663
- sort: "Organization.createddate desc"
26586
+ queryid: "1016e960-4f36-45f1-8e3e-c24e94de4e5b",
26587
+ filter: {
26588
+ ParentOrgID: [],
26589
+ activestatus: true,
26590
+ isExternal: "".concat(type.isexternal)
26591
+ }
26664
26592
  };
26665
26593
  },
26666
26594
  entityType: function entityType() {
26667
26595
  return {
26668
26596
  db_name: dbName,
26669
- entity: "CodeableConceptMaster",
26670
- sort: "document(CodeableConceptMaster.coding[0]).display",
26671
- filter: "CodeableConceptMaster.Type=='ORGTYPE' AND CodeableConceptMaster.activestatus==true",
26672
- return_fields: "MERGE(CodeableConceptMaster,{coding:(FOR cod IN TO_ARRAY(CodeableConceptMaster.coding) RETURN DOCUMENT(cod))})"
26597
+ queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
26598
+ filter: {
26599
+ type: "ORGTYPE",
26600
+ activestatus: true
26601
+ }
26673
26602
  };
26674
26603
  },
26675
26604
  getParentEntityFull: function getParentEntityFull() {
26676
26605
  return {
26677
26606
  db_name: dbName,
26678
- entity: "Organization",
26679
- sort: "Organization.name",
26680
- filter: "Organization.activestatus==true AND Organization.active==true",
26681
- return_fields: "{_id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,alias:Organization.alias}"
26607
+ queryid: "9f065c19-10c9-41e1-b925-53458964974f",
26608
+ filter: {
26609
+ activestatus: true,
26610
+ active: true,
26611
+ sortByName: true
26612
+ }
26682
26613
  };
26683
26614
  },
26684
26615
  getParentEntity: function getParentEntity(type) {
@@ -26691,11 +26622,11 @@ var queries$d = {
26691
26622
  // "{_id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,alias:Organization.alias}",
26692
26623
  // };
26693
26624
  return {
26694
- "db_name": dbName,
26695
- "entity": "Organization",
26696
- "sort": "Organization.name",
26697
- "filter": "Organization.activestatus==true AND Organization.active==true && Organization.isExternal==".concat(type.isexternal, " && DOCUMENT(Organization.OrgType)[*].code ANY == '").concat(type.entityType, "'"),
26698
- "return_fields": "{OrgType: Organization.OrgType, _id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,alias:Organization.alias}"
26625
+ db_name: dbName,
26626
+ entity: "Organization",
26627
+ sort: "Organization.name",
26628
+ filter: "Organization.activestatus==true AND Organization.active==true && Organization.isExternal==".concat(type.isexternal, " && DOCUMENT(Organization.OrgType)[*].code ANY == '").concat(type.entityType, "'"),
26629
+ return_fields: "{OrgType: Organization.OrgType, _id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,alias:Organization.alias}"
26699
26630
  };
26700
26631
  },
26701
26632
  getLevelOfCare: function getLevelOfCare() {
@@ -26710,49 +26641,60 @@ var queries$d = {
26710
26641
  orgUseIdenifi: function orgUseIdenifi() {
26711
26642
  return {
26712
26643
  db_name: dbName,
26713
- entity: "CodeableConceptMaster",
26714
- sort: "document(CodeableConceptMaster.coding[0]).display",
26715
- filter: "CodeableConceptMaster.Type=='USE' AND CodeableConceptMaster.activestatus==true",
26716
- return_fields: "MERGE(CodeableConceptMaster,{coding:(FOR cod IN TO_ARRAY(CodeableConceptMaster.coding) RETURN DOCUMENT(cod))})"
26644
+ queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
26645
+ filter: {
26646
+ type: "USE",
26647
+ activestatus: true
26648
+ }
26717
26649
  };
26718
26650
  },
26719
26651
  orgIdTypeIdenifi: function orgIdTypeIdenifi() {
26720
26652
  return {
26721
26653
  db_name: dbName,
26722
- entity: "CodeableConceptMaster",
26723
- sort: "document(CodeableConceptMaster.coding[0]).display",
26724
- filter: "CodeableConceptMaster.Type=='ORGIDENTIFICATIONTYPE' AND CodeableConceptMaster.activestatus==true",
26725
- return_fields: "MERGE(CodeableConceptMaster,{coding:(FOR cod IN TO_ARRAY(CodeableConceptMaster.coding) RETURN DOCUMENT(cod))})"
26654
+ queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
26655
+ filter: {
26656
+ type: "ORGIDENTIFICATIONTYPE",
26657
+ activestatus: true
26658
+ }
26726
26659
  };
26727
26660
  },
26728
26661
  aliastype: function aliastype() {
26729
26662
  return {
26730
26663
  db_name: dbName,
26731
- entity: "CodeableConceptMaster",
26732
- sort: "document(CodeableConceptMaster.coding[0]).display",
26733
- filter: "CodeableConceptMaster.Type=='ACCOUNTENTITYTYPE' AND CodeableConceptMaster.activestatus==true",
26734
- return_fields: "MERGE(CodeableConceptMaster,{coding:(FOR cod IN TO_ARRAY(CodeableConceptMaster.coding) RETURN DOCUMENT(cod))})"
26664
+ queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
26665
+ filter: {
26666
+ type: "ACCOUNTENTITYTYPE",
26667
+ activestatus: true
26668
+ }
26735
26669
  };
26736
26670
  },
26737
- //ORGANIZATION TREE DETAILS
26738
26671
  getTreeDetails: function getTreeDetails(_key) {
26739
26672
  return {
26740
26673
  db_name: dbName,
26741
- entity: "Organization",
26742
- filter: "Organization._key=='".concat(_key, "' AND Organization.activestatus==true"),
26743
- // filter: `Organization._key=='10044' AND Organization.activestatus==true`,
26744
- return_fields:
26745
- //"MERGE(Organization, {identifier:(FOR iden IN TO_ARRAY(Organization.identifier) RETURN MERGE(DOCUMENT(iden), {user:DOCUMENT(DOCUMENT(iden).user),period:(FOR per IN TO_ARRAY(DOCUMENT(iden).period) RETURN DOCUMENT(per) ),Type:DOCUMENT(DOCUMENT(iden).Type)})) , address:(FOR add IN TO_ARRAY(Organization.address) RETURN MERGE(DOCUMENT(add),{Type:DOCUMENT(DOCUMENT(add).Type),use:DOCUMENT(DOCUMENT(add).use),city:DOCUMENT(DOCUMENT(add).city),country:DOCUMENT(DOCUMENT(add).country),district:DOCUMENT(DOCUMENT(add).district),state:DOCUMENT(DOCUMENT(add).state),postalCode:DOCUMENT(DOCUMENT(add).postalCode)})) ,alias:(FOR alias IN TO_ARRAY(Organization.alias) RETURN MERGE(alias,{aliasType:DOCUMENT(alias.aliasType) ,aliasCode:DOCUMENT(alias.aliasCode) })) ,levelofcareid:DOCUMENT(Organization.levelofcareid) ,logo:(FOR attc IN TO_ARRAY(Organization.logo) RETURN DOCUMENT(attc)) ,telecom:(FOR tel IN TO_ARRAY(Organization.telecom) RETURN MERGE(DOCUMENT(tel),{system:DOCUMENT(DOCUMENT(tel).system),use:DOCUMENT(DOCUMENT(tel).use),rank:DOCUMENT(DOCUMENT(tel).rank) ,valueprefix:DOCUMENT(DOCUMENT(tel).valueprefix)})) , contact:(FOR cnt IN TO_ARRAY(Organization.contact) RETURN MERGE(cnt,{telecom:(FOR tel IN TO_ARRAY(cnt.telecom) RETURN MERGE(DOCUMENT(tel),{use:DOCUMENT(DOCUMENT(tel).use),system:DOCUMENT(DOCUMENT(tel).system),rank:DOCUMENT(DOCUMENT(tel).rank),valueprefix:DOCUMENT(DOCUMENT(tel).valueprefix) })),name:(FOR nm IN TO_ARRAY(cnt.name) RETURN MERGE(DOCUMENT(nm),{use:DOCUMENT(DOCUMENT(nm).use),prefix:DOCUMENT(DOCUMENT(nm).prefix),suffix:DOCUMENT(DOCUMENT(nm).suffix)})),designation:DOCUMENT(cnt.designation)}) ),OrgType:(FOR org IN TO_ARRAY(Organization.OrgType) RETURN DOCUMENT(org)),specialtyDetails:(FOR spec IN TO_ARRAY(Organization.specialtyDetails) RETURN MERGE(spec,{specialty:document(spec.specialty)})) })",
26746
- "MERGE(Organization, {identifier:(FOR iden IN TO_ARRAY(Organization.identifier) RETURN MERGE(DOCUMENT(iden), {user:DOCUMENT(DOCUMENT(iden).user),period:(FOR per IN TO_ARRAY(DOCUMENT(iden).period) RETURN DOCUMENT(per) ),Type:DOCUMENT(DOCUMENT(iden).Type)})) , address:(FOR add IN TO_ARRAY(Organization.address) RETURN MERGE(DOCUMENT(add),{Type:DOCUMENT(DOCUMENT(add).Type),use:DOCUMENT(DOCUMENT(add).use),city:DOCUMENT(DOCUMENT(add).city),country:DOCUMENT(DOCUMENT(add).country),district:DOCUMENT(DOCUMENT(add).district),state:DOCUMENT(DOCUMENT(add).state),postalCode:DOCUMENT(DOCUMENT(add).postalCode)})) ,alias:(FOR alias IN TO_ARRAY(Organization.alias) RETURN MERGE(alias,{aliasType:DOCUMENT(alias.aliasType) ,aliasCode:DOCUMENT(alias.aliasCode) })) ,levelofcareid:DOCUMENT(Organization.levelofcareid) ,logo:(FOR attc IN TO_ARRAY(Organization.logo) RETURN DOCUMENT(attc)) ,telecom:(FOR tel IN TO_ARRAY(Organization.telecom) RETURN MERGE(DOCUMENT(tel),{system:DOCUMENT(DOCUMENT(tel).system),use:DOCUMENT(DOCUMENT(tel).use),rank:DOCUMENT(DOCUMENT(tel).rank) ,valueprefix:DOCUMENT(DOCUMENT(tel).valueprefix)})) , contact:(FOR cnt IN TO_ARRAY(Organization.contact) RETURN MERGE(cnt,{telecom:(FOR tel IN TO_ARRAY(cnt.telecom) RETURN MERGE(DOCUMENT(tel),{use:DOCUMENT(DOCUMENT(tel).use),system:DOCUMENT(DOCUMENT(tel).system),rank:DOCUMENT(DOCUMENT(tel).rank),valueprefix:DOCUMENT(DOCUMENT(tel).valueprefix) })),name:(FOR nm IN TO_ARRAY(cnt.name) RETURN MERGE(DOCUMENT(nm),{use:DOCUMENT(DOCUMENT(nm).use),prefix:DOCUMENT(DOCUMENT(nm).prefix),suffix:DOCUMENT(DOCUMENT(nm).suffix)})),designation:DOCUMENT(cnt.designation)}) ),OrgType:(FOR org IN TO_ARRAY(Organization.OrgType) RETURN DOCUMENT(org)),specialtyDetails:(FOR spec IN TO_ARRAY(Organization.specialtyDetails) RETURN MERGE(spec,{specialty:document(spec.specialty)})) ,contactsettings:(FOR set IN TO_ARRAY(Organization.contactsettings) RETURN MERGE(set, {roundoffmode:{_id:set.roundingmode,code:document(set.roundingmode).code,display:document(set.roundingmode).display},tenant:FIRST(FOR tet IN tenant FILTER tet.tenantcode IN Organization.contactsettings[*].tenant RETURN {_id:tet._id,code:tet.tenantcode,display:CONCAT(tet.tenantcode,' - ',tet.tenantname)} ) ,currency:{_id:set.currency,code:DOCUMENT(set.currency).currencycode,display:CONCAT(DOCUMENT(set.currency).currencycode,' - ',DOCUMENT(set.currency).currencyname)},timezone:{_id:set.timezone,code:DOCUMENT(set.timezone).shortdesc,display:CONCAT(DOCUMENT(set.timezone).shortdesc,' - ',DOCUMENT(set.timezone).display)}} ) ) })"
26674
+ queryid: "05588edb-1b7b-48a1-ab85-d2f8281c4c96",
26675
+ filter: {
26676
+ key: "".concat(_key)
26677
+ }
26747
26678
  };
26748
26679
  },
26749
26680
  //GET PARENT ORG NAME BY ID
26681
+ // getParentOrgNameById: (_key) => {
26682
+ // return {
26683
+ // db_name: dbName,
26684
+ // entity: "Organization",
26685
+ // filter: `Organization.id == ${_key}`,
26686
+ // return_fields:
26687
+ // "{_id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,parentorgid:Organization.ParentOrgID}",
26688
+ // };
26689
+ // },
26750
26690
  getParentOrgNameById: function getParentOrgNameById(_key) {
26751
26691
  return {
26752
26692
  db_name: dbName,
26753
- entity: "Organization",
26754
- filter: "Organization.id == ".concat(_key),
26755
- return_fields: "{_id:Organization._id,_key:Organization._key,id:Organization.id,name:Organization.name,parentorgid:Organization.ParentOrgID}"
26693
+ queryid: "9f065c19-10c9-41e1-b925-53458964974f",
26694
+ filter: {
26695
+ id: _key,
26696
+ activestatus: true
26697
+ }
26756
26698
  };
26757
26699
  },
26758
26700
  //UPSERT STATUS
@@ -27015,50 +26957,69 @@ var getaliasdetails = function getaliasdetails(getaliaslist) {
27015
26957
  return dataList;
27016
26958
  };
27017
26959
  var ReadTreeDetailJson = function ReadTreeDetailJson(data, parentOrgName) {
27018
- var specialtyDetailsarr = data === null || data === void 0 ? void 0 : data.specialtyDetails.map(function (val, i) {
27019
- var _val$specialty;
26960
+ var _data$specialtyDetail, _data$contactsettings, _data$address$, _data$address, _addr$city, _addr$district, _addr$state, _addr$postalCode, _addr$country, _data$contact$0$name$, _data$contact, _contactNameObj$prefi, _contactNameObj$suffi, _data$name, _data$entitycode, _data$ParentOrgID, _data$levelofcareid$d, _data$levelofcareid, _data$levelofcareid$l, _data$levelofcareid2, _data$gstcode, _data$contact$0$desig, _data$contact2, _getContact, _data$telecom, _data$active, _data$logo$0$fileid, _data$logo, _getpersondetails, _data$contact3, _data$isExternal, _data$OrgType$0$code, _data$OrgType, _getaliasdetails, _data$alias;
26961
+ // Early return if data is falsy
26962
+ if (!data) {
26963
+ return {};
26964
+ }
26965
+
26966
+ // Process specialty details
26967
+ var specialtyDetailsArr = ((_data$specialtyDetail = data.specialtyDetails) !== null && _data$specialtyDetail !== void 0 ? _data$specialtyDetail : []).map(function (val) {
26968
+ var _val$specialty$descri, _val$specialty;
27020
26969
  return {
27021
- effFrom: moment(moment.unix(val.effFrom)._d).format("DD-MM-YYYY"),
27022
- effTo: moment(moment.unix(val.effTo)._d).format("DD-MM-YYYY"),
27023
- specialty: val === null || val === void 0 || (_val$specialty = val.specialty) === null || _val$specialty === void 0 ? void 0 : _val$specialty.description
26970
+ effFrom: val !== null && val !== void 0 && val.effFrom ? moment.unix(val.effFrom).format('DD-MM-YYYY') : '',
26971
+ effTo: val !== null && val !== void 0 && val.effTo ? moment.unix(val.effTo).format('DD-MM-YYYY') : '',
26972
+ specialty: (_val$specialty$descri = val === null || val === void 0 || (_val$specialty = val.specialty) === null || _val$specialty === void 0 ? void 0 : _val$specialty.description) !== null && _val$specialty$descri !== void 0 ? _val$specialty$descri : ''
27024
26973
  };
27025
26974
  });
27026
- var settingsArr = data === null || data === void 0 ? void 0 : data.contactsettings.map(function (val, i) {
26975
+
26976
+ // Process contact settings
26977
+ var settingsArr = ((_data$contactsettings = data.contactsettings) !== null && _data$contactsettings !== void 0 ? _data$contactsettings : []).map(function (val) {
26978
+ var _val$tenant, _val$currency, _val$timezone;
27027
26979
  return {
27028
- tenant: val === null || val === void 0 ? void 0 : val.tenant,
27029
- currency: val === null || val === void 0 ? void 0 : val.currency,
27030
- dateformat: moment(moment.unix(val.dateformat)._d).format("DD-MM-YYYY"),
27031
- timeformat: moment(moment.unix(val.timeformat)._d).format("HH:mm"),
27032
- datetimeformat: moment(moment.unix(val.datetimeformat)._d).format("DD-MM-YYYY HH:mm"),
27033
- timezone: val === null || val === void 0 ? void 0 : val.timezone
26980
+ tenant: (_val$tenant = val === null || val === void 0 ? void 0 : val.tenant) !== null && _val$tenant !== void 0 ? _val$tenant : '',
26981
+ currency: (_val$currency = val === null || val === void 0 ? void 0 : val.currency) !== null && _val$currency !== void 0 ? _val$currency : '',
26982
+ dateformat: val !== null && val !== void 0 && val.dateformat ? moment.unix(val.dateformat).format('DD-MM-YYYY') : '',
26983
+ timeformat: val !== null && val !== void 0 && val.timeformat ? moment.unix(val.timeformat).format('HH:mm') : '',
26984
+ datetimeformat: val !== null && val !== void 0 && val.datetimeformat ? moment.unix(val.datetimeformat).format('DD-MM-YYYY HH:mm') : '',
26985
+ timezone: (_val$timezone = val === null || val === void 0 ? void 0 : val.timezone) !== null && _val$timezone !== void 0 ? _val$timezone : ''
27034
26986
  };
27035
26987
  });
27036
- var obj = {};
27037
- if (data) {
27038
- var _data$name, _data$entitycode, _data$ParentOrgID, _data$levelofcareid$d, _data$levelofcareid, _data$levelofcareid$l, _data$levelofcareid2, _data$gstcode, _ref3, _data$address, _data$address2, _data$address3, _data$address4, _data$address5, _data$address6, _data$contact$, _data$contact$2, _data$contact$3, _data$contact$4, _data$contact$5, _data$contact$0$desig, _data$contact, _getContact, _data$telecom, _data$logo$, _getpersondetails, _data$contact2, _data$isExternal, _data$OrgType$0$code, _data$OrgType, _getaliasdetails, _data$alias;
27039
- obj = {
27040
- entityName: (_data$name = data === null || data === void 0 ? void 0 : data.name) !== null && _data$name !== void 0 ? _data$name : "",
27041
- entityCode: (_data$entitycode = data === null || data === void 0 ? void 0 : data.entitycode) !== null && _data$entitycode !== void 0 ? _data$entitycode : "",
27042
- _key: data === null || data === void 0 ? void 0 : data._key,
27043
- parentEntityId: data === null || data === void 0 || (_data$ParentOrgID = data.ParentOrgID) === null || _data$ParentOrgID === void 0 ? void 0 : _data$ParentOrgID[0],
27044
- parentEntity: parentOrgName !== null && parentOrgName !== void 0 ? parentOrgName : "",
27045
- levelOfCare: (_data$levelofcareid$d = data === null || data === void 0 || (_data$levelofcareid = data.levelofcareid) === null || _data$levelofcareid === void 0 ? void 0 : _data$levelofcareid.description) !== null && _data$levelofcareid$d !== void 0 ? _data$levelofcareid$d : "",
27046
- level: (_data$levelofcareid$l = data === null || data === void 0 || (_data$levelofcareid2 = data.levelofcareid) === null || _data$levelofcareid2 === void 0 ? void 0 : _data$levelofcareid2.levelofcareCode) !== null && _data$levelofcareid$l !== void 0 ? _data$levelofcareid$l : "",
27047
- gstcode: (_data$gstcode = data === null || data === void 0 ? void 0 : data.gstcode) !== null && _data$gstcode !== void 0 ? _data$gstcode : "",
27048
- address: (_ref3 = (data === null || data === void 0 || (_data$address = data.address) === null || _data$address === void 0 || (_data$address = _data$address[0]) === null || _data$address === void 0 ? void 0 : _data$address.line) + ", " + (data === null || data === void 0 || (_data$address2 = data.address) === null || _data$address2 === void 0 || (_data$address2 = _data$address2[0]) === null || _data$address2 === void 0 || (_data$address2 = _data$address2.city) === null || _data$address2 === void 0 ? void 0 : _data$address2.geogLevelName) + ", " + (data === null || data === void 0 || (_data$address3 = data.address) === null || _data$address3 === void 0 || (_data$address3 = _data$address3[0]) === null || _data$address3 === void 0 || (_data$address3 = _data$address3.district) === null || _data$address3 === void 0 ? void 0 : _data$address3.geogLevelName) + ", " + (data === null || data === void 0 || (_data$address4 = data.address) === null || _data$address4 === void 0 || (_data$address4 = _data$address4[0]) === null || _data$address4 === void 0 || (_data$address4 = _data$address4.state) === null || _data$address4 === void 0 ? void 0 : _data$address4.geogLevelName) + ", " + (data === null || data === void 0 || (_data$address5 = data.address) === null || _data$address5 === void 0 || (_data$address5 = _data$address5[0]) === null || _data$address5 === void 0 || (_data$address5 = _data$address5.postalCode) === null || _data$address5 === void 0 ? void 0 : _data$address5.geogLevelName) + ", " + (data === null || data === void 0 || (_data$address6 = data.address) === null || _data$address6 === void 0 || (_data$address6 = _data$address6[0]) === null || _data$address6 === void 0 || (_data$address6 = _data$address6.country) === null || _data$address6 === void 0 ? void 0 : _data$address6.geogLevelName)) !== null && _ref3 !== void 0 ? _ref3 : "",
27049
- contactPersonName: (data === null || data === void 0 || (_data$contact$ = data.contact[0]) === null || _data$contact$ === void 0 || (_data$contact$ = _data$contact$.name[0]) === null || _data$contact$ === void 0 || (_data$contact$ = _data$contact$.prefix) === null || _data$contact$ === void 0 ? void 0 : _data$contact$.display) + " " + (data === null || data === void 0 || (_data$contact$2 = data.contact[0]) === null || _data$contact$2 === void 0 || (_data$contact$2 = _data$contact$2.name[0]) === null || _data$contact$2 === void 0 ? void 0 : _data$contact$2.text) + " " + (data === null || data === void 0 || (_data$contact$3 = data.contact[0]) === null || _data$contact$3 === void 0 || (_data$contact$3 = _data$contact$3.name[0]) === null || _data$contact$3 === void 0 ? void 0 : _data$contact$3.family) + " " + (data === null || data === void 0 || (_data$contact$4 = data.contact[0]) === null || _data$contact$4 === void 0 || (_data$contact$4 = _data$contact$4.name[0]) === null || _data$contact$4 === void 0 ? void 0 : _data$contact$4.given) + " " + (data === null || data === void 0 || (_data$contact$5 = data.contact[0]) === null || _data$contact$5 === void 0 || (_data$contact$5 = _data$contact$5.name[0]) === null || _data$contact$5 === void 0 || (_data$contact$5 = _data$contact$5.suffix) === null || _data$contact$5 === void 0 ? void 0 : _data$contact$5.display) + "",
27050
- designation: (_data$contact$0$desig = data === null || data === void 0 || (_data$contact = data.contact) === null || _data$contact === void 0 || (_data$contact = _data$contact[0]) === null || _data$contact === void 0 || (_data$contact = _data$contact.designation) === null || _data$contact === void 0 ? void 0 : _data$contact.description) !== null && _data$contact$0$desig !== void 0 ? _data$contact$0$desig : "",
27051
- contactData: (_getContact = getContact((data === null || data === void 0 || (_data$telecom = data.telecom) === null || _data$telecom === void 0 ? void 0 : _data$telecom.length) > 0 ? data === null || data === void 0 ? void 0 : data.telecom : null)) !== null && _getContact !== void 0 ? _getContact : null,
27052
- status: data === null || data === void 0 ? void 0 : data.active,
27053
- log: data === null || data === void 0 || (_data$logo$ = data.logo[0]) === null || _data$logo$ === void 0 ? void 0 : _data$logo$.fileid,
27054
- specialtyDetails: specialtyDetailsarr,
27055
- contact_person_name: (_getpersondetails = getpersondetails((data === null || data === void 0 || (_data$contact2 = data.contact) === null || _data$contact2 === void 0 ? void 0 : _data$contact2.length) > 0 ? data === null || data === void 0 ? void 0 : data.contact : null)) !== null && _getpersondetails !== void 0 ? _getpersondetails : null,
27056
- external: (_data$isExternal = data === null || data === void 0 ? void 0 : data.isExternal) !== null && _data$isExternal !== void 0 ? _data$isExternal : false,
27057
- orgEntityCode: (_data$OrgType$0$code = data === null || data === void 0 || (_data$OrgType = data.OrgType) === null || _data$OrgType === void 0 || (_data$OrgType = _data$OrgType[0]) === null || _data$OrgType === void 0 ? void 0 : _data$OrgType.code) !== null && _data$OrgType$0$code !== void 0 ? _data$OrgType$0$code : "",
27058
- alias: (_getaliasdetails = getaliasdetails((data === null || data === void 0 || (_data$alias = data.alias) === null || _data$alias === void 0 ? void 0 : _data$alias.length) > 0 ? data === null || data === void 0 ? void 0 : data.alias : null)) !== null && _getaliasdetails !== void 0 ? _getaliasdetails : null,
27059
- contactsettings: settingsArr
27060
- };
27061
- }
26988
+
26989
+ // Safely build address parts (avoiding undefined + ", " issues)
26990
+ var addr = (_data$address$ = data === null || data === void 0 || (_data$address = data.address) === null || _data$address === void 0 ? void 0 : _data$address[0]) !== null && _data$address$ !== void 0 ? _data$address$ : {};
26991
+ var addressParts = [addr.line, (_addr$city = addr.city) === null || _addr$city === void 0 ? void 0 : _addr$city.geogLevelName, (_addr$district = addr.district) === null || _addr$district === void 0 ? void 0 : _addr$district.geogLevelName, (_addr$state = addr.state) === null || _addr$state === void 0 ? void 0 : _addr$state.geogLevelName, (_addr$postalCode = addr.postalCode) === null || _addr$postalCode === void 0 ? void 0 : _addr$postalCode.geogLevelName, (_addr$country = addr.country) === null || _addr$country === void 0 ? void 0 : _addr$country.geogLevelName].filter(Boolean); // Remove falsy values
26992
+
26993
+ var address = addressParts.length ? addressParts.join(', ') : '';
26994
+
26995
+ // Safely build contact person name
26996
+ var contactNameObj = (_data$contact$0$name$ = data === null || data === void 0 || (_data$contact = data.contact) === null || _data$contact === void 0 || (_data$contact = _data$contact[0]) === null || _data$contact === void 0 || (_data$contact = _data$contact.name) === null || _data$contact === void 0 ? void 0 : _data$contact[0]) !== null && _data$contact$0$name$ !== void 0 ? _data$contact$0$name$ : {};
26997
+ var contactPersonNameParts = [(_contactNameObj$prefi = contactNameObj.prefix) === null || _contactNameObj$prefi === void 0 ? void 0 : _contactNameObj$prefi.display, contactNameObj.text, contactNameObj.family, contactNameObj.given, (_contactNameObj$suffi = contactNameObj.suffix) === null || _contactNameObj$suffi === void 0 ? void 0 : _contactNameObj$suffi.display].filter(Boolean);
26998
+ var contactPersonName = contactPersonNameParts.join(' ') || '';
26999
+
27000
+ // Build final object
27001
+ var obj = {
27002
+ entityName: (_data$name = data.name) !== null && _data$name !== void 0 ? _data$name : '',
27003
+ entityCode: (_data$entitycode = data.entitycode) !== null && _data$entitycode !== void 0 ? _data$entitycode : '',
27004
+ _key: data._key,
27005
+ parentEntityId: (_data$ParentOrgID = data.ParentOrgID) === null || _data$ParentOrgID === void 0 ? void 0 : _data$ParentOrgID[0],
27006
+ parentEntity: parentOrgName !== null && parentOrgName !== void 0 ? parentOrgName : '',
27007
+ levelOfCare: (_data$levelofcareid$d = (_data$levelofcareid = data.levelofcareid) === null || _data$levelofcareid === void 0 ? void 0 : _data$levelofcareid.description) !== null && _data$levelofcareid$d !== void 0 ? _data$levelofcareid$d : '',
27008
+ level: (_data$levelofcareid$l = (_data$levelofcareid2 = data.levelofcareid) === null || _data$levelofcareid2 === void 0 ? void 0 : _data$levelofcareid2.levelofcareCode) !== null && _data$levelofcareid$l !== void 0 ? _data$levelofcareid$l : '',
27009
+ gstcode: (_data$gstcode = data.gstcode) !== null && _data$gstcode !== void 0 ? _data$gstcode : '',
27010
+ address: address,
27011
+ contactPersonName: contactPersonName,
27012
+ designation: (_data$contact$0$desig = (_data$contact2 = data.contact) === null || _data$contact2 === void 0 || (_data$contact2 = _data$contact2[0]) === null || _data$contact2 === void 0 || (_data$contact2 = _data$contact2.designation) === null || _data$contact2 === void 0 ? void 0 : _data$contact2.description) !== null && _data$contact$0$desig !== void 0 ? _data$contact$0$desig : '',
27013
+ contactData: (_getContact = getContact(((_data$telecom = data.telecom) === null || _data$telecom === void 0 ? void 0 : _data$telecom.length) > 0 ? data.telecom : null)) !== null && _getContact !== void 0 ? _getContact : null,
27014
+ status: (_data$active = data.active) !== null && _data$active !== void 0 ? _data$active : false,
27015
+ log: (_data$logo$0$fileid = (_data$logo = data.logo) === null || _data$logo === void 0 || (_data$logo = _data$logo[0]) === null || _data$logo === void 0 ? void 0 : _data$logo.fileid) !== null && _data$logo$0$fileid !== void 0 ? _data$logo$0$fileid : null,
27016
+ specialtyDetails: specialtyDetailsArr,
27017
+ contact_person_name: (_getpersondetails = getpersondetails(((_data$contact3 = data.contact) === null || _data$contact3 === void 0 ? void 0 : _data$contact3.length) > 0 ? data.contact : null)) !== null && _getpersondetails !== void 0 ? _getpersondetails : null,
27018
+ external: (_data$isExternal = data.isExternal) !== null && _data$isExternal !== void 0 ? _data$isExternal : false,
27019
+ orgEntityCode: (_data$OrgType$0$code = (_data$OrgType = data.OrgType) === null || _data$OrgType === void 0 || (_data$OrgType = _data$OrgType[0]) === null || _data$OrgType === void 0 ? void 0 : _data$OrgType.code) !== null && _data$OrgType$0$code !== void 0 ? _data$OrgType$0$code : '',
27020
+ alias: (_getaliasdetails = getaliasdetails(((_data$alias = data.alias) === null || _data$alias === void 0 ? void 0 : _data$alias.length) > 0 ? data.alias : null)) !== null && _getaliasdetails !== void 0 ? _getaliasdetails : null,
27021
+ contactsettings: settingsArr
27022
+ };
27062
27023
  return obj;
27063
27024
  };
27064
27025
 
@@ -27236,232 +27197,260 @@ var generateJson$8 = {
27236
27197
  })];
27237
27198
  }
27238
27199
  };
27200
+ var unixToLocalDate = function unixToLocalDate(unixTimestamp) {
27201
+ if (typeof unixTimestamp !== "number" || unixTimestamp <= 0) return null;
27202
+ return moment.unix(unixTimestamp).local().toDate();
27203
+ };
27239
27204
  var generateReadJson$2 = {
27240
- read_json: function read_json(data, Parentget) {
27241
- var _data$identifier, _data$alias, _data$address, _data$telecom, _data$contact, _data$contactsettings, _data$OrgType$, _data$OrgType$2, _data$OrgType$3, _data$ParentOrgID, _data$levelofcareid, _data$levelofcareid2, _data$isExternal, _data$logo$, _data$logo$2, _data$logo$3, _data$logo$4, _data$logo$5;
27242
- var IdentificationArr = data === null || data === void 0 || (_data$identifier = data.identifier) === null || _data$identifier === void 0 ? void 0 : _data$identifier.map(function (v, i) {
27243
- var _v$period$, _v$period$2, _v$user, _v$user2, _v$Type, _v$Type2;
27244
- // IdentificationArr readdd
27245
- return {
27246
- startdate: moment.utc(moment.unix(v === null || v === void 0 || (_v$period$ = v.period[0]) === null || _v$period$ === void 0 ? void 0 : _v$period$.start)).local()._d,
27247
- // startdate: moment().utc(v?.period[0]?.start, "DD-MM-YYYY")._d,
27248
- enddate: moment.utc(moment.unix(v === null || v === void 0 || (_v$period$2 = v.period[0]) === null || _v$period$2 === void 0 ? void 0 : _v$period$2.end)).local()._d,
27249
- // enddate: moment().utc(v?.period[0]?.end, "DD-MM-YYYY")._d,
27205
+ read_json: function read_json(data) {
27206
+ var _data$identifier, _data$alias, _data$address, _data$telecom, _data$contact, _data$specialtyDetail2, _data$contactsettings, _data$ParentOrgID, _data$logo, _data$logo$0$fileid, _data$logo$0$filetype, _data$logo$0$objectid, _data$logo$0$fileName, _data$active, _data$OrgType, _data$OrgType$0$displ, _data$OrgType$0$_id, _data$OrgType$0$code, _data$levelofcareid$d, _data$levelofcareid$_, _data$entitycode, _data$name, _data$gstcode, _data$isExternal;
27207
+ var Parentget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
27208
+ if (!data) {
27209
+ return {};
27210
+ }
27250
27211
 
27251
- use: {
27252
- title: v === null || v === void 0 || (_v$user = v.user) === null || _v$user === void 0 ? void 0 : _v$user.display,
27253
- value: v === null || v === void 0 || (_v$user2 = v.user) === null || _v$user2 === void 0 ? void 0 : _v$user2._id
27254
- },
27255
- idtype: {
27256
- title: v === null || v === void 0 || (_v$Type = v.Type) === null || _v$Type === void 0 ? void 0 : _v$Type.display,
27257
- value: v === null || v === void 0 || (_v$Type2 = v.Type) === null || _v$Type2 === void 0 ? void 0 : _v$Type2._id
27258
- },
27259
- idnumber: v === null || v === void 0 ? void 0 : v.value
27212
+ // --- Identification ---
27213
+ var IdentificationArr = ((_data$identifier = data.identifier) !== null && _data$identifier !== void 0 ? _data$identifier : []).map(function (v) {
27214
+ var _v$period, _v$period2, _v$user$display, _v$user$_id, _v$Type$display, _v$Type$_id, _v$value;
27215
+ return {
27216
+ startdate: unixToLocalDate(v === null || v === void 0 || (_v$period = v.period) === null || _v$period === void 0 || (_v$period = _v$period[0]) === null || _v$period === void 0 ? void 0 : _v$period.start),
27217
+ enddate: unixToLocalDate(v === null || v === void 0 || (_v$period2 = v.period) === null || _v$period2 === void 0 || (_v$period2 = _v$period2[0]) === null || _v$period2 === void 0 ? void 0 : _v$period2.end),
27218
+ use: v !== null && v !== void 0 && v.user ? {
27219
+ title: (_v$user$display = v.user.display) !== null && _v$user$display !== void 0 ? _v$user$display : "",
27220
+ value: (_v$user$_id = v.user._id) !== null && _v$user$_id !== void 0 ? _v$user$_id : ""
27221
+ } : null,
27222
+ idtype: v !== null && v !== void 0 && v.Type ? {
27223
+ title: (_v$Type$display = v.Type.display) !== null && _v$Type$display !== void 0 ? _v$Type$display : "",
27224
+ value: (_v$Type$_id = v.Type._id) !== null && _v$Type$_id !== void 0 ? _v$Type$_id : ""
27225
+ } : null,
27226
+ idnumber: (_v$value = v === null || v === void 0 ? void 0 : v.value) !== null && _v$value !== void 0 ? _v$value : ""
27260
27227
  };
27261
27228
  });
27262
- var AliasArr = data === null || data === void 0 || (_data$alias = data.alias) === null || _data$alias === void 0 ? void 0 : _data$alias.map(function (v, i) {
27263
- var _v$aliasType, _v$aliasType2;
27264
- // AliasArr read
27229
+
27230
+ // --- Alias ---
27231
+ var AliasArr = ((_data$alias = data.alias) !== null && _data$alias !== void 0 ? _data$alias : []).map(function (v) {
27232
+ var _v$aliasType$display, _v$aliasType$_id, _v$aliasDesc;
27265
27233
  return {
27266
- startdate: moment().utc(v === null || v === void 0 ? void 0 : v.aliasStart, "DD-MM-YYYY")._d,
27267
- enddate: moment().utc(v === null || v === void 0 ? void 0 : v.aliasEnd, "DD-MM-YYYY")._d,
27268
- aliastype: {
27269
- title: v === null || v === void 0 || (_v$aliasType = v.aliasType) === null || _v$aliasType === void 0 ? void 0 : _v$aliasType.display,
27270
- value: v === null || v === void 0 || (_v$aliasType2 = v.aliasType) === null || _v$aliasType2 === void 0 ? void 0 : _v$aliasType2._id
27271
- },
27272
- aliasname: v === null || v === void 0 ? void 0 : v.aliasDesc
27234
+ startdate: v !== null && v !== void 0 && v.aliasStart ? moment(v.aliasStart, "DD-MM-YYYY").toDate() : null,
27235
+ enddate: v !== null && v !== void 0 && v.aliasEnd ? moment(v.aliasEnd, "DD-MM-YYYY").toDate() : null,
27236
+ aliastype: v !== null && v !== void 0 && v.aliasType ? {
27237
+ title: (_v$aliasType$display = v.aliasType.display) !== null && _v$aliasType$display !== void 0 ? _v$aliasType$display : "",
27238
+ value: (_v$aliasType$_id = v.aliasType._id) !== null && _v$aliasType$_id !== void 0 ? _v$aliasType$_id : ""
27239
+ } : null,
27240
+ aliasname: (_v$aliasDesc = v === null || v === void 0 ? void 0 : v.aliasDesc) !== null && _v$aliasDesc !== void 0 ? _v$aliasDesc : ""
27273
27241
  };
27274
27242
  });
27275
- var AddressArr = data === null || data === void 0 || (_data$address = data.address) === null || _data$address === void 0 ? void 0 : _data$address.map(function (v, i) {
27276
- var _v$use5, _v$use6, _v$Type3, _v$Type4, _v$city, _v$city2, _v$district, _v$district2, _v$state, _v$state2, _v$country, _v$country2, _v$postalCode, _v$postalCode2;
27277
- // AddressArr read
27278
- var addressAll = v.line.split(",");
27243
+
27244
+ // --- Address ---
27245
+ var AddressArr = ((_data$address = data.address) !== null && _data$address !== void 0 ? _data$address : []).map(function (v) {
27246
+ var _v$line, _v$use$display, _v$use$_id, _v$Type$display2, _v$Type$_id2, _addressLines$, _addressLines$2, _addressLines$3, _v$city$geogLevelName, _v$city$_id, _v$district$geogLevel, _v$district$_id, _v$state$geogLevelNam, _v$state$_id, _v$country$geogLevelN, _v$country$_id, _v$postalCode$geogLev, _v$postalCode$_id, _v$latitude, _v$longitude;
27247
+ var addressLines = ((_v$line = v.line) !== null && _v$line !== void 0 ? _v$line : "").split(",").map(function (part) {
27248
+ return part.trim();
27249
+ });
27279
27250
  return {
27280
- use: {
27281
- title: v === null || v === void 0 || (_v$use5 = v.use) === null || _v$use5 === void 0 ? void 0 : _v$use5.display,
27282
- value: v === null || v === void 0 || (_v$use6 = v.use) === null || _v$use6 === void 0 ? void 0 : _v$use6._id
27283
- },
27284
- type: {
27285
- title: v === null || v === void 0 || (_v$Type3 = v.Type) === null || _v$Type3 === void 0 ? void 0 : _v$Type3.display,
27286
- value: v === null || v === void 0 || (_v$Type4 = v.Type) === null || _v$Type4 === void 0 ? void 0 : _v$Type4._id
27287
- },
27288
- address1: addressAll[0],
27289
- address2: addressAll[1],
27290
- address3: addressAll[2],
27291
- city: {
27292
- title: v === null || v === void 0 || (_v$city = v.city) === null || _v$city === void 0 ? void 0 : _v$city.geogLevelName,
27293
- value: v === null || v === void 0 || (_v$city2 = v.city) === null || _v$city2 === void 0 ? void 0 : _v$city2._id
27294
- },
27295
- district: {
27296
- title: v === null || v === void 0 || (_v$district = v.district) === null || _v$district === void 0 ? void 0 : _v$district.geogLevelName,
27297
- value: v === null || v === void 0 || (_v$district2 = v.district) === null || _v$district2 === void 0 ? void 0 : _v$district2._id
27298
- },
27299
- state: {
27300
- title: v === null || v === void 0 || (_v$state = v.state) === null || _v$state === void 0 ? void 0 : _v$state.geogLevelName,
27301
- value: v === null || v === void 0 || (_v$state2 = v.state) === null || _v$state2 === void 0 ? void 0 : _v$state2._id
27302
- },
27303
- country: {
27304
- title: v === null || v === void 0 || (_v$country = v.country) === null || _v$country === void 0 ? void 0 : _v$country.geogLevelName,
27305
- value: v === null || v === void 0 || (_v$country2 = v.country) === null || _v$country2 === void 0 ? void 0 : _v$country2._id
27306
- },
27307
- pincode: {
27308
- title: v === null || v === void 0 || (_v$postalCode = v.postalCode) === null || _v$postalCode === void 0 ? void 0 : _v$postalCode.geogLevelName,
27309
- value: v === null || v === void 0 || (_v$postalCode2 = v.postalCode) === null || _v$postalCode2 === void 0 ? void 0 : _v$postalCode2._id
27310
- },
27311
- latitude: v === null || v === void 0 ? void 0 : v.latitude,
27312
- longitude: v === null || v === void 0 ? void 0 : v.longitude
27251
+ use: v !== null && v !== void 0 && v.use ? {
27252
+ title: (_v$use$display = v.use.display) !== null && _v$use$display !== void 0 ? _v$use$display : "",
27253
+ value: (_v$use$_id = v.use._id) !== null && _v$use$_id !== void 0 ? _v$use$_id : ""
27254
+ } : null,
27255
+ type: v !== null && v !== void 0 && v.Type ? {
27256
+ title: (_v$Type$display2 = v.Type.display) !== null && _v$Type$display2 !== void 0 ? _v$Type$display2 : "",
27257
+ value: (_v$Type$_id2 = v.Type._id) !== null && _v$Type$_id2 !== void 0 ? _v$Type$_id2 : ""
27258
+ } : null,
27259
+ address1: (_addressLines$ = addressLines[0]) !== null && _addressLines$ !== void 0 ? _addressLines$ : "",
27260
+ address2: (_addressLines$2 = addressLines[1]) !== null && _addressLines$2 !== void 0 ? _addressLines$2 : "",
27261
+ address3: (_addressLines$3 = addressLines[2]) !== null && _addressLines$3 !== void 0 ? _addressLines$3 : "",
27262
+ city: v !== null && v !== void 0 && v.city ? {
27263
+ title: (_v$city$geogLevelName = v.city.geogLevelName) !== null && _v$city$geogLevelName !== void 0 ? _v$city$geogLevelName : "",
27264
+ value: (_v$city$_id = v.city._id) !== null && _v$city$_id !== void 0 ? _v$city$_id : ""
27265
+ } : null,
27266
+ district: v !== null && v !== void 0 && v.district ? {
27267
+ title: (_v$district$geogLevel = v.district.geogLevelName) !== null && _v$district$geogLevel !== void 0 ? _v$district$geogLevel : "",
27268
+ value: (_v$district$_id = v.district._id) !== null && _v$district$_id !== void 0 ? _v$district$_id : ""
27269
+ } : null,
27270
+ state: v !== null && v !== void 0 && v.state ? {
27271
+ title: (_v$state$geogLevelNam = v.state.geogLevelName) !== null && _v$state$geogLevelNam !== void 0 ? _v$state$geogLevelNam : "",
27272
+ value: (_v$state$_id = v.state._id) !== null && _v$state$_id !== void 0 ? _v$state$_id : ""
27273
+ } : null,
27274
+ country: v !== null && v !== void 0 && v.country ? {
27275
+ title: (_v$country$geogLevelN = v.country.geogLevelName) !== null && _v$country$geogLevelN !== void 0 ? _v$country$geogLevelN : "",
27276
+ value: (_v$country$_id = v.country._id) !== null && _v$country$_id !== void 0 ? _v$country$_id : ""
27277
+ } : null,
27278
+ pincode: v !== null && v !== void 0 && v.postalCode ? {
27279
+ title: (_v$postalCode$geogLev = v.postalCode.geogLevelName) !== null && _v$postalCode$geogLev !== void 0 ? _v$postalCode$geogLev : "",
27280
+ value: (_v$postalCode$_id = v.postalCode._id) !== null && _v$postalCode$_id !== void 0 ? _v$postalCode$_id : ""
27281
+ } : null,
27282
+ latitude: (_v$latitude = v === null || v === void 0 ? void 0 : v.latitude) !== null && _v$latitude !== void 0 ? _v$latitude : null,
27283
+ longitude: (_v$longitude = v === null || v === void 0 ? void 0 : v.longitude) !== null && _v$longitude !== void 0 ? _v$longitude : null
27313
27284
  };
27314
27285
  });
27315
- var ContactArr = data === null || data === void 0 || (_data$telecom = data.telecom) === null || _data$telecom === void 0 ? void 0 : _data$telecom.map(function (v, i) {
27316
- var _v$valueprefix, _v$valueprefix2, _v$system, _v$system2, _v$use7, _v$use8, _v$rank, _v$rank2;
27317
- // AliasArr read
27286
+
27287
+ // --- Contact (Telecom) ---
27288
+ var ContactArr = ((_data$telecom = data.telecom) !== null && _data$telecom !== void 0 ? _data$telecom : []).map(function (v) {
27289
+ var _v$valueprefix$GeoLoc, _v$valueprefix$_id, _v$system$display, _v$system$_id, _v$value2, _v$use$display2, _v$use$_id2, _v$rank$display, _v$rank$_id;
27318
27290
  return {
27319
- code: {
27320
- title: v === null || v === void 0 || (_v$valueprefix = v.valueprefix) === null || _v$valueprefix === void 0 ? void 0 : _v$valueprefix.GeoLocationISDCode,
27321
- value: v === null || v === void 0 || (_v$valueprefix2 = v.valueprefix) === null || _v$valueprefix2 === void 0 ? void 0 : _v$valueprefix2._id
27322
- },
27323
- mode: {
27324
- title: v === null || v === void 0 || (_v$system = v.system) === null || _v$system === void 0 ? void 0 : _v$system.display,
27325
- value: v === null || v === void 0 || (_v$system2 = v.system) === null || _v$system2 === void 0 ? void 0 : _v$system2._id
27326
- },
27327
- number: v === null || v === void 0 ? void 0 : v.value,
27328
- use: {
27329
- title: v === null || v === void 0 || (_v$use7 = v.use) === null || _v$use7 === void 0 ? void 0 : _v$use7.display,
27330
- value: v === null || v === void 0 || (_v$use8 = v.use) === null || _v$use8 === void 0 ? void 0 : _v$use8._id
27331
- },
27332
- priority: {
27333
- title: v === null || v === void 0 || (_v$rank = v.rank) === null || _v$rank === void 0 ? void 0 : _v$rank.display,
27334
- value: v === null || v === void 0 || (_v$rank2 = v.rank) === null || _v$rank2 === void 0 ? void 0 : _v$rank2._id
27335
- }
27291
+ code: v !== null && v !== void 0 && v.valueprefix ? {
27292
+ title: (_v$valueprefix$GeoLoc = v.valueprefix.GeoLocationISDCode) !== null && _v$valueprefix$GeoLoc !== void 0 ? _v$valueprefix$GeoLoc : "",
27293
+ value: (_v$valueprefix$_id = v.valueprefix._id) !== null && _v$valueprefix$_id !== void 0 ? _v$valueprefix$_id : ""
27294
+ } : null,
27295
+ mode: v !== null && v !== void 0 && v.system ? {
27296
+ title: (_v$system$display = v.system.display) !== null && _v$system$display !== void 0 ? _v$system$display : "",
27297
+ value: (_v$system$_id = v.system._id) !== null && _v$system$_id !== void 0 ? _v$system$_id : ""
27298
+ } : null,
27299
+ number: (_v$value2 = v === null || v === void 0 ? void 0 : v.value) !== null && _v$value2 !== void 0 ? _v$value2 : "",
27300
+ use: v !== null && v !== void 0 && v.use ? {
27301
+ title: (_v$use$display2 = v.use.display) !== null && _v$use$display2 !== void 0 ? _v$use$display2 : "",
27302
+ value: (_v$use$_id2 = v.use._id) !== null && _v$use$_id2 !== void 0 ? _v$use$_id2 : ""
27303
+ } : null,
27304
+ priority: v !== null && v !== void 0 && v.rank ? {
27305
+ title: (_v$rank$display = v.rank.display) !== null && _v$rank$display !== void 0 ? _v$rank$display : "",
27306
+ value: (_v$rank$_id = v.rank._id) !== null && _v$rank$_id !== void 0 ? _v$rank$_id : ""
27307
+ } : null
27336
27308
  };
27337
27309
  });
27338
- var ContactPersonDetailsArr = data === null || data === void 0 || (_data$contact = data.contact) === null || _data$contact === void 0 ? void 0 : _data$contact.map(function (v, i) {
27339
- var _v$name$, _v$name$2, _v$name$3, _v$name$4, _v$name$5, _v$name$6, _v$name$7, _v$designation, _v$designation2, _v$telecom;
27340
- // ContactPersonDetailsArr read
27310
+
27311
+ // --- Contact Person Details ---
27312
+ var ContactPersonDetailsArr = ((_data$contact = data.contact) !== null && _data$contact !== void 0 ? _data$contact : []).map(function (v) {
27313
+ var _v$name, _name$use$display, _name$use$_id, _name$prefix$display, _name$prefix$_id, _name$text, _name$family, _name$given, _name$suffix$display, _name$suffix$_id, _v$designation$displa, _v$designation$_id, _v$telecom;
27314
+ var name = (v === null || v === void 0 || (_v$name = v.name) === null || _v$name === void 0 ? void 0 : _v$name[0]) || {};
27341
27315
  return {
27342
- use: {
27343
- title: v.name[0].use.display,
27344
- value: v.name[0].use._id
27345
- },
27346
- prefix: {
27347
- title: v === null || v === void 0 || (_v$name$ = v.name[0]) === null || _v$name$ === void 0 || (_v$name$ = _v$name$.prefix) === null || _v$name$ === void 0 ? void 0 : _v$name$.display,
27348
- value: v === null || v === void 0 || (_v$name$2 = v.name[0]) === null || _v$name$2 === void 0 || (_v$name$2 = _v$name$2.prefix) === null || _v$name$2 === void 0 ? void 0 : _v$name$2._id
27349
- },
27350
- firstName: v === null || v === void 0 || (_v$name$3 = v.name[0]) === null || _v$name$3 === void 0 ? void 0 : _v$name$3.text,
27351
- middleName: v === null || v === void 0 || (_v$name$4 = v.name[0]) === null || _v$name$4 === void 0 ? void 0 : _v$name$4.family,
27352
- lastName: v === null || v === void 0 || (_v$name$5 = v.name[0]) === null || _v$name$5 === void 0 ? void 0 : _v$name$5.given,
27353
- suffix: {
27354
- title: v === null || v === void 0 || (_v$name$6 = v.name[0]) === null || _v$name$6 === void 0 || (_v$name$6 = _v$name$6.suffix) === null || _v$name$6 === void 0 ? void 0 : _v$name$6.display,
27355
- value: v === null || v === void 0 || (_v$name$7 = v.name[0]) === null || _v$name$7 === void 0 || (_v$name$7 = _v$name$7.suffix) === null || _v$name$7 === void 0 ? void 0 : _v$name$7._id
27356
- },
27357
- designation: {
27358
- title: v === null || v === void 0 || (_v$designation = v.designation) === null || _v$designation === void 0 ? void 0 : _v$designation.display,
27359
- value: v === null || v === void 0 || (_v$designation2 = v.designation) === null || _v$designation2 === void 0 ? void 0 : _v$designation2._id
27360
- },
27361
- point: v === null || v === void 0 || (_v$telecom = v.telecom) === null || _v$telecom === void 0 ? void 0 : _v$telecom.map(function (val, i) {
27362
- var _val$system, _val$system2, _val$valueprefix, _val$valueprefix2, _val$use4, _val$use5, _val$rank, _val$rank2;
27316
+ use: name !== null && name !== void 0 && name.use ? {
27317
+ title: (_name$use$display = name.use.display) !== null && _name$use$display !== void 0 ? _name$use$display : "",
27318
+ value: (_name$use$_id = name.use._id) !== null && _name$use$_id !== void 0 ? _name$use$_id : ""
27319
+ } : null,
27320
+ prefix: name !== null && name !== void 0 && name.prefix ? {
27321
+ title: (_name$prefix$display = name.prefix.display) !== null && _name$prefix$display !== void 0 ? _name$prefix$display : "",
27322
+ value: (_name$prefix$_id = name.prefix._id) !== null && _name$prefix$_id !== void 0 ? _name$prefix$_id : ""
27323
+ } : null,
27324
+ firstName: (_name$text = name === null || name === void 0 ? void 0 : name.text) !== null && _name$text !== void 0 ? _name$text : "",
27325
+ middleName: (_name$family = name === null || name === void 0 ? void 0 : name.family) !== null && _name$family !== void 0 ? _name$family : "",
27326
+ // Note: usually 'family' = last name
27327
+ lastName: (_name$given = name === null || name === void 0 ? void 0 : name.given) !== null && _name$given !== void 0 ? _name$given : "",
27328
+ // Note: usually 'given' = first name
27329
+ suffix: name !== null && name !== void 0 && name.suffix ? {
27330
+ title: (_name$suffix$display = name.suffix.display) !== null && _name$suffix$display !== void 0 ? _name$suffix$display : "",
27331
+ value: (_name$suffix$_id = name.suffix._id) !== null && _name$suffix$_id !== void 0 ? _name$suffix$_id : ""
27332
+ } : null,
27333
+ designation: v !== null && v !== void 0 && v.designation ? {
27334
+ title: (_v$designation$displa = v.designation.display) !== null && _v$designation$displa !== void 0 ? _v$designation$displa : "",
27335
+ value: (_v$designation$_id = v.designation._id) !== null && _v$designation$_id !== void 0 ? _v$designation$_id : ""
27336
+ } : null,
27337
+ point: ((_v$telecom = v === null || v === void 0 ? void 0 : v.telecom) !== null && _v$telecom !== void 0 ? _v$telecom : []).map(function (val) {
27338
+ var _val$system$display, _val$system$_id, _val$valueprefix$GeoL, _val$valueprefix$_id, _val$value, _val$use$display, _val$use$_id, _val$rank$display, _val$rank$_id;
27363
27339
  return {
27364
- mode: {
27365
- title: val === null || val === void 0 || (_val$system = val.system) === null || _val$system === void 0 ? void 0 : _val$system.display,
27366
- value: val === null || val === void 0 || (_val$system2 = val.system) === null || _val$system2 === void 0 ? void 0 : _val$system2._id
27367
- },
27368
- code: {
27369
- title: val === null || val === void 0 || (_val$valueprefix = val.valueprefix) === null || _val$valueprefix === void 0 ? void 0 : _val$valueprefix.GeoLocationISDCode,
27370
- value: val === null || val === void 0 || (_val$valueprefix2 = val.valueprefix) === null || _val$valueprefix2 === void 0 ? void 0 : _val$valueprefix2._id
27371
- },
27372
- number: val === null || val === void 0 ? void 0 : val.value,
27373
- use: {
27374
- title: val === null || val === void 0 || (_val$use4 = val.use) === null || _val$use4 === void 0 ? void 0 : _val$use4.display,
27375
- value: val === null || val === void 0 || (_val$use5 = val.use) === null || _val$use5 === void 0 ? void 0 : _val$use5._id
27376
- },
27377
- priority: {
27378
- title: val === null || val === void 0 || (_val$rank = val.rank) === null || _val$rank === void 0 ? void 0 : _val$rank.display,
27379
- value: val === null || val === void 0 || (_val$rank2 = val.rank) === null || _val$rank2 === void 0 ? void 0 : _val$rank2._id
27380
- }
27340
+ mode: val !== null && val !== void 0 && val.system ? {
27341
+ title: (_val$system$display = val.system.display) !== null && _val$system$display !== void 0 ? _val$system$display : "",
27342
+ value: (_val$system$_id = val.system._id) !== null && _val$system$_id !== void 0 ? _val$system$_id : ""
27343
+ } : null,
27344
+ code: val !== null && val !== void 0 && val.valueprefix ? {
27345
+ title: (_val$valueprefix$GeoL = val.valueprefix.GeoLocationISDCode) !== null && _val$valueprefix$GeoL !== void 0 ? _val$valueprefix$GeoL : "",
27346
+ value: (_val$valueprefix$_id = val.valueprefix._id) !== null && _val$valueprefix$_id !== void 0 ? _val$valueprefix$_id : ""
27347
+ } : null,
27348
+ number: (_val$value = val === null || val === void 0 ? void 0 : val.value) !== null && _val$value !== void 0 ? _val$value : "",
27349
+ use: val !== null && val !== void 0 && val.use ? {
27350
+ title: (_val$use$display = val.use.display) !== null && _val$use$display !== void 0 ? _val$use$display : "",
27351
+ value: (_val$use$_id = val.use._id) !== null && _val$use$_id !== void 0 ? _val$use$_id : ""
27352
+ } : null,
27353
+ priority: val !== null && val !== void 0 && val.rank ? {
27354
+ title: (_val$rank$display = val.rank.display) !== null && _val$rank$display !== void 0 ? _val$rank$display : "",
27355
+ value: (_val$rank$_id = val.rank._id) !== null && _val$rank$_id !== void 0 ? _val$rank$_id : ""
27356
+ } : null
27381
27357
  };
27382
27358
  })
27383
27359
  };
27384
27360
  });
27385
- var specialtyDetailsarr = data === null || data === void 0 ? void 0 : data.specialtyDetails.map(function (val, i) {
27386
- var _val$specialty, _val$specialty2, _val$specialty3, _val$specialty4, _val$specialty5, _val$specialty6, _val$specialty7, _val$specialty8;
27361
+
27362
+ // --- Specialty Details ---
27363
+ var specialtyDetailsArr = ((_data$specialtyDetail2 = data.specialtyDetails) !== null && _data$specialtyDetail2 !== void 0 ? _data$specialtyDetail2 : []).map(function (val) {
27364
+ var _specialty$descriptio, _specialty$specialtyC, _specialty$_id, _specialty$code, _specialty$descriptio2, _specialty$_id2;
27365
+ var effFrom = unixToLocalDate(val === null || val === void 0 ? void 0 : val.effFrom);
27366
+ var effTo = unixToLocalDate(val === null || val === void 0 ? void 0 : val.effTo);
27367
+ var specialty = (val === null || val === void 0 ? void 0 : val.specialty) || {};
27368
+ var label = specialty.description ? "".concat(specialty.description, " (").concat(specialty.specialtyCode || "", ")") : "";
27387
27369
  return {
27388
- effFrom: utcTOLocal(val === null || val === void 0 ? void 0 : val.effFrom, "DD-MM-YYYY"),
27389
- effTo: utcTOLocal(val === null || val === void 0 ? void 0 : val.effTo, "DD-MM-YYYY"),
27390
- specialty: val === null || val === void 0 || (_val$specialty = val.specialty) === null || _val$specialty === void 0 ? void 0 : _val$specialty.description,
27391
- code: val === null || val === void 0 || (_val$specialty2 = val.specialty) === null || _val$specialty2 === void 0 ? void 0 : _val$specialty2.specialtyCode,
27392
- specialty_id: val === null || val === void 0 || (_val$specialty3 = val.specialty) === null || _val$specialty3 === void 0 ? void 0 : _val$specialty3._id,
27393
- fromDate: moment(utcTOLocal(val === null || val === void 0 ? void 0 : val.effFrom, "DD-MM-YYYY"))._d,
27394
- // moment(val?.effFrom)._d,
27395
- toDate: moment(utcTOLocal(val === null || val === void 0 ? void 0 : val.effTo, "DD-MM-YYYY"))._d,
27396
- //moment(val.effTo)._d,
27370
+ effFrom: effFrom ? effFrom : null,
27371
+ effTo: effTo ? effTo : null,
27372
+ specialty: (_specialty$descriptio = specialty.description) !== null && _specialty$descriptio !== void 0 ? _specialty$descriptio : "",
27373
+ code: (_specialty$specialtyC = specialty.specialtyCode) !== null && _specialty$specialtyC !== void 0 ? _specialty$specialtyC : "",
27374
+ specialty_id: (_specialty$_id = specialty._id) !== null && _specialty$_id !== void 0 ? _specialty$_id : "",
27375
+ fromDate: effFrom,
27376
+ toDate: effTo,
27397
27377
  dropdown: {
27398
- label: (val === null || val === void 0 || (_val$specialty4 = val.specialty) === null || _val$specialty4 === void 0 ? void 0 : _val$specialty4.description) + " (" + (val === null || val === void 0 || (_val$specialty5 = val.specialty) === null || _val$specialty5 === void 0 ? void 0 : _val$specialty5.specialtyCode) + ")",
27399
- value: val === null || val === void 0 || (_val$specialty6 = val.specialty) === null || _val$specialty6 === void 0 ? void 0 : _val$specialty6.code,
27400
- name: val === null || val === void 0 || (_val$specialty7 = val.specialty) === null || _val$specialty7 === void 0 ? void 0 : _val$specialty7.description,
27401
- id: val === null || val === void 0 || (_val$specialty8 = val.specialty) === null || _val$specialty8 === void 0 ? void 0 : _val$specialty8._id
27378
+ label: label,
27379
+ value: (_specialty$code = specialty.code) !== null && _specialty$code !== void 0 ? _specialty$code : "",
27380
+ name: (_specialty$descriptio2 = specialty.description) !== null && _specialty$descriptio2 !== void 0 ? _specialty$descriptio2 : "",
27381
+ id: (_specialty$_id2 = specialty._id) !== null && _specialty$_id2 !== void 0 ? _specialty$_id2 : ""
27402
27382
  }
27403
27383
  };
27404
27384
  });
27405
- var ContactSettingsArr = data === null || data === void 0 || (_data$contactsettings = data.contactsettings) === null || _data$contactsettings === void 0 ? void 0 : _data$contactsettings.map(function (v, i) {
27406
- var _v$tenant3, _v$tenant4, _v$tenant5, _v$currency3, _v$currency4, _v$timezone3, _v$timezone4, _v$roundoffmode, _v$roundoffmode2, _v$roundoffmode3;
27385
+
27386
+ // --- Contact Settings ---
27387
+ var ContactSettingsArr = ((_data$contactsettings = data.contactsettings) !== null && _data$contactsettings !== void 0 ? _data$contactsettings : []).map(function (v) {
27388
+ var _v$tenant$display, _v$tenant$_id, _v$tenant$code, _v$currency$display, _v$currency$_id2, _v$orgdateformat, _v$orgtimeformat, _v$orgdatetimeformat, _v$timezone$display, _v$timezone$_id2, _v$roundoffmode$displ, _v$roundoffmode$_id, _v$roundoffmode$code, _v$decimalprecision;
27407
27389
  return {
27408
- tenant: {
27409
- title: v === null || v === void 0 || (_v$tenant3 = v.tenant) === null || _v$tenant3 === void 0 ? void 0 : _v$tenant3.display,
27410
- value: v === null || v === void 0 || (_v$tenant4 = v.tenant) === null || _v$tenant4 === void 0 ? void 0 : _v$tenant4._id,
27411
- code: v === null || v === void 0 || (_v$tenant5 = v.tenant) === null || _v$tenant5 === void 0 ? void 0 : _v$tenant5.code
27412
- },
27413
- currency: {
27414
- title: v === null || v === void 0 || (_v$currency3 = v.currency) === null || _v$currency3 === void 0 ? void 0 : _v$currency3.display,
27415
- value: v === null || v === void 0 || (_v$currency4 = v.currency) === null || _v$currency4 === void 0 ? void 0 : _v$currency4._id
27416
- },
27417
- dateformat: v === null || v === void 0 ? void 0 : v.orgdateformat,
27418
- timeformat: v === null || v === void 0 ? void 0 : v.orgtimeformat,
27419
- datetimeformat: v === null || v === void 0 ? void 0 : v.orgdatetimeformat,
27420
- timezone: {
27421
- title: v === null || v === void 0 || (_v$timezone3 = v.timezone) === null || _v$timezone3 === void 0 ? void 0 : _v$timezone3.display,
27422
- value: v === null || v === void 0 || (_v$timezone4 = v.timezone) === null || _v$timezone4 === void 0 ? void 0 : _v$timezone4._id
27423
- },
27424
- roundoffmode: {
27425
- title: v === null || v === void 0 || (_v$roundoffmode = v.roundoffmode) === null || _v$roundoffmode === void 0 ? void 0 : _v$roundoffmode.display,
27426
- value: v === null || v === void 0 || (_v$roundoffmode2 = v.roundoffmode) === null || _v$roundoffmode2 === void 0 ? void 0 : _v$roundoffmode2._id,
27427
- code: v === null || v === void 0 || (_v$roundoffmode3 = v.roundoffmode) === null || _v$roundoffmode3 === void 0 ? void 0 : _v$roundoffmode3.code
27428
- },
27429
- decimalprecision: v === null || v === void 0 ? void 0 : v.decimalprecision
27390
+ tenant: v !== null && v !== void 0 && v.tenant ? {
27391
+ title: (_v$tenant$display = v.tenant.display) !== null && _v$tenant$display !== void 0 ? _v$tenant$display : "",
27392
+ value: (_v$tenant$_id = v.tenant._id) !== null && _v$tenant$_id !== void 0 ? _v$tenant$_id : "",
27393
+ code: (_v$tenant$code = v.tenant.code) !== null && _v$tenant$code !== void 0 ? _v$tenant$code : ""
27394
+ } : null,
27395
+ currency: v !== null && v !== void 0 && v.currency ? {
27396
+ title: (_v$currency$display = v.currency.display) !== null && _v$currency$display !== void 0 ? _v$currency$display : "",
27397
+ value: (_v$currency$_id2 = v.currency._id) !== null && _v$currency$_id2 !== void 0 ? _v$currency$_id2 : ""
27398
+ } : null,
27399
+ dateformat: (_v$orgdateformat = v === null || v === void 0 ? void 0 : v.orgdateformat) !== null && _v$orgdateformat !== void 0 ? _v$orgdateformat : "",
27400
+ timeformat: (_v$orgtimeformat = v === null || v === void 0 ? void 0 : v.orgtimeformat) !== null && _v$orgtimeformat !== void 0 ? _v$orgtimeformat : "",
27401
+ datetimeformat: (_v$orgdatetimeformat = v === null || v === void 0 ? void 0 : v.orgdatetimeformat) !== null && _v$orgdatetimeformat !== void 0 ? _v$orgdatetimeformat : "",
27402
+ timezone: v !== null && v !== void 0 && v.timezone ? {
27403
+ title: (_v$timezone$display = v.timezone.display) !== null && _v$timezone$display !== void 0 ? _v$timezone$display : "",
27404
+ value: (_v$timezone$_id2 = v.timezone._id) !== null && _v$timezone$_id2 !== void 0 ? _v$timezone$_id2 : ""
27405
+ } : null,
27406
+ roundoffmode: v !== null && v !== void 0 && v.roundoffmode ? {
27407
+ title: (_v$roundoffmode$displ = v.roundoffmode.display) !== null && _v$roundoffmode$displ !== void 0 ? _v$roundoffmode$displ : "",
27408
+ value: (_v$roundoffmode$_id = v.roundoffmode._id) !== null && _v$roundoffmode$_id !== void 0 ? _v$roundoffmode$_id : "",
27409
+ code: (_v$roundoffmode$code = v.roundoffmode.code) !== null && _v$roundoffmode$code !== void 0 ? _v$roundoffmode$code : ""
27410
+ } : null,
27411
+ decimalprecision: (_v$decimalprecision = v === null || v === void 0 ? void 0 : v.decimalprecision) !== null && _v$decimalprecision !== void 0 ? _v$decimalprecision : null
27430
27412
  };
27431
27413
  });
27414
+
27415
+ // --- Parent Entity ---
27416
+ var ParentEntity_ = (data === null || data === void 0 || (_data$ParentOrgID = data.ParentOrgID) === null || _data$ParentOrgID === void 0 ? void 0 : _data$ParentOrgID.length) > 0 ? (Parentget !== null && Parentget !== void 0 ? Parentget : []).filter(function (val) {
27417
+ return (val === null || val === void 0 ? void 0 : val.value) === data.ParentOrgID[0];
27418
+ }) : [];
27419
+
27420
+ // --- Logo/Image ---
27421
+ var imageDetails_ = data !== null && data !== void 0 && (_data$logo = data.logo) !== null && _data$logo !== void 0 && _data$logo[0] ? [{
27422
+ fileid: (_data$logo$0$fileid = data.logo[0].fileid) !== null && _data$logo$0$fileid !== void 0 ? _data$logo$0$fileid : "",
27423
+ filetype: (_data$logo$0$filetype = data.logo[0].filetype) !== null && _data$logo$0$filetype !== void 0 ? _data$logo$0$filetype : "",
27424
+ objectid: (_data$logo$0$objectid = data.logo[0].objectid) !== null && _data$logo$0$objectid !== void 0 ? _data$logo$0$objectid : "",
27425
+ filename: (_data$logo$0$fileName = data.logo[0].fileName) !== null && _data$logo$0$fileName !== void 0 ? _data$logo$0$fileName : ""
27426
+ }] : null;
27427
+
27428
+ // --- Final Return Object ---
27432
27429
  return {
27433
27430
  _key: data === null || data === void 0 ? void 0 : data._key,
27434
- status: data === null || data === void 0 ? void 0 : data.active,
27435
- EntityType_: {
27436
- title: data === null || data === void 0 || (_data$OrgType$ = data.OrgType[0]) === null || _data$OrgType$ === void 0 ? void 0 : _data$OrgType$.display,
27437
- value: data === null || data === void 0 || (_data$OrgType$2 = data.OrgType[0]) === null || _data$OrgType$2 === void 0 ? void 0 : _data$OrgType$2._id,
27438
- code: data === null || data === void 0 || (_data$OrgType$3 = data.OrgType[0]) === null || _data$OrgType$3 === void 0 ? void 0 : _data$OrgType$3.code
27439
- },
27440
- ParentEntity_: (data === null || data === void 0 || (_data$ParentOrgID = data.ParentOrgID) === null || _data$ParentOrgID === void 0 ? void 0 : _data$ParentOrgID.length) > 0 ? Parentget === null || Parentget === void 0 ? void 0 : Parentget.filter(function (val) {
27441
- return (val === null || val === void 0 ? void 0 : val.value) === (data === null || data === void 0 ? void 0 : data.ParentOrgID[0]);
27442
- }) : [],
27443
- LevelOfCare_: {
27444
- title: data === null || data === void 0 || (_data$levelofcareid = data.levelofcareid) === null || _data$levelofcareid === void 0 ? void 0 : _data$levelofcareid.description,
27445
- value: data === null || data === void 0 || (_data$levelofcareid2 = data.levelofcareid) === null || _data$levelofcareid2 === void 0 ? void 0 : _data$levelofcareid2._id
27446
- },
27447
- EntityCode_: data === null || data === void 0 ? void 0 : data.entitycode,
27448
- EntityName_: data === null || data === void 0 ? void 0 : data.name,
27449
- GstCode_: data === null || data === void 0 ? void 0 : data.gstcode,
27450
- //
27431
+ status: (_data$active = data === null || data === void 0 ? void 0 : data.active) !== null && _data$active !== void 0 ? _data$active : false,
27432
+ EntityType_: data !== null && data !== void 0 && (_data$OrgType = data.OrgType) !== null && _data$OrgType !== void 0 && _data$OrgType[0] ? {
27433
+ title: (_data$OrgType$0$displ = data.OrgType[0].display) !== null && _data$OrgType$0$displ !== void 0 ? _data$OrgType$0$displ : "",
27434
+ value: (_data$OrgType$0$_id = data.OrgType[0]._id) !== null && _data$OrgType$0$_id !== void 0 ? _data$OrgType$0$_id : "",
27435
+ code: (_data$OrgType$0$code = data.OrgType[0].code) !== null && _data$OrgType$0$code !== void 0 ? _data$OrgType$0$code : ""
27436
+ } : null,
27437
+ ParentEntity_: ParentEntity_,
27438
+ LevelOfCare_: data !== null && data !== void 0 && data.levelofcareid ? {
27439
+ title: (_data$levelofcareid$d = data.levelofcareid.description) !== null && _data$levelofcareid$d !== void 0 ? _data$levelofcareid$d : "",
27440
+ value: (_data$levelofcareid$_ = data.levelofcareid._id) !== null && _data$levelofcareid$_ !== void 0 ? _data$levelofcareid$_ : ""
27441
+ } : null,
27442
+ EntityCode_: (_data$entitycode = data === null || data === void 0 ? void 0 : data.entitycode) !== null && _data$entitycode !== void 0 ? _data$entitycode : "",
27443
+ EntityName_: (_data$name = data === null || data === void 0 ? void 0 : data.name) !== null && _data$name !== void 0 ? _data$name : "",
27444
+ GstCode_: (_data$gstcode = data === null || data === void 0 ? void 0 : data.gstcode) !== null && _data$gstcode !== void 0 ? _data$gstcode : "",
27451
27445
  Identification_: IdentificationArr,
27452
27446
  Alias_: AliasArr,
27453
27447
  Address_: AddressArr,
27454
27448
  Contact_: ContactArr,
27455
27449
  ContactPersonDetails_: ContactPersonDetailsArr,
27456
- specialtyDetails: specialtyDetailsarr,
27450
+ specialtyDetails: specialtyDetailsArr,
27457
27451
  contactsettings: ContactSettingsArr,
27458
27452
  external: (_data$isExternal = data === null || data === void 0 ? void 0 : data.isExternal) !== null && _data$isExternal !== void 0 ? _data$isExternal : false,
27459
- imageDetails_: data !== null && data !== void 0 && (_data$logo$ = data.logo[0]) !== null && _data$logo$ !== void 0 && _data$logo$.fileid ? [{
27460
- fileid: data === null || data === void 0 || (_data$logo$2 = data.logo[0]) === null || _data$logo$2 === void 0 ? void 0 : _data$logo$2.fileid,
27461
- filetype: data === null || data === void 0 || (_data$logo$3 = data.logo[0]) === null || _data$logo$3 === void 0 ? void 0 : _data$logo$3.filetype,
27462
- objectid: data === null || data === void 0 || (_data$logo$4 = data.logo[0]) === null || _data$logo$4 === void 0 ? void 0 : _data$logo$4.objectid,
27463
- filename: data === null || data === void 0 || (_data$logo$5 = data.logo[0]) === null || _data$logo$5 === void 0 ? void 0 : _data$logo$5.fileName
27464
- }] : null
27453
+ imageDetails_: imageDetails_
27465
27454
  };
27466
27455
  }
27467
27456
  };
@@ -27486,10 +27475,12 @@ var ORGANIZATION_TREE_READ = createAsyncThunk("organizationSlice/organizationTre
27486
27475
  _context.n = 2;
27487
27476
  return fetchData({
27488
27477
  body: JSON.stringify(queries$d.getTreeStuct(type))
27489
- }, __readDocumentUrl__);
27478
+ },
27479
+ // __readDocumentUrl__
27480
+ __baseUrl__$1);
27490
27481
  case 2:
27491
27482
  data = _context.v;
27492
- getJson = ReadTreeJson(data.result);
27483
+ getJson = ReadTreeJson(data);
27493
27484
  return _context.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
27494
27485
  data: getJson
27495
27486
  }));
@@ -27838,9 +27829,8 @@ var ORGANIZATION_READ_DETAILS = createAsyncThunk("organizationSlice/organization
27838
27829
  var payload,
27839
27830
  _ref16,
27840
27831
  rejectWithValue,
27841
- _data$result,
27842
- _data$result2,
27843
- _parentOrgName$result,
27832
+ _data$5,
27833
+ _parentOrgName,
27844
27834
  _key,
27845
27835
  data,
27846
27836
  parentOrgId,
@@ -27858,10 +27848,12 @@ var ORGANIZATION_READ_DETAILS = createAsyncThunk("organizationSlice/organization
27858
27848
  _context9.n = 2;
27859
27849
  return fetchData({
27860
27850
  body: JSON.stringify(queries$d.getTreeDetails(_key))
27861
- }, __readDocumentUrl__);
27851
+ },
27852
+ // __readDocumentUrl__
27853
+ __baseUrl__$1);
27862
27854
  case 2:
27863
27855
  data = _context9.v;
27864
- parentOrgId = data === null || data === void 0 || (_data$result = data.result) === null || _data$result === void 0 || (_data$result = _data$result[0]) === null || _data$result === void 0 || (_data$result = _data$result.ParentOrgID) === null || _data$result === void 0 ? void 0 : _data$result[0];
27856
+ parentOrgId = data === null || data === void 0 || (_data$5 = data[0]) === null || _data$5 === void 0 || (_data$5 = _data$5.ParentOrgID) === null || _data$5 === void 0 ? void 0 : _data$5[0];
27865
27857
  parentOrgName = 0;
27866
27858
  if (!parentOrgId) {
27867
27859
  _context9.n = 4;
@@ -27870,11 +27862,13 @@ var ORGANIZATION_READ_DETAILS = createAsyncThunk("organizationSlice/organization
27870
27862
  _context9.n = 3;
27871
27863
  return fetchData({
27872
27864
  body: JSON.stringify(queries$d.getParentOrgNameById(parentOrgId))
27873
- }, __readDocumentUrl__);
27865
+ },
27866
+ // __readDocumentUrl__
27867
+ __baseUrl__$1);
27874
27868
  case 3:
27875
27869
  parentOrgName = _context9.v;
27876
27870
  case 4:
27877
- getJson = ReadTreeDetailJson((_data$result2 = data.result) === null || _data$result2 === void 0 ? void 0 : _data$result2[0], (_parentOrgName$result = parentOrgName.result) === null || _parentOrgName$result === void 0 || (_parentOrgName$result = _parentOrgName$result[0]) === null || _parentOrgName$result === void 0 ? void 0 : _parentOrgName$result.name);
27871
+ getJson = ReadTreeDetailJson(data === null || data === void 0 ? void 0 : data[0], (_parentOrgName = parentOrgName) === null || _parentOrgName === void 0 || (_parentOrgName = _parentOrgName[0]) === null || _parentOrgName === void 0 ? void 0 : _parentOrgName.name);
27878
27872
  return _context9.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
27879
27873
  data: getJson
27880
27874
  }));
@@ -27890,7 +27884,7 @@ var ORGANIZATION_READ_DETAILS = createAsyncThunk("organizationSlice/organization
27890
27884
  var ORGANIZATION_GET_ADD_TYPE = createAsyncThunk("organizationSlice/orgAddType", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
27891
27885
  var _ref18,
27892
27886
  rejectWithValue,
27893
- _data$5,
27887
+ _data$6,
27894
27888
  body,
27895
27889
  data,
27896
27890
  arry,
@@ -27918,7 +27912,7 @@ var ORGANIZATION_GET_ADD_TYPE = createAsyncThunk("organizationSlice/orgAddType",
27918
27912
  case 2:
27919
27913
  data = _context0.v;
27920
27914
  arry = [];
27921
- (_data$5 = data[0]) === null || _data$5 === void 0 || (_data$5 = _data$5.ADDRESSTYPE) === null || _data$5 === void 0 || (_data$5 = _data$5.Value) === null || _data$5 === void 0 || _data$5.map(function (item) {
27915
+ (_data$6 = data[0]) === null || _data$6 === void 0 || (_data$6 = _data$6.ADDRESSTYPE) === null || _data$6 === void 0 || (_data$6 = _data$6.Value) === null || _data$6 === void 0 || _data$6.map(function (item) {
27922
27916
  return arry.push({
27923
27917
  _id: item._id,
27924
27918
  value: item._id,
@@ -27941,7 +27935,7 @@ var ORGANIZATION_GET_ADD_TYPE = createAsyncThunk("organizationSlice/orgAddType",
27941
27935
  var ORGANIZATION_GET_ADD_USE = createAsyncThunk("organizationSlice/orgAddUSE", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
27942
27936
  var _ref20,
27943
27937
  rejectWithValue,
27944
- _data$6,
27938
+ _data$7,
27945
27939
  body,
27946
27940
  data,
27947
27941
  arry,
@@ -27969,7 +27963,7 @@ var ORGANIZATION_GET_ADD_USE = createAsyncThunk("organizationSlice/orgAddUSE", /
27969
27963
  case 2:
27970
27964
  data = _context1.v;
27971
27965
  arry = [];
27972
- (_data$6 = data[0]) === null || _data$6 === void 0 || (_data$6 = _data$6.ADDRESSUSE) === null || _data$6 === void 0 || (_data$6 = _data$6.Value) === null || _data$6 === void 0 || _data$6.map(function (item) {
27966
+ (_data$7 = data[0]) === null || _data$7 === void 0 || (_data$7 = _data$7.ADDRESSUSE) === null || _data$7 === void 0 || (_data$7 = _data$7.Value) === null || _data$7 === void 0 || _data$7.map(function (item) {
27973
27967
  return arry.push({
27974
27968
  _id: item._id,
27975
27969
  value: item._id,
@@ -28245,7 +28239,7 @@ var ORGANIZATION_GET_PINCODE = createAsyncThunk("organizationSlice/orgAddPINCODE
28245
28239
  var ORGANIZATION_GET_CONTACTDETAILMODE = createAsyncThunk("organizationSlice/orgContactDetailMode", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
28246
28240
  var _ref32,
28247
28241
  rejectWithValue,
28248
- _data$7,
28242
+ _data$8,
28249
28243
  body,
28250
28244
  data,
28251
28245
  arry,
@@ -28273,7 +28267,7 @@ var ORGANIZATION_GET_CONTACTDETAILMODE = createAsyncThunk("organizationSlice/org
28273
28267
  case 2:
28274
28268
  data = _context15.v;
28275
28269
  arry = [];
28276
- (_data$7 = data[0]) === null || _data$7 === void 0 || (_data$7 = _data$7.CONTACTSYSTEM) === null || _data$7 === void 0 || (_data$7 = _data$7.Value) === null || _data$7 === void 0 || _data$7.map(function (item) {
28270
+ (_data$8 = data[0]) === null || _data$8 === void 0 || (_data$8 = _data$8.CONTACTSYSTEM) === null || _data$8 === void 0 || (_data$8 = _data$8.Value) === null || _data$8 === void 0 || _data$8.map(function (item) {
28277
28271
  return arry.push({
28278
28272
  _id: item._id,
28279
28273
  value: item._id,
@@ -28342,7 +28336,7 @@ var ORGANIZATION_GET_CONNTACTDETAILCODE = createAsyncThunk("organizationSlice/or
28342
28336
  var ORGANIZATION_GET_CONTACTDETAILUSE = createAsyncThunk("organizationSlice/orgContactDetailUse", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
28343
28337
  var _ref36,
28344
28338
  rejectWithValue,
28345
- _data$8,
28339
+ _data$9,
28346
28340
  body,
28347
28341
  data,
28348
28342
  arry,
@@ -28370,7 +28364,7 @@ var ORGANIZATION_GET_CONTACTDETAILUSE = createAsyncThunk("organizationSlice/orgC
28370
28364
  case 2:
28371
28365
  data = _context17.v;
28372
28366
  arry = [];
28373
- (_data$8 = data[0]) === null || _data$8 === void 0 || (_data$8 = _data$8.USE) === null || _data$8 === void 0 || (_data$8 = _data$8.Value) === null || _data$8 === void 0 || _data$8.map(function (item) {
28367
+ (_data$9 = data[0]) === null || _data$9 === void 0 || (_data$9 = _data$9.USE) === null || _data$9 === void 0 || (_data$9 = _data$9.Value) === null || _data$9 === void 0 || _data$9.map(function (item) {
28374
28368
  return arry.push({
28375
28369
  _id: item._id,
28376
28370
  value: item._id,
@@ -28528,7 +28522,7 @@ var ORGANIZATION_GET_TIMEZONE = createAsyncThunk("organizationSlice/orgSettingsT
28528
28522
  var ORGANIZATION_GET_CONTACTDETAILPRIORITY = createAsyncThunk("organizationSlice/0", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21() {
28529
28523
  var _ref44,
28530
28524
  rejectWithValue,
28531
- _data$9,
28525
+ _data$0,
28532
28526
  body,
28533
28527
  data,
28534
28528
  arry,
@@ -28556,7 +28550,7 @@ var ORGANIZATION_GET_CONTACTDETAILPRIORITY = createAsyncThunk("organizationSlice
28556
28550
  case 2:
28557
28551
  data = _context21.v;
28558
28552
  arry = [];
28559
- (_data$9 = data[0]) === null || _data$9 === void 0 || (_data$9 = _data$9.PRIORITY) === null || _data$9 === void 0 || (_data$9 = _data$9.Value) === null || _data$9 === void 0 || _data$9.map(function (item) {
28553
+ (_data$0 = data[0]) === null || _data$0 === void 0 || (_data$0 = _data$0.PRIORITY) === null || _data$0 === void 0 || (_data$0 = _data$0.Value) === null || _data$0 === void 0 || _data$0.map(function (item) {
28560
28554
  return arry.push({
28561
28555
  _id: item._id,
28562
28556
  value: item._id,
@@ -28579,7 +28573,7 @@ var ORGANIZATION_GET_CONTACTDETAILPRIORITY = createAsyncThunk("organizationSlice
28579
28573
  var ORGANIZATION_GET_CONTACT_PREFIX = createAsyncThunk("organizationSlice/orgNamePrefix", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22() {
28580
28574
  var _ref46,
28581
28575
  rejectWithValue,
28582
- _data$0,
28576
+ _data$1,
28583
28577
  body,
28584
28578
  data,
28585
28579
  arry,
@@ -28607,7 +28601,7 @@ var ORGANIZATION_GET_CONTACT_PREFIX = createAsyncThunk("organizationSlice/orgNam
28607
28601
  case 2:
28608
28602
  data = _context22.v;
28609
28603
  arry = [];
28610
- (_data$0 = data[0]) === null || _data$0 === void 0 || (_data$0 = _data$0.NAMEPREFIX) === null || _data$0 === void 0 || (_data$0 = _data$0.Value) === null || _data$0 === void 0 || _data$0.map(function (item) {
28604
+ (_data$1 = data[0]) === null || _data$1 === void 0 || (_data$1 = _data$1.NAMEPREFIX) === null || _data$1 === void 0 || (_data$1 = _data$1.Value) === null || _data$1 === void 0 || _data$1.map(function (item) {
28611
28605
  return arry.push({
28612
28606
  _id: item._id,
28613
28607
  value: item._id,
@@ -28630,7 +28624,7 @@ var ORGANIZATION_GET_CONTACT_PREFIX = createAsyncThunk("organizationSlice/orgNam
28630
28624
  var ORGANIZATION_GET_CONTACT_SUFFIX = createAsyncThunk("organizationSlice/orgNameSuffix", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
28631
28625
  var _ref48,
28632
28626
  rejectWithValue,
28633
- _data$1,
28627
+ _data$10,
28634
28628
  body,
28635
28629
  data,
28636
28630
  arry,
@@ -28658,7 +28652,7 @@ var ORGANIZATION_GET_CONTACT_SUFFIX = createAsyncThunk("organizationSlice/orgNam
28658
28652
  case 2:
28659
28653
  data = _context23.v;
28660
28654
  arry = [];
28661
- (_data$1 = data[0]) === null || _data$1 === void 0 || (_data$1 = _data$1.NAMESUFFIX) === null || _data$1 === void 0 || (_data$1 = _data$1.Value) === null || _data$1 === void 0 || _data$1.map(function (item) {
28655
+ (_data$10 = data[0]) === null || _data$10 === void 0 || (_data$10 = _data$10.NAMESUFFIX) === null || _data$10 === void 0 || (_data$10 = _data$10.Value) === null || _data$10 === void 0 || _data$10.map(function (item) {
28662
28656
  return arry.push({
28663
28657
  _id: item._id,
28664
28658
  value: item._id,
@@ -28681,7 +28675,7 @@ var ORGANIZATION_GET_CONTACT_SUFFIX = createAsyncThunk("organizationSlice/orgNam
28681
28675
  var ORGANIZATION_GET_CONTACT_DESI = createAsyncThunk("organizationSlice/positionDesi", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
28682
28676
  var _ref50,
28683
28677
  rejectWithValue,
28684
- _data$10,
28678
+ _data$11,
28685
28679
  body,
28686
28680
  data,
28687
28681
  arry,
@@ -28709,7 +28703,7 @@ var ORGANIZATION_GET_CONTACT_DESI = createAsyncThunk("organizationSlice/position
28709
28703
  case 2:
28710
28704
  data = _context24.v;
28711
28705
  arry = [];
28712
- (_data$10 = data[0]) === null || _data$10 === void 0 || (_data$10 = _data$10.DESIGNATION) === null || _data$10 === void 0 || (_data$10 = _data$10.Value) === null || _data$10 === void 0 || _data$10.map(function (item) {
28706
+ (_data$11 = data[0]) === null || _data$11 === void 0 || (_data$11 = _data$11.DESIGNATION) === null || _data$11 === void 0 || (_data$11 = _data$11.Value) === null || _data$11 === void 0 || _data$11.map(function (item) {
28713
28707
  return arry.push({
28714
28708
  _id: item._id,
28715
28709
  value: item._id,
@@ -28786,11 +28780,13 @@ var ORG_FROM_GET = createAsyncThunk("organizationSlice/getOrganization", /*#__PU
28786
28780
  _context26.n = 2;
28787
28781
  return fetchData({
28788
28782
  body: JSON.stringify(queries$d.getParentEntityFull())
28789
- }, __readDocumentUrl__);
28783
+ },
28784
+ // __readDocumentUrl__
28785
+ __baseUrl__$1);
28790
28786
  case 2:
28791
28787
  getParentEntityData = _context26.v;
28792
28788
  result = [];
28793
- getParentEntityData.result.map(function (val, i) {
28789
+ getParentEntityData.map(function (val, i) {
28794
28790
  if (val !== null && val !== void 0 && val.name && val !== null && val !== void 0 && val._id) {
28795
28791
  result.push({
28796
28792
  title: val === null || val === void 0 ? void 0 : val.name,
@@ -28801,10 +28797,13 @@ var ORG_FROM_GET = createAsyncThunk("organizationSlice/getOrganization", /*#__PU
28801
28797
  _context26.n = 3;
28802
28798
  return fetchData({
28803
28799
  body: JSON.stringify(queries$d.getTreeDetails(key))
28804
- }, __readDocumentUrl__);
28800
+ },
28801
+ // __readDocumentUrl__
28802
+ __baseUrl__$1);
28805
28803
  case 3:
28806
28804
  data = _context26.v;
28807
- queriesjson = generateReadJson$2.read_json(data.result[0], result);
28805
+ queriesjson = generateReadJson$2.read_json(data === null || data === void 0 ? void 0 : data[0], result);
28806
+ console.log("queriesjson get treedetails", queriesjson);
28808
28807
  return _context26.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
28809
28808
  data: queriesjson
28810
28809
  }));
@@ -39547,9 +39546,12 @@ var queries$2 = {
39547
39546
  codingMasterQuery: function codingMasterQuery(name) {
39548
39547
  return {
39549
39548
  db_name: _dbName,
39550
- entity: "CodingMaster",
39551
- filter: "CodingMaster.Type== '".concat(name, "' && CodingMaster.activestatus==true && CodingMaster.status==true"),
39552
- return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')"
39549
+ queryid: "95931016-caf1-413c-8bf5-96f05c5709fb",
39550
+ filter: {
39551
+ type: "".concat(name),
39552
+ status: true,
39553
+ activestatus: true
39554
+ }
39553
39555
  };
39554
39556
  }
39555
39557
  };
@@ -39668,11 +39670,11 @@ var fetchMaster = function fetchMaster(name, query) {
39668
39670
  _context3.n = 1;
39669
39671
  return fetchData({
39670
39672
  body: query
39671
- }, __readDocumentUrl__);
39673
+ }, __baseUrl__$1);
39672
39674
  case 1:
39673
39675
  data = _context3.v;
39674
39676
  resolve({
39675
- data: data.result,
39677
+ data: data,
39676
39678
  name: name
39677
39679
  });
39678
39680
  case 2: