@ecrvs/opencrvs-toolkit 1.8.1-rc.b48c48d → 1.8.1-rc.fb8610c

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.
@@ -0,0 +1,5 @@
1
+ export declare const medicalAbbreviations: {
2
+ code: string;
3
+ label: string;
4
+ }[];
5
+ //# sourceMappingURL=abbreviation.d.ts.map
@@ -122,7 +122,7 @@ export declare function createFieldConditionals(fieldId: string): {
122
122
  isLessThan: (value: number | FieldReference) => JSONSchema;
123
123
  isEqualTo(value: string | boolean | FieldReference): JSONSchema;
124
124
  isEqualToSumOf(val1: FieldReference, val2: FieldReference): JSONSchema;
125
- isGreaterThanOrEqualTo(value: number | string | FieldReference): JSONSchema;
125
+ isAbbreviation(): JSONSchema;
126
126
  /**
127
127
  * Use case: Some fields are rendered when selection is not made, or boolean false is explicitly selected.
128
128
  * @example field('recommender.none').isFalsy() vs not(field('recommender.none').isEqualTo(true))
@@ -168,7 +168,7 @@ export declare function createFieldConditionals(fieldId: string): {
168
168
  isLessThan: (value: number | FieldReference) => JSONSchema;
169
169
  isEqualTo(value: string | boolean | FieldReference): JSONSchema;
170
170
  isEqualToSumOf(val1: FieldReference, val2: FieldReference): JSONSchema;
171
- isGreaterThanOrEqualTo(value: number | string | FieldReference): JSONSchema;
171
+ isAbbreviation(): JSONSchema;
172
172
  /**
173
173
  * Use case: Some fields are rendered when selection is not made, or boolean false is explicitly selected.
174
174
  * @example field('recommender.none').isFalsy() vs not(field('recommender.none').isEqualTo(true))
@@ -100,9 +100,7 @@ export declare function field(fieldId: string, options?: {
100
100
  }, val2: {
101
101
  $$field: string;
102
102
  }): import("../conditionals/conditionals").JSONSchema;
103
- isGreaterThanOrEqualTo(value: number | string | {
104
- $$field: string;
105
- }): import("../conditionals/conditionals").JSONSchema;
103
+ isAbbreviation(): import("../conditionals/conditionals").JSONSchema;
106
104
  isFalsy(): import("../conditionals/conditionals").JSONSchema;
107
105
  isUndefined(): import("../conditionals/conditionals").JSONSchema;
108
106
  inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
@@ -149,9 +147,7 @@ export declare function field(fieldId: string, options?: {
149
147
  }, val2: {
150
148
  $$field: string;
151
149
  }): import("../conditionals/conditionals").JSONSchema;
152
- isGreaterThanOrEqualTo(value: number | string | {
153
- $$field: string;
154
- }): import("../conditionals/conditionals").JSONSchema;
150
+ isAbbreviation(): import("../conditionals/conditionals").JSONSchema;
155
151
  isFalsy(): import("../conditionals/conditionals").JSONSchema;
156
152
  isUndefined(): import("../conditionals/conditionals").JSONSchema;
157
153
  inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
@@ -367,34 +367,19 @@ function createFieldConditionals(fieldId) {
367
367
  },
368
368
  required: [fieldId, field1Id, field2Id],
369
369
  sumOf: {
370
- sum: { $data: `/$form/${fieldId}` },
371
- field1: { $data: `/$form/${field1Id}` },
372
- field2: { $data: `/$form/${field2Id}` }
370
+ sum: fieldId,
371
+ field1: field1Id,
372
+ field2: field2Id
373
373
  }
374
374
  });
375
375
  },
376
- isGreaterThanOrEqualTo(value) {
377
- const fieldSchema = { type: "number" };
378
- const properties = {};
379
- const required = [fieldId];
380
- if (typeof value === "number") {
381
- fieldSchema.minimum = value;
382
- } else {
383
- let refField = "";
384
- if (isFieldReference(value)) {
385
- refField = value.$$field;
386
- } else {
387
- refField = value;
388
- }
389
- fieldSchema.minimum = { $data: `/$form/${refField}` };
390
- properties[refField] = { type: "number" };
391
- required.push(refField);
392
- }
393
- properties[fieldId] = fieldSchema;
376
+ isAbbreviation() {
394
377
  return defineFormConditional({
395
378
  type: "object",
396
- properties,
397
- required
379
+ properties: {
380
+ [fieldId]: { type: "string", isAbbreviation: true }
381
+ },
382
+ required: [fieldId]
398
383
  });
399
384
  },
400
385
  /**