@persei/perseed-api 4.34.10 → 4.34.11

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.
package/dist/index.d.ts CHANGED
@@ -911,6 +911,19 @@ export declare interface NotificationConfigurationConf {
911
911
  conditionsFormat?: ConditionsFormat;
912
912
  }
913
913
 
914
+ export declare class NotifiedAboutInfo {
915
+ notified_about: string;
916
+ constructor(notifiedAbout: string);
917
+ crfName(): string | null;
918
+ actionTrigger(): TriggerAction | null;
919
+ isCrfTrigger(): boolean;
920
+ isModelTrigger(): boolean;
921
+ isDisplayerTrigger(): boolean;
922
+ isFieldTrigger(): boolean;
923
+ getModelName(): string | undefined;
924
+ getModelTriggerAction(): string | null;
925
+ }
926
+
914
927
  export declare type NotifiedAboutType = `model_${ModelName}` | `model_displayer_${ModelName}` | `model_${ModelName}_${TriggerAction}` | `model_displayer_${ModelName}_${TriggerAction}`;
915
928
 
916
929
  declare type NoUserRequestContext = Omit<RequestContext, 'userId' | 'patientId' | 'ip' | 'user' | 'userLanguage' | 'coreProfiling' | 'userRole' | 'loginId'>;
@@ -962,6 +975,8 @@ export declare interface OutcomesParams {
962
975
  orderDir?: OrderDir;
963
976
  }
964
977
 
