@openmrs/esm-api 5.6.1-pre.1790 → 5.6.1-pre.1795

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,6 +1,6 @@
1
- @openmrs/esm-api:build: cache hit, replaying output d29fc98d48e8b5c4
1
+ @openmrs/esm-api:build: cache hit, replaying output ee3a4587a2063edd
2
2
  @openmrs/esm-api:build: asset openmrs-esm-api.js 53.4 KiB [emitted] [minimized] (name: main) 2 related assets
3
- @openmrs/esm-api:build: orphan modules 440 KiB [orphan] 237 modules
3
+ @openmrs/esm-api:build: orphan modules 440 KiB [orphan] 240 modules
4
4
  @openmrs/esm-api:build: runtime modules 670 bytes 3 modules
5
5
  @openmrs/esm-api:build: built modules 140 KiB [built]
6
6
  @openmrs/esm-api:build:  modules by path external "@openmrs/ 168 bytes
@@ -11,4 +11,4 @@
11
11
  @openmrs/esm-api:build:  cacheable modules 139 KiB
12
12
  @openmrs/esm-api:build:  ./src/index.ts + 51 modules 135 KiB [built] [code generated]
13
13
  @openmrs/esm-api:build:  ../esm-state/dist/openmrs-esm-state.js 4.66 KiB [built] [code generated]
14
- @openmrs/esm-api:build: webpack 5.88.0 compiled successfully in 4051 ms
14
+ @openmrs/esm-api:build: webpack 5.88.0 compiled successfully in 3995 ms
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-api",
3
- "version": "5.6.1-pre.1790",
3
+ "version": "5.6.1-pre.1795",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The javascript module for interacting with the OpenMRS API",
6
6
  "browser": "dist/openmrs-esm-api.js",
@@ -48,10 +48,10 @@
48
48
  "@openmrs/esm-offline": "5.x"
49
49
  },
50
50
  "devDependencies": {
51
- "@openmrs/esm-config": "5.6.1-pre.1790",
52
- "@openmrs/esm-error-handling": "5.6.1-pre.1790",
53
- "@openmrs/esm-navigation": "5.6.1-pre.1790",
54
- "@openmrs/esm-state": "5.6.1-pre.1790",
51
+ "@openmrs/esm-config": "5.6.1-pre.1795",
52
+ "@openmrs/esm-error-handling": "5.6.1-pre.1795",
53
+ "@openmrs/esm-navigation": "5.6.1-pre.1795",
54
+ "@openmrs/esm-state": "5.6.1-pre.1795",
55
55
  "rxjs": "^6.5.3",
56
56
  "webpack": "^5.88.0"
57
57
  },
@@ -0,0 +1,5 @@
1
+ import { type OpenmrsResource } from './openmrs-resource';
2
+
3
+ export interface Concept extends OpenmrsResource {
4
+ // TODO: add more fields
5
+ }
@@ -1,6 +1,9 @@
1
1
  export * from './attachments-types';
2
+ export * from './concept-resource';
2
3
  export * from './fetch';
3
4
  export * from './fhir-resource';
4
5
  export * from './openmrs-resource';
5
6
  export * from './user-resource';
7
+ export * from './patient-resource';
8
+ export * from './person-resource';
6
9
  export * from './visit-resource';
