@greensecurity/javascript-sdk 0.45.0-beta.0 → 0.45.0-beta.2

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 (61) hide show
  1. package/dist/commonjs/__tests__/fhirconfigs.test.js +21 -5
  2. package/dist/commonjs/__tests__/fhirconfigs.test.js.map +1 -1
  3. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  4. package/dist/commonjs/__tests__/zones.test.js +29 -3
  5. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  6. package/dist/commonjs/funcs/usersPostAuthenticate.js +1 -1
  7. package/dist/commonjs/funcs/usersPostAuthenticate.js.map +1 -1
  8. package/dist/commonjs/lib/config.d.ts +3 -3
  9. package/dist/commonjs/lib/config.js +3 -3
  10. package/dist/commonjs/lib/encodings.d.ts +10 -9
  11. package/dist/commonjs/lib/encodings.d.ts.map +1 -1
  12. package/dist/commonjs/lib/encodings.js +29 -13
  13. package/dist/commonjs/lib/encodings.js.map +1 -1
  14. package/dist/commonjs/models/components/fhirconfig.d.ts +16 -0
  15. package/dist/commonjs/models/components/fhirconfig.d.ts.map +1 -1
  16. package/dist/commonjs/models/components/fhirconfig.js +4 -0
  17. package/dist/commonjs/models/components/fhirconfig.js.map +1 -1
  18. package/dist/commonjs/models/components/fhirconfigcreate.d.ts +18 -0
  19. package/dist/commonjs/models/components/fhirconfigcreate.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/fhirconfigcreate.js +4 -0
  21. package/dist/commonjs/models/components/fhirconfigcreate.js.map +1 -1
  22. package/dist/commonjs/models/components/fhirextraentities.d.ts +9 -0
  23. package/dist/commonjs/models/components/fhirextraentities.d.ts.map +1 -1
  24. package/dist/commonjs/models/components/fhirextraentities.js +11 -0
  25. package/dist/commonjs/models/components/fhirextraentities.js.map +1 -1
  26. package/dist/esm/__tests__/fhirconfigs.test.js +21 -5
  27. package/dist/esm/__tests__/fhirconfigs.test.js.map +1 -1
  28. package/dist/esm/__tests__/vendors.test.js +1 -1
  29. package/dist/esm/__tests__/zones.test.js +29 -3
  30. package/dist/esm/__tests__/zones.test.js.map +1 -1
  31. package/dist/esm/funcs/usersPostAuthenticate.js +1 -1
  32. package/dist/esm/funcs/usersPostAuthenticate.js.map +1 -1
  33. package/dist/esm/lib/config.d.ts +3 -3
  34. package/dist/esm/lib/config.js +3 -3
  35. package/dist/esm/lib/encodings.d.ts +10 -9
  36. package/dist/esm/lib/encodings.d.ts.map +1 -1
  37. package/dist/esm/lib/encodings.js +29 -13
  38. package/dist/esm/lib/encodings.js.map +1 -1
  39. package/dist/esm/models/components/fhirconfig.d.ts +16 -0
  40. package/dist/esm/models/components/fhirconfig.d.ts.map +1 -1
  41. package/dist/esm/models/components/fhirconfig.js +4 -0
  42. package/dist/esm/models/components/fhirconfig.js.map +1 -1
  43. package/dist/esm/models/components/fhirconfigcreate.d.ts +18 -0
  44. package/dist/esm/models/components/fhirconfigcreate.d.ts.map +1 -1
  45. package/dist/esm/models/components/fhirconfigcreate.js +4 -0
  46. package/dist/esm/models/components/fhirconfigcreate.js.map +1 -1
  47. package/dist/esm/models/components/fhirextraentities.d.ts +9 -0
  48. package/dist/esm/models/components/fhirextraentities.d.ts.map +1 -1
  49. package/dist/esm/models/components/fhirextraentities.js +11 -0
  50. package/dist/esm/models/components/fhirextraentities.js.map +1 -1
  51. package/jsr.json +1 -1
  52. package/package.json +1 -1
  53. package/src/__tests__/fhirconfigs.test.ts +21 -5
  54. package/src/__tests__/vendors.test.ts +1 -1
  55. package/src/__tests__/zones.test.ts +29 -3
  56. package/src/funcs/usersPostAuthenticate.ts +1 -0
  57. package/src/lib/config.ts +3 -3
  58. package/src/lib/encodings.ts +58 -23
  59. package/src/models/components/fhirconfig.ts +20 -0
  60. package/src/models/components/fhirconfigcreate.ts +22 -0
  61. package/src/models/components/fhirextraentities.ts +20 -0
