@bahmni/services 0.0.1-dev.189 → 0.0.1-dev.191

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.
@@ -1 +1 @@
1
- {"version":3,"file":"documentReferenceService.d.ts","sourceRoot":"","sources":["../../src/documentReferenceService/documentReferenceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AA+B7C;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAGpC;AAED;;;;;;GAMG;AACH,wBAAsB,8BAA8B,CAClD,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAM9B"}
1
+ {"version":3,"file":"documentReferenceService.d.ts","sourceRoot":"","sources":["../../src/documentReferenceService/documentReferenceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAsC7C;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAGpC;AAED;;;;;;GAMG;AACH,wBAAsB,8BAA8B,CAClD,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAM9B"}
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Interface representing a single attachment within a document
3
+ */
4
+ export interface Attachment {
5
+ readonly url: string;
6
+ readonly contentType?: string;
7
+ }
1
8
  /**
2
9
  * Interface representing a formatted document for easier consumption by components
3
10
  */
@@ -9,5 +16,6 @@ export interface DocumentViewModel {
9
16
  readonly uploadedBy?: string;
10
17
  readonly contentType?: string;
11
18
  readonly documentUrl: string;
19
+ readonly attachments: Attachment[];
12
20
  }
13
21
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/documentReferenceService/models.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/documentReferenceService/models.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;CACpC"}
package/dist/index.js CHANGED
@@ -12099,6 +12099,8 @@ const wn = /* @__PURE__ */ new Map(), zg = async (e) => {
12099
12099
  }, kw = (e, t) => {
12100
12100
  if (!e || e.length === 0)
12101
12101
  return !1;
12102
+ if (!t || t.length === 0)
12103
+ return !0;
12102
12104
  const r = Array.isArray(t) ? t : [t];
12103
12105
  return e.some(
12104
12106
  (n) => r.includes(n.name)
@@ -12431,15 +12433,16 @@ const Dn = "consultation:saved", Jw = (e) => {
12431
12433
  };
12432
12434
  function ty(e) {
12433
12435
  return e.filter((t) => t.resource?.resourceType === "DocumentReference").map((t) => {
12434
- const r = t.resource, n = r.content?.[0]?.attachment, s = r.masterIdentifier?.value ?? r.id ?? "";
12436
+ const r = t.resource, n = r.masterIdentifier?.value ?? r.id ?? "", s = (r.content ?? []).map((o) => o.attachment).filter((o) => !!o).map((o) => ({ url: o.url ?? "", contentType: o.contentType })), a = s[0];
12435
12437
  return {
12436
- id: r.id ?? s,
12437
- documentIdentifier: s,
12438
+ id: r.id ?? n,
12439
+ documentIdentifier: n,
12438
12440
  documentType: r.type?.coding?.[0]?.display ?? r.category?.[0]?.coding?.[0]?.display,
12439
12441
  uploadedOn: r.date ?? "",
12440
12442
  uploadedBy: r.author?.[0]?.display,
12441
- contentType: n?.contentType,
12442
- documentUrl: n?.url ?? ""
12443
+ contentType: a?.contentType,
12444
+ documentUrl: a?.url ?? "",
12445
+ attachments: s
12443
12446
  };
12444
12447
  });
12445
12448
  }
@@ -11,5 +11,5 @@ export declare const getCurrentUserPrivileges: () => Promise<UserPrivilege[] | n
11
11
  * @param requiredPrivilege - Name of the privilege or array of privilege names to check
12
12
  * @returns true if user has any of the required privileges, false otherwise
13
13
  */
14
- export declare const hasPrivilege: (userPrivileges: UserPrivilege[] | null, requiredPrivilege: string | string[]) => boolean;
14
+ export declare const hasPrivilege: (userPrivileges: UserPrivilege[] | null, requiredPrivilege: string | string[] | undefined) => boolean;
15
15
  //# sourceMappingURL=privilegeService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"privilegeService.d.ts","sourceRoot":"","sources":["../../src/privilegeService/privilegeService.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAmB,MAAM,UAAU,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAa,OAAO,CACvD,aAAa,EAAE,GAAG,IAAI,CAUvB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,gBAAgB,aAAa,EAAE,GAAG,IAAI,EACtC,mBAAmB,MAAM,GAAG,MAAM,EAAE,KACnC,OAYF,CAAC"}
1
+ {"version":3,"file":"privilegeService.d.ts","sourceRoot":"","sources":["../../src/privilegeService/privilegeService.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAmB,MAAM,UAAU,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAa,OAAO,CACvD,aAAa,EAAE,GAAG,IAAI,CAUvB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,gBAAgB,aAAa,EAAE,GAAG,IAAI,EACtC,mBAAmB,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,KAC/C,OAgBF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/services",
3
- "version": "0.0.1-dev.189",
3
+ "version": "0.0.1-dev.191",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",