@@ -1,5 +1,39 @@
1
- export interface OpenmrsResource {
1
+ import { type User } from './user-resource';
2
+
3
+ export interface OpenmrsResource extends OpenmrsResourceStrict {
4
+ [anythingElse: string]: any;
5
+ }
6
+
7
+ /**
8
+ * Superclass for all Openmrs Resources, with strict typings.
9
+ * If the subclass does not have all attributes (including optional ones)
10
+ * accounted for, use OpenmrsResource instead.
11
+ */
12
+ export interface OpenmrsResourceStrict {
2
13
  uuid: string;
3
14
  display?: string;
4
- [anythingElse: string]: any;
15
+ links?: Array<Link>;
16
+ auditInfo?: AuditInfo;
17
+ resourceVersion?: string;
18
+ }
19
+
20
+ export interface Link {
21
+ rel: string;
22
+ uri: string;
23
+ resourceAlias?: string;
24
+ }
25
+
26
+ export interface AuditInfo {
27
+ dateCreated?: string;
28
+ creator?: User;
29
+ dateChanged?: string;
30
+ changedBy?: User;
31
+ voided?: boolean;
32
+ dateVoided?: string;
33
+ voidedBy?: User;
34
+ voidReason?: string;
35
+ retired?: boolean;
36
+ datedRetired?: string;
37
+ retiredBy?: User;
38
+ retireReason?: string;
5
39
  }
@@ -0,0 +1,28 @@
1
+ import { type OpenmrsResourceStrict } from './openmrs-resource';
2
+ import { type Person } from './person-resource';
3
+
4
+ export interface PatientIdentifierType extends OpenmrsResourceStrict {
5
+ name?: string;
6
+ description?: string;
7
+ format?: string;
8
+ formatDescription?: string;
9
+ required?: boolean;
10
+ validator?: string;
11
+ locationBehavior?: string;
12
+ uniquenessBehavior?: string;
13
+ retired?: boolean;
14
+ }
15
+
16
+ export interface Patient extends OpenmrsResourceStrict {
17
+ identifiers?: PatientIdentifier[];
18
+ person?: Person;
19
+ voided?: boolean;
20
+ }
21
+
22
+ export interface PatientIdentifier extends OpenmrsResourceStrict {
23
+ identifier?: string;
24
+ identifierType?: PatientIdentifierType;
25
+ location?: Location;
26
+ preferred?: boolean;
27
+ voided?: boolean;
28
+ }
@@ -0,0 +1,69 @@
1
+ import { type Concept } from './concept-resource';
2
+ import { type OpenmrsResourceStrict, type OpenmrsResource } from './openmrs-resource';
3
+
4
+ export interface PersonAttribute extends OpenmrsResourceStrict {
5
+ attributeType?: OpenmrsResource;
6
+ value?: string;
7
+ voided?: boolean;
8
+ }
9
+
10
+ export interface Person extends OpenmrsResourceStrict {
11
+ gender?: string;
12
+ age?: number;
13
+ birthdate?: string;
14
+ birthdateEstimated?: boolean;
15
+ dead?: boolean;
16
+ deathDate?: string | null;
17
+ causeOfDeath?: Concept | null;
18
+ preferredName?: PersonName;
19
+ preferredAddress?: PersonAddress;
20
+ names?: Array<PersonName>;
21
+ addresses?: Array<PersonAddress>;
22
+ attributes?: Array<PersonAttribute>;
23
+ voided?: boolean;
24
+ birthtime?: string | null;
25
+ deathdateEstimated?: boolean;
26
+ causeOfDeathNonCoded?: string | null;
27
+ }
28
+
29
+ export interface PersonName extends OpenmrsResourceStrict {
30
+ givenName?: string;
31
+ middleName?: string;
32
+ familyName?: string;
33
+ familyName2?: string;
34
+ preferred?: boolean;
35
+ prefix?: string;
36
+ familyNamePrefix?: string;
37
+ familyNameSuffix?: string;
38
+ degree?: string;
39
+ voided?: boolean;
40
+ }
41
+
42
+ export interface PersonAddress extends OpenmrsResourceStrict {
43
+ preferred?: boolean;
44
+ cityVillage?: string;
45
+ stateProvince?: string;
46
+ country?: string;
47
+ postalCode?: string;
48
+ countyDistrict?: string;
49
+ startDate?: string;
50
+ endDate?: string;
51
+ latitude?: string;
52
+ longitude?: string;
53
+ address1?: string;
54
+ address2?: string;
55
+ address3?: string;
56
+ address4?: string;
57
+ address5?: string;
58
+ address6?: string;
59
+ address7?: string;
60
+ address8?: string;
61
+ address9?: string;
62
+ address10?: string;
63
+ address11?: string;
64
+ address12?: string;
65
+ address13?: string;
66
+ address14?: string;
67
+ address15?: string;
68
+ voided?: boolean;
69
+ }
@@ -1,3 +1,6 @@
1
+ import { type OpenmrsResource } from './openmrs-resource';
2
+ import { type Person } from './person-resource';
3
+
1
4
  export interface Session {
2
5
  allowedLocales?: Array<string>;
3
6
  authenticated: boolean;
@@ -49,12 +52,6 @@ export interface SessionLocation {
49
52
  links: Array<any>;
50
53
  }
51
54
 
52
- export interface Person {
53
- uuid: string;
54
- display: string;
55
- links: Array<any>;
56
- }
57
-
58
55
  export interface Privilege {
59
56
  uuid: string;
60
57
  display: string;
@@ -66,3 +63,7 @@ export interface Role {
66
63
  display: string;
67
64
  links: Array<any>;
68
65
  }
66
+
67
+ export interface User extends OpenmrsResource {
68
+ // TODO: add more attributes
69
+ }