@@ -47,6 +47,22 @@ export type FhirConfigCreate = {
47
47
  */
48
48
  entities: FhirExtraEntities;
49
49
  projection?: string | undefined;
50
+ /**
51
+ * A JMESPath that decides whether a patient should be hidden (VIP, confidential, anonymized). When set it replaces the built-in checks, so a facility can describe its own rule instead of relying on the defaults. Some sites carry the anonymized marker on the encounter rather than the patient extension, which the built-ins do not look at.
52
+ *
53
+ * @remarks
54
+ *
55
+ * See [JMESPath](https://jmespath.org/)
56
+ */
57
+ restrictionFilter?: string | null | undefined;
58
+ /**
59
+ * A JMESPath that maps `{ patient, flags, encounter }` to the standard `{ isAnonymized, hasVipFlag }` shape. Takes precedence over restriction_filter, and covers the HL7 path as well as FHIR. Leave empty to fall back to restriction_filter or the built-in checks.
60
+ *
61
+ * @remarks
62
+ *
63
+ * See [JMESPath](https://jmespath.org/)
64
+ */
65
+ restrictionProjection?: string | null | undefined;
50
66
  };
51
67
 
52
68
  /** @internal */
@@ -173,6 +189,8 @@ export type FhirConfigCreate$Outbound = {
173
189
  notes?: string | undefined;
174
190
  entities: FhirExtraEntities$Outbound;
175
191
  projection?: string | undefined;
192
+ restriction_filter?: string | null | undefined;
193
+ restriction_projection?: string | null | undefined;
176
194
  };
177
195
 
178
196
  /** @internal */
@@ -192,12 +210,16 @@ export const FhirConfigCreate$outboundSchema: z.ZodType<
192
210
  notes: z.string().optional(),
193
211
  entities: FhirExtraEntities$outboundSchema,
194
212
  projection: z.string().optional(),
213
+ restrictionFilter: z.nullable(z.string()).optional(),
214
+ restrictionProjection: z.nullable(z.string()).optional(),
195
215
  }).transform((v) => {
196
216
  return remap$(v, {
197
217
  productionProfile: "production_profile",
198
218
  nonProductionProfile: "non_production_profile",
199
219
  appliesTo: "applies_to",
200
220
  activeProfile: "active_profile",
221
+ restrictionFilter: "restriction_filter",
222
+ restrictionProjection: "restriction_projection",
201
223
  });
202
224
  });
203
225
 
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
7
8
  import { Result as SafeParseResult } from "../../types/fp.js";
8
9
  import * as types from "../../types/primitives.js";
@@ -14,6 +15,14 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
15
  export type FhirExtraEntities = {
15
16
  flags?: boolean | undefined;
16
17
  consents?: boolean | undefined;
18
+ /**
19
+ * Which Flag category a patient lookup should scope its search to. Epic refuses a Flag search that names no category, so a facility on Epic should set this or the search comes back rejected and the patient looks like they have no flags. Cerner and other servers allow a broad search and can leave it empty.
20
+ *
21
+ * @remarks
22
+ *
23
+ * Leave empty to let the client decide.
24
+ */
25
+ flagCategory?: string | null | undefined;
17
26
  };
18
27
 
19
28
  /** @internal */
@@ -24,11 +33,17 @@ export const FhirExtraEntities$inboundSchema: z.ZodType<
24
33
  > = z.object({
25
34
  flags: types.optional(types.boolean()),
26
35
  consents: types.optional(types.boolean()),
36
+ flag_category: z.nullable(types.string()).optional(),
37
+ }).transform((v) => {
38
+ return remap$(v, {
39
+ "flag_category": "flagCategory",
40
+ });
27
41
  });
28
42
  /** @internal */
29
43
  export type FhirExtraEntities$Outbound = {
30
44
  flags?: boolean | undefined;
31
45
  consents?: boolean | undefined;
46
+ flag_category?: string | null | undefined;
32
47
  };
33
48
 
34
49
  /** @internal */
@@ -39,6 +54,11 @@ export const FhirExtraEntities$outboundSchema: z.ZodType<
39
54
  > = z.object({
40
55
  flags: z.boolean().optional(),
41
56
  consents: z.boolean().optional(),
57
+ flagCategory: z.nullable(z.string()).optional(),
58
+ }).transform((v) => {
59
+ return remap$(v, {
60
+ flagCategory: "flag_category",
61
+ });
42
62
  });
43
63
 
44
64
  export function fhirExtraEntitiesToJSON(