978
+ export declare const PATIENT_CREATION_ABOUT = "Patient Creation";
979
+
965
980
  export declare interface PatientListProps {
966
981
  loadUserProfiles?: boolean;
967
982
  loadAdherence?: boolean;
@@ -1,4 +1,4 @@
1
- const l = "YYYY-MM-DD", b = "HH:mm:ss", y = "HH:mm", P = "YYYY-MM-DD HH:mm", F = l, w = "YYYY-MM-DD HH:mm:ss", n = {
1
+ const p = "YYYY-MM-DD", g = "HH:mm:ss", y = "HH:mm", P = "YYYY-MM-DD HH:mm", F = p, w = "YYYY-MM-DD HH:mm:ss", _ = {
2
2
  DECIMAL: 1,
3
3
  INTEGER: 2,
4
4
  MULTIPLE_SELECTION: 3,
@@ -23,7 +23,7 @@ const l = "YYYY-MM-DD", b = "HH:mm:ss", y = "HH:mm", P = "YYYY-MM-DD HH:mm", F =
23
23
  SCAN_CODE: 22,
24
24
  PARAGRAPH: 23,
25
25
  FILE: 24
26
- }, t = {
26
+ }, r = {
27
27
  DECIMAL_NAME: "decimal",
28
28
  INTEGER_NAME: "integer",
29
29
  MULTIPLE_SELECTION_NAME: "multiple_selection",
@@ -49,16 +49,16 @@ const l = "YYYY-MM-DD", b = "HH:mm:ss", y = "HH:mm", P = "YYYY-MM-DD HH:mm", F =
49
49
  PARAGRAPH_NAME: "paragraph",
50
50
  FILE_NAME: "file"
51
51
  };
52
- var p = /* @__PURE__ */ ((e) => (e[e.STATIC = 0] = "STATIC", e[e.STANDARD = 1] = "STANDARD", e[e.FOLLOW_UP = 2] = "FOLLOW_UP", e[e.ADVERSE_EVENT = 3] = "ADVERSE_EVENT", e[e.QUESTIONNAIRE = 5] = "QUESTIONNAIRE", e[e.STUDY = 6] = "STUDY", e))(p || {});
53
- const g = () => {
52
+ var T = /* @__PURE__ */ ((e) => (e[e.STATIC = 0] = "STATIC", e[e.STANDARD = 1] = "STANDARD", e[e.FOLLOW_UP = 2] = "FOLLOW_UP", e[e.ADVERSE_EVENT = 3] = "ADVERSE_EVENT", e[e.QUESTIONNAIRE = 5] = "QUESTIONNAIRE", e[e.STUDY = 6] = "STUDY", e))(T || {});
53
+ const H = () => {
54
54
  let e = {};
55
- return Object.keys(n).forEach((a) => {
55
+ return Object.keys(_).forEach((s) => {
56
56
  e = {
57
57
  ...e,
58
- [n[a]]: t[`${a}_NAME`]
58
+ [_[s]]: r[`${s}_NAME`]
59
59
  };
60
60
  }), e;
61
- }, H = ["number", t.DECIMAL_NAME, t.INTEGER_NAME], Y = ["date"], B = ["object", t.SCAN_CODE_NAME], m = {
61
+ }, Y = ["number", r.DECIMAL_NAME, r.INTEGER_NAME], B = ["date"], x = ["object", r.SCAN_CODE_NAME], m = {
62
62
  CREATION_TIME: "creation_time",
63
63
  CREATION_USER: "creation_user",
64
64
  CRF_NAME: "crf_name",
@@ -85,7 +85,7 @@ const g = () => {
85
85
  VERSION: "version",
86
86
  REFERENCE: "reference",
87
87
  SUBFORM_ID: "subform_id"
88
- }, x = Object.values(m), V = {
88
+ }, W = Object.values(m), V = {
89
89
  added: "A",
90
90
  edited: "E",
91
91
  deleted: "D"
@@ -94,14 +94,14 @@ const g = () => {
94
94
  SEPARATOR: "_"
95
95
  }, k = {
96
96
  AUDIT: "audit"
97
- }, q = "~", G = "_status", Q = "_status", W = {
97
+ }, q = "~", G = "_status", Q = "_status", K = {
98
98
  filled: "filled",
99
99
  unk: "UNK",
100
100
  na: "NA",
101
101
  nd: "ND"
102
- }, T = /^[0-9a-f]{33}_status$/, K = function(e) {
103
- return !T.test(e);
104
- }, j = ["UNK", "NA", "ND"], z = "^[0-1][0-9]:[0-5][0-9]$|^[0-2][0-3]:[0-5][0-9]$", J = {
102
+ }, A = /^[0-9a-f]{33}_status$/, j = function(e) {
103
+ return !A.test(e);
104
+ }, z = ["UNK", "NA", "ND"], J = "^[0-1][0-9]:[0-5][0-9]$|^[0-2][0-3]:[0-5][0-9]$", Z = {
105
105
  DEPENDENT_SOURCE: "dependent_source",
106
106
  ENCRYPTED: "encrypted",
107
107
  ENCRYPTED_LEVEL: "encrypted_level",
@@ -165,12 +165,12 @@ const g = () => {
165
165
  WINDOW_BEFORE: "window_before",
166
166
  WINDOW_AFTER: "window_after",
167
167
  WINDOW_PERIOD: "window_period"
168
- }, Z = {
168
+ }, $ = {
169
169
  STRICT: "strict",
170
170
  FLEXIBLE: "flexible"
171
- }, $ = {
172
- ACTIVE: "1"
173
171
  }, ee = {
172
+ ACTIVE: "1"
173
+ }, te = {
174
174
  SLIDER: "slider",
175
175
  DROPDOWN: "dropdown",
176
176
  RADIO_BUTTON: "radio_button",
@@ -183,16 +183,16 @@ const g = () => {
183
183
  [o.STARS]: "stars",
184
184
  [o.SCALE_RATING]: "scale",
185
185
  [o.IMAGES]: "images"
186
- }, i = {
186
+ }, l = {
187
187
  HORIZONTAL: "0",
188
188
  VERTICAL: "1"
189
189
  }, ae = {
190
- [i.HORIZONTAL]: "horizontal",
191
- [i.VERTICAL]: "vertical"
192
- }, te = {
190
+ [l.HORIZONTAL]: "horizontal",
191
+ [l.VERTICAL]: "vertical"
192
+ }, re = {
193
193
  NEW_WINDOW: "newwindow",
194
194
  EMBEDDED_HTML: "embeddedhtml"
195
- }, oe = {
195
+ }, ie = {
196
196
  1: ["image/jpg", "image/jpeg", "image/bmp", "image/gif", "image/png"],
197
197
  // Images
198
198
  2: [
@@ -240,7 +240,7 @@ const g = () => {
240
240
  "video/x-flv"
241
241
  ]
242
242
  // Video
243
- }, re = [
243
+ }, oe = [
244
244
  {
245
245
  id: "1",
246
246
  name: "patient_number",
@@ -269,8 +269,8 @@ const g = () => {
269
269
  status: "1"
270
270
  }
271
271
  ];
272
- var A = /* @__PURE__ */ ((e) => (e.OUTCOMES = "outcomes", e))(A || {}), I = /* @__PURE__ */ ((e) => (e.VALUECARD = "ValueCard", e.SECTIONCARD = "SectionCard", e.PATIENTLIST = "PatientList", e))(I || {}), N = /* @__PURE__ */ ((e) => (e.QUESTIONNAIRE_CREATE = "questionnaire.create", e.CRF_CREATE = "crf.create", e.CRF_UPDATE = "crf.update", e.CRF_DELETE = "crf.delete", e.EXTERNAL_API_CALL = "external_api_call", e))(N || {}), u = /* @__PURE__ */ ((e) => (e.JSON_LOGIC = "jsonLogic", e.CUSTOM = "custom", e))(u || {}), R = /* @__PURE__ */ ((e) => (e.CREATION = "creation", e.UPDATE = "update", e))(R || {}), s = /* @__PURE__ */ ((e) => (e.TEXT = "text", e.DATE = "date", e.TIME = "time", e.BOOLEAN = "boolean", e.NUMBER = "number", e.SELECT = "select", e.MULTISELECT = "multiselect", e.HIDDEN = "hidden", e))(s || {});
273
- const S = {}, O = {}, L = {}, D = {}, U = {
272
+ var u = /* @__PURE__ */ ((e) => (e.OUTCOMES = "outcomes", e))(u || {}), I = /* @__PURE__ */ ((e) => (e.VALUECARD = "ValueCard", e.SECTIONCARD = "SectionCard", e.PATIENTLIST = "PatientList", e))(I || {}), N = /* @__PURE__ */ ((e) => (e.QUESTIONNAIRE_CREATE = "questionnaire.create", e.CRF_CREATE = "crf.create", e.CRF_UPDATE = "crf.update", e.CRF_DELETE = "crf.delete", e.EXTERNAL_API_CALL = "external_api_call", e))(N || {}), R = /* @__PURE__ */ ((e) => (e.JSON_LOGIC = "jsonLogic", e.CUSTOM = "custom", e))(R || {}), a = /* @__PURE__ */ ((e) => (e.CREATION = "creation", e.UPDATE = "update", e))(a || {}), t = /* @__PURE__ */ ((e) => (e.TEXT = "text", e.DATE = "date", e.TIME = "time", e.BOOLEAN = "boolean", e.NUMBER = "number", e.SELECT = "select", e.MULTISELECT = "multiselect", e.HIDDEN = "hidden", e))(t || {});
273
+ const S = {}, O = {}, L = {}, D = {}, M = {
274
274
  hostName: "mysql",
275
275
  ecosystem: {
276
276
  demo: {
@@ -377,23 +377,23 @@ const S = {}, O = {}, L = {}, D = {}, U = {
377
377
  deviceId: "ecoadmin@api"
378
378
  }
379
379
  }
380
- }, M = {}, _ = {};
381
- let c;
382
- _.existsSync("./credentials/local.json") && (c = JSON.parse(_.readFileSync("./credentials/local.json").toString()));
380
+ }, U = {}, c = {};
381
+ let d;
382
+ c.existsSync("./credentials/local.json") && (d = JSON.parse(c.readFileSync("./credentials/local.json").toString()));
383
383
  const C = {
384
- local: c || S,
384
+ local: d || S,
385
385
  local_tmp: O,
386
- test: U,
387
- testing: M,
386
+ test: M,
387
+ testing: U,
388
388
  preproduction: L,
389
389
  production: D
390
390
  };
391
- function v(e) {
391
+ function h(e) {
392
392
  return e.replace(/\/$/, "");
393
393
  }
394
- const h = process.env.NODE_ENV || "local";
394
+ const f = process.env.NODE_ENV || "local";
395
395
  process.env.PROXY_FILES;
396
- v(process.env.API_BASE_URL || "https://api.perseed.eu");
396
+ h(process.env.API_BASE_URL || "https://api.perseed.eu");
397
397
  process.env.JWT_SECRET;
398
398
  process.env.REFRESH_JWT_SECRET;
399
399
  process.env.JWT_ISSUERS;
@@ -405,9 +405,9 @@ process.env.DEFAULT_TZ;
405
405
  process.env.SENTRY_DSN;
406
406
  parseInt(process.env.JOB_RETRIES ?? "5");
407
407
  process.env.BODY_SIZE_LIMIT;
408
- const f = C[h], r = f.externalApis;
409
- function Ee(e) {
410
- const a = {
408
+ const v = C[f], n = v.externalApis;
409
+ function ne(e) {
410
+ const s = {
411
411
  models: {
412
412
  user: {
413
413
  label: e("introspection-schema.models.user.label", "User"),
@@ -416,177 +416,215 @@ function Ee(e) {
416
416
  fields: [
417
417
  {
418
418
  name: "username",
419
- type: s.TEXT,
419
+ type: t.TEXT,
420
420
  label: e("introspection-schema.models.user.username", "Username")
421
421
  },
422
422
  {
423
423
  name: "created_user",
424
- type: s.TEXT,
424
+ type: t.TEXT,
425
425
  label: e("introspection-schema.models.user.created_user", "Created user")
426
426
  },
427
427
  {
428
428
  name: "created_mode",
429
- type: s.TEXT,
429
+ type: t.TEXT,
430
430
  label: e("introspection-schema.models.user.created_mode", "Created mode")
431
431
  },
432
432
  {
433
433
  name: "mod_user",
434
- type: s.NUMBER,
434
+ type: t.NUMBER,
435
435
  label: e("introspection-schema.models.user.mod_user", "User modified")
436
436
  },
437
437
  {
438
438
  name: "mod_time",
439
- type: s.DATE,
439
+ type: t.DATE,
440
440
  label: e("introspection-schema.models.user.time", "Update date")
441
441
  },
442
442
  {
443
443
  name: "email",
444
- type: s.TEXT,
444
+ type: t.TEXT,
445
445
  label: e("introspection-schema.models.user.email", "Email")
446
446
  },
447
447
  {
448
448
  name: "password",
449
- type: s.TEXT,
449
+ type: t.TEXT,
450
450
  label: e("introspection-schema.models.user.password", "Password")
451
451
  },
452
452
  {
453
453
  name: "displayName",
454
- type: s.TEXT,
454
+ type: t.TEXT,
455
455
  label: e("introspection-schema.models.user.display-name", "Display name")
456
456
  },
457
457
  {
458
458
  name: "blocked",
459
- type: s.BOOLEAN,
459
+ type: t.BOOLEAN,
460
460
  label: e("introspection-schema.models.user.blocked", "Blocked")
461
461
  },
462
462
  {
463
463
  name: "timestamp",
464
- type: s.DATE,
464
+ type: t.DATE,
465
465
  label: e("introspection-schema.models.user.timestamp", "Creation date")
466
466
  },
467
467
  {
468
468
  name: "state",
469
- type: s.BOOLEAN,
469
+ type: t.BOOLEAN,
470
470
  label: e("introspection-schema.models.user.state", "State")
471
471
  },
472
472
  {
473
473
  name: "newRegister",
474
- type: s.BOOLEAN,
474
+ type: t.BOOLEAN,
475
475
  label: e("introspection-schema.models.user.new-register", "New register")
476
476
  },
477
477
  {
478
478
  name: "password_changed_date",
479
- type: s.DATE,
479
+ type: t.DATE,
480
480
  label: e("introspection-schema.models.user.password-changed-date", "Password changed date")
481
481
  },
482
482
  {
483
483
  name: "token",
484
- type: s.TEXT,
484
+ type: t.TEXT,
485
485
  label: e("introspection-schema.models.user.token", "Token")
486
486
  },
487
487
  {
488
488
  name: "type",
489
- type: s.TEXT,
489
+ type: t.TEXT,
490
490
  label: e("introspection-schema.models.user.type", "Type")
491
491
  },
492
492
  {
493
493
  name: "expiry_date",
494
- type: s.DATE,
494
+ type: t.DATE,
495
495
  label: e("introspection-schema.models.user.expiry-date", "Expiry date")
496
496
  },
497
497
  {
498
498
  name: "allow_upload",
499
- type: s.BOOLEAN,
499
+ type: t.BOOLEAN,
500
500
  label: e("introspection-schema.models.user.allow-upload", "Allow upload")
501
501
  },
502
502
  {
503
503
  name: "allow_change_color",
504
- type: s.BOOLEAN,
504
+ type: t.BOOLEAN,
505
505
  label: e("introspection-schema.models.user.allow-change-color", "Allow change color")
506
506
  },
507
507
  {
508
508
  name: "clinic_request",
509
- type: s.BOOLEAN,
509
+ type: t.BOOLEAN,
510
510
  label: e("introspection-schema.models.user.clinic-request", "Clinic request")
511
511
  },
512
512
  {
513
513
  name: "favourite",
514
- type: s.BOOLEAN,
514
+ type: t.BOOLEAN,
515
515
  label: e("introspection-schema.models.user.favourite", "Favourite")
516
516
  },
517
517
  {
518
518
  name: "last_access",
519
- type: s.DATE,
519
+ type: t.DATE,
520
520
  label: e("introspection-schema.models.user.last-access", "Last access")
521
521
  },
522
522
  {
523
523
  name: "temporary_password",
524
- type: s.TEXT,
524
+ type: t.TEXT,
525
525
  label: e("introspection-schema.models.user.temporary-password", "Temporary password")
526
526
  },
527
527
  {
528
528
  name: "currentFailedCount",
529
- type: s.NUMBER,
529
+ type: t.NUMBER,
530
530
  label: e("introspection-schema.models.user.current-failed-count", "Current failed count")
531
531
  },
532
532
  {
533
533
  name: "tokenDate",
534
- type: s.DATE,
534
+ type: t.DATE,
535
535
  label: e("introspection-schema.models.user.token-date", "Token date")
536
536
  }
537
537
  ]
538
538
  }
539
539
  }
540
540
  };
541
- return r && Object.keys(r).length && (a.externalApis = Object.entries(r).map(([d, E]) => ({
542
- value: d,
541
+ return n && Object.keys(n).length && (s.externalApis = Object.entries(n).map(([i, E]) => ({
542
+ value: i,
543
543
  label: E.label,
544
544
  methods: E.method
545
- }))), a;
545
+ }))), s;
546
+ }
547
+ class Ee {
548
+ constructor(s) {
549
+ this.notified_about = s;
550
+ }
551
+ crfName() {
552
+ return this.notified_about.startsWith("crf_") ? this.notified_about.split("_")[1] : this.notified_about.startsWith("Patient") ? "patient" : null;
553
+ }
554
+ actionTrigger() {
555
+ return this.notified_about.toLowerCase().endsWith(a.UPDATE) ? a.UPDATE : this.notified_about.toLowerCase().endsWith(a.CREATION) ? a.CREATION : null;
556
+ }
557
+ isCrfTrigger() {
558
+ return this.notified_about === b || this.notified_about.startsWith("crf_");
559
+ }
560
+ isModelTrigger() {
561
+ return this.notified_about.startsWith("model_");
562
+ }
563
+ isDisplayerTrigger() {
564
+ return this.notified_about.startsWith("model_displayer_");
565
+ }
566
+ isFieldTrigger() {
567
+ return !isNaN(parseInt(this.notified_about));
568
+ }
569
+ getModelName() {
570
+ if (this.isModelTrigger() && !this.isDisplayerTrigger())
571
+ return this.notified_about.split("_")[1];
572
+ if (this.isDisplayerTrigger()) {
573
+ const s = this.notified_about.split("_"), i = s[s.length - 1];
574
+ return Object.values(a).includes(i) && s.pop(), s.slice(2).join("_");
575
+ }
576
+ }
577
+ getModelTriggerAction() {
578
+ const s = this.getModelName();
579
+ return s && this.isDisplayerTrigger() ? this.notified_about.replace(`model_displayer_${s}_`, "").replace(`model_displayer_${s}`, "") : s && this.isModelTrigger() ? this.notified_about.replace(`model_${s}_`, "").replace(`model_${s}`, "") : null;
580
+ }
546
581
  }
582
+ const b = "Patient Creation";
547
583
  export {
548
584
  V as AUDIT_FLAGS,
549
585
  N as ApiAction,
550
586
  m as CORE,
551
- u as ConditionsFormat,
587
+ R as ConditionsFormat,
552
588
  P as DATETIME_SHORT_FORMAT,
553
- l as DATE_FORMAT,
554
- Y as DATE_TYPE,
555
- re as DEFAULT_CONFIGURATION_PATIENT_LIST,
556
- oe as DYNAMIC_FILE_VALID_FORMATS,
589
+ p as DATE_FORMAT,
590
+ B as DATE_TYPE,
591
+ oe as DEFAULT_CONFIGURATION_PATIENT_LIST,
592
+ ie as DYNAMIC_FILE_VALID_FORMATS,
557
593
  I as DashboardWidgetType,
558
- A as DataLoaderType,
559
- x as EXCLUDE_FIELDS,
560
- n as FIELDS,
561
- t as FIELD_NAMES,
562
- g as FIELD_NAMES_MAP,
563
- W as FIELD_STATUS,
594
+ u as DataLoaderType,
595
+ W as EXCLUDE_FIELDS,
596
+ _ as FIELDS,
597
+ r as FIELD_NAMES,
598
+ H as FIELD_NAMES_MAP,
599
+ K as FIELD_STATUS,
564
600
  G as FIELD_SUFFIX,
565
601
  X as FORM_NAMES,
566
602
  k as FORM_SUFFIX,
567
- p as FORM_TYPES,
568
- te as HREF_TYPE,
569
- s as IntrospectionSchemaFieldType,
570
- J as META_NAMES,
571
- Z as META_RESTRICTION,
572
- $ as META_STATUS,
603
+ T as FORM_TYPES,
604
+ re as HREF_TYPE,
605
+ t as IntrospectionSchemaFieldType,
606
+ Z as META_NAMES,
607
+ $ as META_RESTRICTION,
608
+ ee as META_STATUS,
573
609
  q as MULTIPLE_SELECTION_SEPARATOR,
574
610
  w as MYSQL_DATETIME_FORMAT,
575
611
  F as MYSQL_DATE_FORMAT,
576
- j as NO_FILL_STATUS,
577
- H as NUMBER_TYPE,
578
- B as OBJECT_TYPE,
579
- ee as SELECTOR_TYPE,
612
+ z as NO_FILL_STATUS,
613
+ Y as NUMBER_TYPE,
614
+ Ee as NotifiedAboutInfo,
615
+ x as OBJECT_TYPE,
616
+ b as PATIENT_CREATION_ABOUT,
617
+ te as SELECTOR_TYPE,
580
618
  y as SHORT_TIME_FORMAT,
581
619
  ae as SLIDER_SCALE_ORIENTATION_TYPE,
582
- i as SLIDER_SCALE_TYPE,
620
+ l as SLIDER_SCALE_TYPE,
583
621
  se as SLIDER_SELECTOR_TYPE,
584
622
  o as SLIDER_TYPE,
585
- T as STATUS_FIELD_REGEXP,
623
+ A as STATUS_FIELD_REGEXP,
586
624
  Q as STATUS_SUFFIX,
587
- b as TIME_FORMAT,
588
- z as TIME_SCHEMA,
589
- R as TriggerAction,
590
- Ee as getIntrospectionSchema,
591
- K as isNotStatusField
625
+ g as TIME_FORMAT,
626
+ J as TIME_SCHEMA,
627
+ a as TriggerAction,
628
+ ne as getIntrospectionSchema,
629
+ j as isNotStatusField
592
630
  };
@@ -1 +1 @@
1
- (function(a,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(a=typeof globalThis<"u"?globalThis:a||self,E(a["perseed-api"]={}))})(this,function(a){"use strict";const E="YYYY-MM-DD",R="HH:mm:ss",L="HH:mm",O="YYYY-MM-DD HH:mm",D=E,M="YYYY-MM-DD HH:mm:ss",o={DECIMAL:1,INTEGER:2,MULTIPLE_SELECTION:3,SELECTION:4,DYNAMIC_SELECTION:5,DATE:6,HEADER:7,SUBHEADER:8,WARNING:9,SUBFORM:10,MEMO:11,TEXT:12,TEXT_AREA:13,YES_NO:14,TIME:15,LINK_HREF:16,COUNTRY:17,HOSPITAL:18,USERS:19,DYNAMIC_FILE:20,DYNAMIC_LINK_HREF:21,SCAN_CODE:22,PARAGRAPH:23,FILE:24},t={DECIMAL_NAME:"decimal",INTEGER_NAME:"integer",MULTIPLE_SELECTION_NAME:"multiple_selection",SELECTION_NAME:"selection",DYNAMIC_SELECTION_NAME:"dynamic_selection",DATE_NAME:"date",HEADER_NAME:"header",SUBHEADER_NAME:"subheader",WARNING_NAME:"warning",SUBFORM_NAME:"subform",MEMO_NAME:"memo",TEXT_NAME:"text",TEXT_AREA_NAME:"text_area",YES_NO_NAME:"yes_no",TIME_NAME:"time",LINK_HREF_NAME:"link_href",COUNTRY_NAME:"country",HOSPITAL_NAME:"hospital",USERS_NAME:"users",DYNAMIC_FILE_NAME:"dynamic_file",DYNAMIC_LINK_HREF_NAME:"dynamic_link_href",SCAN_CODE_NAME:"scan_code",PARAGRAPH_NAME:"paragraph",FILE_NAME:"file"};var c=(e=>(e[e.STATIC=0]="STATIC",e[e.STANDARD=1]="STANDARD",e[e.FOLLOW_UP=2]="FOLLOW_UP",e[e.ADVERSE_EVENT=3]="ADVERSE_EVENT",e[e.QUESTIONNAIRE=5]="QUESTIONNAIRE",e[e.STUDY=6]="STUDY",e))(c||{});const U=()=>{let e={};return Object.keys(o).forEach(n=>{e={...e,[o[n]]:t[`${n}_NAME`]}}),e},C=["number",t.DECIMAL_NAME,t.INTEGER_NAME],F=["date"],f=["object",t.SCAN_CODE_NAME],T={CREATION_TIME:"creation_time",CREATION_USER:"creation_user",CRF_NAME:"crf_name",CRF_STATUS:"crf_status",HOSPITAL:"hospital",HOSPITAL_STATUS:"hospital_status",ID:"id",LOCK_STATE:"lock_state",LOCK_USER:"lock_user",LOCK_DATE:"lock_date",MODIFICATION_TIME:"mod_time",MODIFICATION_USER:"mod_user",PATIENT_ID:"patient_id",PATIENT_NUMBER:"patient_number",PATIENT_NUMBER_STATUS:"patient_number_status",RECORD_ID:"record_id",SIGNATURE_DATE:"signature_date",SIGNATURE_STATE:"signature_state",SIGNATURE_USER:"signature_user",STATUS:"status",USER_IP:"user_ip",DATE_OF_QUESTIONNAIRE:"date_of_questionnaire",TIME_OF_QUESTIONNAIRE:"time_of_questionnaire",VERSION:"version",REFERENCE:"reference",SUBFORM_ID:"subform_id"},h=Object.values(T),v={added:"A",edited:"E",deleted:"D"},P={PATIENT:"patient",SEPARATOR:"_"},b={AUDIT:"audit"},y="~",g="_status",Y="_status",w={filled:"filled",unk:"UNK",na:"NA",nd:"ND"},d=/^[0-9a-f]{33}_status$/,H=function(e){return!d.test(e)},B=["UNK","NA","ND"],X="^[0-1][0-9]:[0-5][0-9]$|^[0-2][0-3]:[0-5][0-9]$",G={DEPENDENT_SOURCE:"dependent_source",ENCRYPTED:"encrypted",ENCRYPTED_LEVEL:"encrypted_level",EXTERNAL_SHARING:"external_sharing",SHOW_EMBEDDED_PDF:"show_embedded_pdf",HIDDEN:"hidden",IS_CRF_MAIN_FIELD:"is_crf_main_field",MIN_VALUE:"min-value",MIN_VALUE_VALIDATION:"validation_of_less_than",MAX_VALUE:"max-value",MAX_VALUE_VALIDATION:"validation_of_higher_than",NEXT_FORM:"next_form",MULTIPLE:"is_multiple",ORDER:"order",READ_ONLY:"readonly",REQUIRED:"is_required",REQUIRED_TYPE:"type_of_required",SELECTION_VALUE:"value_of_selection",SELECTION_VALUE_SLIDER:"value_of_selection_slider",SOURCE_FIELD:"source_field",TYPE:"type",TYPE_QUESTIONARY:"questionary",QUESTION_DAYS:"question_days",QUESTION_TIME:"question_time",QUESTION_HOURS:"question_hours",QUESTION_MINUTES:"question_minutes",REMINDER_DAYS:"reminder_days",REMINDER_HOURS:"reminder_hours",REMINDER_MINUTES:"reminder_minutes",REMINDER_SUBJECT:"reminder_subject",REMINDER_MESSAGE:"reminder_message",MAX_NUMBER_REMINDER:"max_number_reminder",NUMBER_QUESTION_PAGE:"number_question_page",UNTIL:"until",NUMBER_OF_QUESTIONAIRES:"number_of_questionaires",QUESTION_COMMENTS:"question_comments",TYPE_OF_QUESTIONNAIRE:"type_of_questionnaire",HISTORY_OF_QUESTIONNAIRE:"history_of_questionnaire",HISTORY:"history",CRF_HISTORY:"crf_history",PROCEDURE_CONDITION:"procedure_condition",HREF_VALUE:"href_value",HREF_TYPE:"href_type",SIZE:"size",FILE_TYPE:"file_type",INPUT_TYPE:"input_type",PARAGRAPH_CONTENT:"paragraph_content",FILE_VALUE:"file_value",WINDOW_REFERENCE:"window_reference",START_DATE_DAYS:"start_date_days",HAS_DEFAULT_VALUE:"has_default_value",SPECIFIC_VALUE:"specific_value",DEFAULT_VALUE:"default_value",UNIQUE:"unique",HELP:"help",SELECTOR_TYPE:"selector_type",SLIDER_SELECTOR:"slider_selector",SLIDER_SCALE_ORIENTATION:"slider_scale_orientation",UNTIL_DATE:"until",PAGE_BREAK:"page_break",WINDOW_BEFORE:"window_before",WINDOW_AFTER:"window_after",WINDOW_PERIOD:"window_period"},V={STRICT:"strict",FLEXIBLE:"flexible"},k={ACTIVE:"1"},q={SLIDER:"slider",DROPDOWN:"dropdown",RADIO_BUTTON:"radio_button",CHECK_BOX:"check_box"},i={STARS:"0",SCALE_RATING:"1",IMAGES:"2"},Q={[i.STARS]:"stars",[i.SCALE_RATING]:"scale",[i.IMAGES]:"images"},_={HORIZONTAL:"0",VERTICAL:"1"},W={[_.HORIZONTAL]:"horizontal",[_.VERTICAL]:"vertical"},K={NEW_WINDOW:"newwindow",EMBEDDED_HTML:"embeddedhtml"},j={1:["image/jpg","image/jpeg","image/bmp","image/gif","image/png"],2:["application/pdf","application/x-pdf","text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.text","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],3:["application/pdf","application/x-pdf"],4:["application/dicom","application/gzip","application/x-gzip","application/tar","application/tar+gzip","application/zip","application/x-rar-compressed","application/x-zip-compressed","application/x-7z-compressed","application/octet-stream"],5:["video/x-msvideo","video/x-mkv","video/x-matroska","video/mpeg","video/mpeg4","video/mpg","video/ogg","video/webm","video/3gpp","video/3gpp2","video/mp4","video/divx","video/avi","video/quicktime","video/x-ms-wmv","video/x-flv"]},z=[{id:"1",name:"patient_number",type:"Zend\\Form\\Element\\Text",label:"Patient Id",required:"1",crf_name:"patient",status:"1"},{type:"4",name:"hospital",label:"Hospital",required:"0",id:"2",crf_name:"patient",status:"1"},{id:"1000000001",name:"procedure",type:"customzation",label:"Procedures",required:"1",crf_name:"",status:"1"}];var l=(e=>(e.OUTCOMES="outcomes",e))(l||{}),A=(e=>(e.VALUECARD="ValueCard",e.SECTIONCARD="SectionCard",e.PATIENTLIST="PatientList",e))(A||{}),p=(e=>(e.QUESTIONNAIRE_CREATE="questionnaire.create",e.CRF_CREATE="crf.create",e.CRF_UPDATE="crf.update",e.CRF_DELETE="crf.delete",e.EXTERNAL_API_CALL="external_api_call",e))(p||{}),I=(e=>(e.JSON_LOGIC="jsonLogic",e.CUSTOM="custom",e))(I||{}),m=(e=>(e.CREATION="creation",e.UPDATE="update",e))(m||{}),s=(e=>(e.TEXT="text",e.DATE="date",e.TIME="time",e.BOOLEAN="boolean",e.NUMBER="number",e.SELECT="select",e.MULTISELECT="multiselect",e.HIDDEN="hidden",e))(s||{});const J={},Z={},$={},x={},ee={hostName:"mysql",ecosystem:{demo:{userLogin:{username:"admin",password:"Sebas3210",deviceId:"abc123",api:!0}},reseaarch:{userLogin:{username:"testapi2",password:"123456",deviceId:"abc123",api:!0}},caaring:{userLogin:{username:"root",password:"pass4mike",deviceId:"abc123",api:!0}},ecoapi:{userLogin:{username:"root",password:"123456",deviceId:"abc123",api:!0}},clinicaal:{},clitinerary:{}},global:{dbCredentials:{username:"root",password:"root",database:"perseed"}},rabbitOptions:{protocol:"amqp",hostname:"localhost",port:5672,username:"perseedweb00-dev",password:"Z8rLHAkw",locale:"en_US",frameMax:0,heartbeat:0,vhost:"/"},AWS:{accessKeyId:"AKIA4Z2DUBRURKXKII5S",secretAccessKey:"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",apiVersion:"latest",tmpPath:"tmp/",bucket:{name:"testing.perseed-files-eu",region:"eu-central-1"},cloudFront:{keypairId:"K1BWQQVLE4YU4F",privateKeyPath:"/var/www/perseed_api/config/private_key.pem",assetsUrl:"https://test.assets.perseed.eu"}},SMS:{apiKey:"4|XildLvmjqzABeekAgj9EaLiwpxdGMWgassPaxewu",defaultSender:"Caaring"},perseedAPI:{caaring:{username:"ecoadmin",password:"1CarefulWithPersonalInfo2@",deviceId:"ecoadmin@api"},clinicaal:{username:"perseedapiCLI",password:"Ukz4s7LL&Ne3KA#",deviceId:"ecoadmin@api"},onqos:{username:"perseedapiCLI",password:"Ukz4s7LL&Ne3KA#",deviceId:"ecoadmin@api"},demo:{username:"admin",password:"Sebas3210",deviceId:"admin@api"},reseaarch:{username:"ecoadmin",password:"1CarefulWithPersonalInfo2@",deviceId:"ecoadmin@api"},testrcr:{username:"ecoadmin",password:"1CarefulWithPersonalInfo2",deviceId:"ecoadmin@api"}}},ae={},N={};let S;N.existsSync("./credentials/local.json")&&(S=JSON.parse(N.readFileSync("./credentials/local.json").toString()));const se={local:S||J,local_tmp:Z,test:ee,testing:ae,preproduction:$,production:x};function Ee(e){return e.replace(/\/$/,"")}const te=process.env.NODE_ENV||"local";process.env.PROXY_FILES,Ee(process.env.API_BASE_URL||"https://api.perseed.eu"),process.env.JWT_SECRET,process.env.REFRESH_JWT_SECRET,process.env.JWT_ISSUERS,process.env.FULL_LOG,(process.env.CSP_FRAME_ANCESTORS||"https://tmp.perseed.eu,https://tmp.api.perseed.eu,https://perseed.eu,https://api.perseed.eu,https://perseed.test,https://app.caaring.com,https://app.clinicaal.com,https://app.onqos.com,https://app.reseaarch.com,https://app.clitinerary.com").split(","),process.env.ZERO_DATES_SUPPORT,process.env.DEBUG_ERRORS?process.env.DEBUG_ERRORS:process.env.NODE_ENV,process.env.DEFAULT_TZ,process.env.SENTRY_DSN,parseInt(process.env.JOB_RETRIES??"5"),process.env.BODY_SIZE_LIMIT;const r=se[te].externalApis;function ne(e){const n={models:{user:{label:e("introspection-schema.models.user.label","User"),relations:[],canJoinPatient:!0,fields:[{name:"username",type:s.TEXT,label:e("introspection-schema.models.user.username","Username")},{name:"created_user",type:s.TEXT,label:e("introspection-schema.models.user.created_user","Created user")},{name:"created_mode",type:s.TEXT,label:e("introspection-schema.models.user.created_mode","Created mode")},{name:"mod_user",type:s.NUMBER,label:e("introspection-schema.models.user.mod_user","User modified")},{name:"mod_time",type:s.DATE,label:e("introspection-schema.models.user.time","Update date")},{name:"email",type:s.TEXT,label:e("introspection-schema.models.user.email","Email")},{name:"password",type:s.TEXT,label:e("introspection-schema.models.user.password","Password")},{name:"displayName",type:s.TEXT,label:e("introspection-schema.models.user.display-name","Display name")},{name:"blocked",type:s.BOOLEAN,label:e("introspection-schema.models.user.blocked","Blocked")},{name:"timestamp",type:s.DATE,label:e("introspection-schema.models.user.timestamp","Creation date")},{name:"state",type:s.BOOLEAN,label:e("introspection-schema.models.user.state","State")},{name:"newRegister",type:s.BOOLEAN,label:e("introspection-schema.models.user.new-register","New register")},{name:"password_changed_date",type:s.DATE,label:e("introspection-schema.models.user.password-changed-date","Password changed date")},{name:"token",type:s.TEXT,label:e("introspection-schema.models.user.token","Token")},{name:"type",type:s.TEXT,label:e("introspection-schema.models.user.type","Type")},{name:"expiry_date",type:s.DATE,label:e("introspection-schema.models.user.expiry-date","Expiry date")},{name:"allow_upload",type:s.BOOLEAN,label:e("introspection-schema.models.user.allow-upload","Allow upload")},{name:"allow_change_color",type:s.BOOLEAN,label:e("introspection-schema.models.user.allow-change-color","Allow change color")},{name:"clinic_request",type:s.BOOLEAN,label:e("introspection-schema.models.user.clinic-request","Clinic request")},{name:"favourite",type:s.BOOLEAN,label:e("introspection-schema.models.user.favourite","Favourite")},{name:"last_access",type:s.DATE,label:e("introspection-schema.models.user.last-access","Last access")},{name:"temporary_password",type:s.TEXT,label:e("introspection-schema.models.user.temporary-password","Temporary password")},{name:"currentFailedCount",type:s.NUMBER,label:e("introspection-schema.models.user.current-failed-count","Current failed count")},{name:"tokenDate",type:s.DATE,label:e("introspection-schema.models.user.token-date","Token date")}]}}};return r&&Object.keys(r).length&&(n.externalApis=Object.entries(r).map(([ie,u])=>({value:ie,label:u.label,methods:u.method}))),n}a.AUDIT_FLAGS=v,a.ApiAction=p,a.CORE=T,a.ConditionsFormat=I,a.DATETIME_SHORT_FORMAT=O,a.DATE_FORMAT=E,a.DATE_TYPE=F,a.DEFAULT_CONFIGURATION_PATIENT_LIST=z,a.DYNAMIC_FILE_VALID_FORMATS=j,a.DashboardWidgetType=A,a.DataLoaderType=l,a.EXCLUDE_FIELDS=h,a.FIELDS=o,a.FIELD_NAMES=t,a.FIELD_NAMES_MAP=U,a.FIELD_STATUS=w,a.FIELD_SUFFIX=g,a.FORM_NAMES=P,a.FORM_SUFFIX=b,a.FORM_TYPES=c,a.HREF_TYPE=K,a.IntrospectionSchemaFieldType=s,a.META_NAMES=G,a.META_RESTRICTION=V,a.META_STATUS=k,a.MULTIPLE_SELECTION_SEPARATOR=y,a.MYSQL_DATETIME_FORMAT=M,a.MYSQL_DATE_FORMAT=D,a.NO_FILL_STATUS=B,a.NUMBER_TYPE=C,a.OBJECT_TYPE=f,a.SELECTOR_TYPE=q,a.SHORT_TIME_FORMAT=L,a.SLIDER_SCALE_ORIENTATION_TYPE=W,a.SLIDER_SCALE_TYPE=_,a.SLIDER_SELECTOR_TYPE=Q,a.SLIDER_TYPE=i,a.STATUS_FIELD_REGEXP=d,a.STATUS_SUFFIX=Y,a.TIME_FORMAT=R,a.TIME_SCHEMA=X,a.TriggerAction=m,a.getIntrospectionSchema=ne,a.isNotStatusField=H,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
1
+ (function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t["perseed-api"]={}))})(this,function(t){"use strict";const n="YYYY-MM-DD",L="HH:mm:ss",D="HH:mm",M="YYYY-MM-DD HH:mm",U=n,C="YYYY-MM-DD HH:mm:ss",r={DECIMAL:1,INTEGER:2,MULTIPLE_SELECTION:3,SELECTION:4,DYNAMIC_SELECTION:5,DATE:6,HEADER:7,SUBHEADER:8,WARNING:9,SUBFORM:10,MEMO:11,TEXT:12,TEXT_AREA:13,YES_NO:14,TIME:15,LINK_HREF:16,COUNTRY:17,HOSPITAL:18,USERS:19,DYNAMIC_FILE:20,DYNAMIC_LINK_HREF:21,SCAN_CODE:22,PARAGRAPH:23,FILE:24},E={DECIMAL_NAME:"decimal",INTEGER_NAME:"integer",MULTIPLE_SELECTION_NAME:"multiple_selection",SELECTION_NAME:"selection",DYNAMIC_SELECTION_NAME:"dynamic_selection",DATE_NAME:"date",HEADER_NAME:"header",SUBHEADER_NAME:"subheader",WARNING_NAME:"warning",SUBFORM_NAME:"subform",MEMO_NAME:"memo",TEXT_NAME:"text",TEXT_AREA_NAME:"text_area",YES_NO_NAME:"yes_no",TIME_NAME:"time",LINK_HREF_NAME:"link_href",COUNTRY_NAME:"country",HOSPITAL_NAME:"hospital",USERS_NAME:"users",DYNAMIC_FILE_NAME:"dynamic_file",DYNAMIC_LINK_HREF_NAME:"dynamic_link_href",SCAN_CODE_NAME:"scan_code",PARAGRAPH_NAME:"paragraph",FILE_NAME:"file"};var c=(e=>(e[e.STATIC=0]="STATIC",e[e.STANDARD=1]="STANDARD",e[e.FOLLOW_UP=2]="FOLLOW_UP",e[e.ADVERSE_EVENT=3]="ADVERSE_EVENT",e[e.QUESTIONNAIRE=5]="QUESTIONNAIRE",e[e.STUDY=6]="STUDY",e))(c||{});const f=()=>{let e={};return Object.keys(r).forEach(s=>{e={...e,[r[s]]:E[`${s}_NAME`]}}),e},h=["number",E.DECIMAL_NAME,E.INTEGER_NAME],F=["date"],b=["object",E.SCAN_CODE_NAME],T={CREATION_TIME:"creation_time",CREATION_USER:"creation_user",CRF_NAME:"crf_name",CRF_STATUS:"crf_status",HOSPITAL:"hospital",HOSPITAL_STATUS:"hospital_status",ID:"id",LOCK_STATE:"lock_state",LOCK_USER:"lock_user",LOCK_DATE:"lock_date",MODIFICATION_TIME:"mod_time",MODIFICATION_USER:"mod_user",PATIENT_ID:"patient_id",PATIENT_NUMBER:"patient_number",PATIENT_NUMBER_STATUS:"patient_number_status",RECORD_ID:"record_id",SIGNATURE_DATE:"signature_date",SIGNATURE_STATE:"signature_state",SIGNATURE_USER:"signature_user",STATUS:"status",USER_IP:"user_ip",DATE_OF_QUESTIONNAIRE:"date_of_questionnaire",TIME_OF_QUESTIONNAIRE:"time_of_questionnaire",VERSION:"version",REFERENCE:"reference",SUBFORM_ID:"subform_id"},v=Object.values(T),P={added:"A",edited:"E",deleted:"D"},g={PATIENT:"patient",SEPARATOR:"_"},y={AUDIT:"audit"},w="~",Y="_status",H="_status",B={filled:"filled",unk:"UNK",na:"NA",nd:"ND"},A=/^[0-9a-f]{33}_status$/,X=function(e){return!A.test(e)},W=["UNK","NA","ND"],G="^[0-1][0-9]:[0-5][0-9]$|^[0-2][0-3]:[0-5][0-9]$",V={DEPENDENT_SOURCE:"dependent_source",ENCRYPTED:"encrypted",ENCRYPTED_LEVEL:"encrypted_level",EXTERNAL_SHARING:"external_sharing",SHOW_EMBEDDED_PDF:"show_embedded_pdf",HIDDEN:"hidden",IS_CRF_MAIN_FIELD:"is_crf_main_field",MIN_VALUE:"min-value",MIN_VALUE_VALIDATION:"validation_of_less_than",MAX_VALUE:"max-value",MAX_VALUE_VALIDATION:"validation_of_higher_than",NEXT_FORM:"next_form",MULTIPLE:"is_multiple",ORDER:"order",READ_ONLY:"readonly",REQUIRED:"is_required",REQUIRED_TYPE:"type_of_required",SELECTION_VALUE:"value_of_selection",SELECTION_VALUE_SLIDER:"value_of_selection_slider",SOURCE_FIELD:"source_field",TYPE:"type",TYPE_QUESTIONARY:"questionary",QUESTION_DAYS:"question_days",QUESTION_TIME:"question_time",QUESTION_HOURS:"question_hours",QUESTION_MINUTES:"question_minutes",REMINDER_DAYS:"reminder_days",REMINDER_HOURS:"reminder_hours",REMINDER_MINUTES:"reminder_minutes",REMINDER_SUBJECT:"reminder_subject",REMINDER_MESSAGE:"reminder_message",MAX_NUMBER_REMINDER:"max_number_reminder",NUMBER_QUESTION_PAGE:"number_question_page",UNTIL:"until",NUMBER_OF_QUESTIONAIRES:"number_of_questionaires",QUESTION_COMMENTS:"question_comments",TYPE_OF_QUESTIONNAIRE:"type_of_questionnaire",HISTORY_OF_QUESTIONNAIRE:"history_of_questionnaire",HISTORY:"history",CRF_HISTORY:"crf_history",PROCEDURE_CONDITION:"procedure_condition",HREF_VALUE:"href_value",HREF_TYPE:"href_type",SIZE:"size",FILE_TYPE:"file_type",INPUT_TYPE:"input_type",PARAGRAPH_CONTENT:"paragraph_content",FILE_VALUE:"file_value",WINDOW_REFERENCE:"window_reference",START_DATE_DAYS:"start_date_days",HAS_DEFAULT_VALUE:"has_default_value",SPECIFIC_VALUE:"specific_value",DEFAULT_VALUE:"default_value",UNIQUE:"unique",HELP:"help",SELECTOR_TYPE:"selector_type",SLIDER_SELECTOR:"slider_selector",SLIDER_SCALE_ORIENTATION:"slider_scale_orientation",UNTIL_DATE:"until",PAGE_BREAK:"page_break",WINDOW_BEFORE:"window_before",WINDOW_AFTER:"window_after",WINDOW_PERIOD:"window_period"},k={STRICT:"strict",FLEXIBLE:"flexible"},q={ACTIVE:"1"},Q={SLIDER:"slider",DROPDOWN:"dropdown",RADIO_BUTTON:"radio_button",CHECK_BOX:"check_box"},o={STARS:"0",SCALE_RATING:"1",IMAGES:"2"},K={[o.STARS]:"stars",[o.SCALE_RATING]:"scale",[o.IMAGES]:"images"},_={HORIZONTAL:"0",VERTICAL:"1"},j={[_.HORIZONTAL]:"horizontal",[_.VERTICAL]:"vertical"},z={NEW_WINDOW:"newwindow",EMBEDDED_HTML:"embeddedhtml"},J={1:["image/jpg","image/jpeg","image/bmp","image/gif","image/png"],2:["application/pdf","application/x-pdf","text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.text","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],3:["application/pdf","application/x-pdf"],4:["application/dicom","application/gzip","application/x-gzip","application/tar","application/tar+gzip","application/zip","application/x-rar-compressed","application/x-zip-compressed","application/x-7z-compressed","application/octet-stream"],5:["video/x-msvideo","video/x-mkv","video/x-matroska","video/mpeg","video/mpeg4","video/mpg","video/ogg","video/webm","video/3gpp","video/3gpp2","video/mp4","video/divx","video/avi","video/quicktime","video/x-ms-wmv","video/x-flv"]},Z=[{id:"1",name:"patient_number",type:"Zend\\Form\\Element\\Text",label:"Patient Id",required:"1",crf_name:"patient",status:"1"},{type:"4",name:"hospital",label:"Hospital",required:"0",id:"2",crf_name:"patient",status:"1"},{id:"1000000001",name:"procedure",type:"customzation",label:"Procedures",required:"1",crf_name:"",status:"1"}];var p=(e=>(e.OUTCOMES="outcomes",e))(p||{}),m=(e=>(e.VALUECARD="ValueCard",e.SECTIONCARD="SectionCard",e.PATIENTLIST="PatientList",e))(m||{}),I=(e=>(e.QUESTIONNAIRE_CREATE="questionnaire.create",e.CRF_CREATE="crf.create",e.CRF_UPDATE="crf.update",e.CRF_DELETE="crf.delete",e.EXTERNAL_API_CALL="external_api_call",e))(I||{}),u=(e=>(e.JSON_LOGIC="jsonLogic",e.CUSTOM="custom",e))(u||{}),i=(e=>(e.CREATION="creation",e.UPDATE="update",e))(i||{}),a=(e=>(e.TEXT="text",e.DATE="date",e.TIME="time",e.BOOLEAN="boolean",e.NUMBER="number",e.SELECT="select",e.MULTISELECT="multiselect",e.HIDDEN="hidden",e))(a||{});const $={},x={},ee={},te={},ae={hostName:"mysql",ecosystem:{demo:{userLogin:{username:"admin",password:"Sebas3210",deviceId:"abc123",api:!0}},reseaarch:{userLogin:{username:"testapi2",password:"123456",deviceId:"abc123",api:!0}},caaring:{userLogin:{username:"root",password:"pass4mike",deviceId:"abc123",api:!0}},ecoapi:{userLogin:{username:"root",password:"123456",deviceId:"abc123",api:!0}},clinicaal:{},clitinerary:{}},global:{dbCredentials:{username:"root",password:"root",database:"perseed"}},rabbitOptions:{protocol:"amqp",hostname:"localhost",port:5672,username:"perseedweb00-dev",password:"Z8rLHAkw",locale:"en_US",frameMax:0,heartbeat:0,vhost:"/"},AWS:{accessKeyId:"AKIA4Z2DUBRURKXKII5S",secretAccessKey:"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",apiVersion:"latest",tmpPath:"tmp/",bucket:{name:"testing.perseed-files-eu",region:"eu-central-1"},cloudFront:{keypairId:"K1BWQQVLE4YU4F",privateKeyPath:"/var/www/perseed_api/config/private_key.pem",assetsUrl:"https://test.assets.perseed.eu"}},SMS:{apiKey:"4|XildLvmjqzABeekAgj9EaLiwpxdGMWgassPaxewu",defaultSender:"Caaring"},perseedAPI:{caaring:{username:"ecoadmin",password:"1CarefulWithPersonalInfo2@",deviceId:"ecoadmin@api"},clinicaal:{username:"perseedapiCLI",password:"Ukz4s7LL&Ne3KA#",deviceId:"ecoadmin@api"},onqos:{username:"perseedapiCLI",password:"Ukz4s7LL&Ne3KA#",deviceId:"ecoadmin@api"},demo:{username:"admin",password:"Sebas3210",deviceId:"admin@api"},reseaarch:{username:"ecoadmin",password:"1CarefulWithPersonalInfo2@",deviceId:"ecoadmin@api"},testrcr:{username:"ecoadmin",password:"1CarefulWithPersonalInfo2",deviceId:"ecoadmin@api"}}},se={},N={};let S;N.existsSync("./credentials/local.json")&&(S=JSON.parse(N.readFileSync("./credentials/local.json").toString()));const ie={local:S||$,local_tmp:x,test:ae,testing:se,preproduction:ee,production:te};function ne(e){return e.replace(/\/$/,"")}const Ee=process.env.NODE_ENV||"local";process.env.PROXY_FILES,ne(process.env.API_BASE_URL||"https://api.perseed.eu"),process.env.JWT_SECRET,process.env.REFRESH_JWT_SECRET,process.env.JWT_ISSUERS,process.env.FULL_LOG,(process.env.CSP_FRAME_ANCESTORS||"https://tmp.perseed.eu,https://tmp.api.perseed.eu,https://perseed.eu,https://api.perseed.eu,https://perseed.test,https://app.caaring.com,https://app.clinicaal.com,https://app.onqos.com,https://app.reseaarch.com,https://app.clitinerary.com").split(","),process.env.ZERO_DATES_SUPPORT,process.env.DEBUG_ERRORS?process.env.DEBUG_ERRORS:process.env.NODE_ENV,process.env.DEFAULT_TZ,process.env.SENTRY_DSN,parseInt(process.env.JOB_RETRIES??"5"),process.env.BODY_SIZE_LIMIT;const d=ie[Ee].externalApis;function oe(e){const s={models:{user:{label:e("introspection-schema.models.user.label","User"),relations:[],canJoinPatient:!0,fields:[{name:"username",type:a.TEXT,label:e("introspection-schema.models.user.username","Username")},{name:"created_user",type:a.TEXT,label:e("introspection-schema.models.user.created_user","Created user")},{name:"created_mode",type:a.TEXT,label:e("introspection-schema.models.user.created_mode","Created mode")},{name:"mod_user",type:a.NUMBER,label:e("introspection-schema.models.user.mod_user","User modified")},{name:"mod_time",type:a.DATE,label:e("introspection-schema.models.user.time","Update date")},{name:"email",type:a.TEXT,label:e("introspection-schema.models.user.email","Email")},{name:"password",type:a.TEXT,label:e("introspection-schema.models.user.password","Password")},{name:"displayName",type:a.TEXT,label:e("introspection-schema.models.user.display-name","Display name")},{name:"blocked",type:a.BOOLEAN,label:e("introspection-schema.models.user.blocked","Blocked")},{name:"timestamp",type:a.DATE,label:e("introspection-schema.models.user.timestamp","Creation date")},{name:"state",type:a.BOOLEAN,label:e("introspection-schema.models.user.state","State")},{name:"newRegister",type:a.BOOLEAN,label:e("introspection-schema.models.user.new-register","New register")},{name:"password_changed_date",type:a.DATE,label:e("introspection-schema.models.user.password-changed-date","Password changed date")},{name:"token",type:a.TEXT,label:e("introspection-schema.models.user.token","Token")},{name:"type",type:a.TEXT,label:e("introspection-schema.models.user.type","Type")},{name:"expiry_date",type:a.DATE,label:e("introspection-schema.models.user.expiry-date","Expiry date")},{name:"allow_upload",type:a.BOOLEAN,label:e("introspection-schema.models.user.allow-upload","Allow upload")},{name:"allow_change_color",type:a.BOOLEAN,label:e("introspection-schema.models.user.allow-change-color","Allow change color")},{name:"clinic_request",type:a.BOOLEAN,label:e("introspection-schema.models.user.clinic-request","Clinic request")},{name:"favourite",type:a.BOOLEAN,label:e("introspection-schema.models.user.favourite","Favourite")},{name:"last_access",type:a.DATE,label:e("introspection-schema.models.user.last-access","Last access")},{name:"temporary_password",type:a.TEXT,label:e("introspection-schema.models.user.temporary-password","Temporary password")},{name:"currentFailedCount",type:a.NUMBER,label:e("introspection-schema.models.user.current-failed-count","Current failed count")},{name:"tokenDate",type:a.DATE,label:e("introspection-schema.models.user.token-date","Token date")}]}}};return d&&Object.keys(d).length&&(s.externalApis=Object.entries(d).map(([l,O])=>({value:l,label:O.label,methods:O.method}))),s}class re{constructor(s){this.notified_about=s}crfName(){return this.notified_about.startsWith("crf_")?this.notified_about.split("_")[1]:this.notified_about.startsWith("Patient")?"patient":null}actionTrigger(){return this.notified_about.toLowerCase().endsWith(i.UPDATE)?i.UPDATE:this.notified_about.toLowerCase().endsWith(i.CREATION)?i.CREATION:null}isCrfTrigger(){return this.notified_about===R||this.notified_about.startsWith("crf_")}isModelTrigger(){return this.notified_about.startsWith("model_")}isDisplayerTrigger(){return this.notified_about.startsWith("model_displayer_")}isFieldTrigger(){return!isNaN(parseInt(this.notified_about))}getModelName(){if(this.isModelTrigger()&&!this.isDisplayerTrigger())return this.notified_about.split("_")[1];if(this.isDisplayerTrigger()){const s=this.notified_about.split("_"),l=s[s.length-1];return Object.values(i).includes(l)&&s.pop(),s.slice(2).join("_")}}getModelTriggerAction(){const s=this.getModelName();return s&&this.isDisplayerTrigger()?this.notified_about.replace(`model_displayer_${s}_`,"").replace(`model_displayer_${s}`,""):s&&this.isModelTrigger()?this.notified_about.replace(`model_${s}_`,"").replace(`model_${s}`,""):null}}const R="Patient Creation";t.AUDIT_FLAGS=P,t.ApiAction=I,t.CORE=T,t.ConditionsFormat=u,t.DATETIME_SHORT_FORMAT=M,t.DATE_FORMAT=n,t.DATE_TYPE=F,t.DEFAULT_CONFIGURATION_PATIENT_LIST=Z,t.DYNAMIC_FILE_VALID_FORMATS=J,t.DashboardWidgetType=m,t.DataLoaderType=p,t.EXCLUDE_FIELDS=v,t.FIELDS=r,t.FIELD_NAMES=E,t.FIELD_NAMES_MAP=f,t.FIELD_STATUS=B,t.FIELD_SUFFIX=Y,t.FORM_NAMES=g,t.FORM_SUFFIX=y,t.FORM_TYPES=c,t.HREF_TYPE=z,t.IntrospectionSchemaFieldType=a,t.META_NAMES=V,t.META_RESTRICTION=k,t.META_STATUS=q,t.MULTIPLE_SELECTION_SEPARATOR=w,t.MYSQL_DATETIME_FORMAT=C,t.MYSQL_DATE_FORMAT=U,t.NO_FILL_STATUS=W,t.NUMBER_TYPE=h,t.NotifiedAboutInfo=re,t.OBJECT_TYPE=b,t.PATIENT_CREATION_ABOUT=R,t.SELECTOR_TYPE=Q,t.SHORT_TIME_FORMAT=D,t.SLIDER_SCALE_ORIENTATION_TYPE=j,t.SLIDER_SCALE_TYPE=_,t.SLIDER_SELECTOR_TYPE=K,t.SLIDER_TYPE=o,t.STATUS_FIELD_REGEXP=A,t.STATUS_SUFFIX=H,t.TIME_FORMAT=L,t.TIME_SCHEMA=G,t.TriggerAction=i,t.getIntrospectionSchema=oe,t.isNotStatusField=X,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@persei/perseed-api",
3
- "version": "4.34.10",
3
+ "version": "4.34.11",
4
4
  "private": false,
5
5
  "main": "./dist/perseed-api.umd.cjs",
6
6
  "module": "./dist/perseed-api.js",