@bahmni/services 0.0.1-dev.345 → 0.0.1-dev.348
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/encounterService/__mocks__/mocks.d.ts +0 -27
- package/dist/encounterService/__mocks__/mocks.d.ts.map +1 -1
- package/dist/encounterService/constants.d.ts +0 -1
- package/dist/encounterService/constants.d.ts.map +1 -1
- package/dist/encounterService/encounterService.d.ts +1 -7
- package/dist/encounterService/encounterService.d.ts.map +1 -1
- package/dist/encounterService/index.d.ts +1 -1
- package/dist/encounterService/index.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5253 -5023
- package/dist/observationFormsService/index.d.ts +1 -1
- package/dist/observationFormsService/index.d.ts.map +1 -1
- package/dist/observationFormsService/models.d.ts +2 -5
- package/dist/observationFormsService/models.d.ts.map +1 -1
- package/dist/observationService/__mocks__/observationMocks.d.ts +32 -0
- package/dist/observationService/__mocks__/observationMocks.d.ts.map +1 -1
- package/dist/observationService/constants.d.ts +2 -2
- package/dist/observationService/constants.d.ts.map +1 -1
- package/dist/observationService/index.d.ts +2 -1
- package/dist/observationService/index.d.ts.map +1 -1
- package/dist/observationService/observationService.d.ts +10 -20
- package/dist/observationService/observationService.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { fetchObservationForms, fetchFormMetadata, getPatientFormData, } from './observationFormsService';
|
|
2
|
-
export { type ObservationForm, type FormApiResponse, type ApiNameTranslation, type FormPrivilege, type
|
|
2
|
+
export { type ObservationForm, type FormApiResponse, type ApiNameTranslation, type FormPrivilege, type FormMetadata, type FormMetadataApiResponse, type FormResource, type ComplexValue, type ObservationFormTranslations, type FormResponseData, type FormProvider, } from './models';
|
|
3
3
|
export { transformFormDataToObservations, transformObservationsToFormData, transformContainerObservationsToForm2Observations, convertImmutableToPlainObject, extractNotesFromFormData, hasMissingMandatoryVisibleField, type FormData, type FormControlData, type Form2Observation, type ConceptValue, } from './observationFormsTransformer';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observationFormsService/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observationFormsService/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,iDAAiD,EACjD,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,+BAA+B,CAAC"}
|
|
@@ -3,6 +3,7 @@ export type { ObservationFormTranslations } from '../i18n';
|
|
|
3
3
|
export interface FormPrivilege {
|
|
4
4
|
privilegeName: string;
|
|
5
5
|
editable: boolean;
|
|
6
|
+
viewable?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export interface ObservationForm {
|
|
8
9
|
uuid: string;
|
|
@@ -10,10 +11,6 @@ export interface ObservationForm {
|
|
|
10
11
|
id: number;
|
|
11
12
|
privileges: FormPrivilege[];
|
|
12
13
|
}
|
|
13
|
-
export interface ApiFormPrivilege {
|
|
14
|
-
privilegeName: string;
|
|
15
|
-
editable: boolean;
|
|
16
|
-
}
|
|
17
14
|
export interface ApiNameTranslation {
|
|
18
15
|
display: string;
|
|
19
16
|
locale: string;
|
|
@@ -22,7 +19,7 @@ export interface FormApiResponse {
|
|
|
22
19
|
uuid: string;
|
|
23
20
|
name: string;
|
|
24
21
|
id: number;
|
|
25
|
-
privileges:
|
|
22
|
+
privileges: FormPrivilege[];
|
|
26
23
|
nameTranslation: string;
|
|
27
24
|
}
|
|
28
25
|
export interface FormResource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/observationFormsService/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEtD,YAAY,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/observationFormsService/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEtD,YAAY,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAGD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,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b,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAID,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B"}
|
|
@@ -5,4 +5,36 @@ export declare const mockEmptyObservationBundle: Bundle<Observation>;
|
|
|
5
5
|
export declare const mockEncounter: Encounter;
|
|
6
6
|
export declare const mockObservationWithEncounter: Observation;
|
|
7
7
|
export declare const mockObservationWithEncounterBundle: Bundle<Observation | Encounter>;
|
|
8
|
+
export declare const mockFormsEncounter: {
|
|
9
|
+
resourceType: string;
|
|
10
|
+
type: string;
|
|
11
|
+
total: number;
|
|
12
|
+
entry: {
|
|
13
|
+
fullUrl: string;
|
|
14
|
+
resource: {
|
|
15
|
+
resourceType: string;
|
|
16
|
+
id: string;
|
|
17
|
+
code: {
|
|
18
|
+
coding: {
|
|
19
|
+
system: string;
|
|
20
|
+
code: string;
|
|
21
|
+
display: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
valueQuantity: {
|
|
25
|
+
value: number;
|
|
26
|
+
unit: string;
|
|
27
|
+
};
|
|
28
|
+
effectiveDateTime: string;
|
|
29
|
+
encounter: {
|
|
30
|
+
reference: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
export declare const mockObservationWithFormPath: Observation;
|
|
36
|
+
export declare const mockObservationsForVitals: Observation[];
|
|
37
|
+
export declare const mockEncounterWithProvider: Encounter;
|
|
38
|
+
export declare const mockEncounterWithoutProvider: Encounter;
|
|
39
|
+
export declare const mockEncounterWithoutPeriodStart: Encounter;
|
|
8
40
|
//# sourceMappingURL=observationMocks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observationMocks.d.ts","sourceRoot":"","sources":["../../../src/observationService/__mocks__/observationMocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,eAAe,EAAE,WAkE7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,WAAW,CAQrD,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,WAAW,CAI1D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAoB3B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,WAkC1C,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,MAAM,CACrD,WAAW,GAAG,SAAS,CAqBxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"observationMocks.d.ts","sourceRoot":"","sources":["../../../src/observationService/__mocks__/observationMocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,eAAe,EAAE,WAkE7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,WAAW,CAQrD,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,WAAW,CAI1D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAoB3B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,WAkC1C,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,MAAM,CACrD,WAAW,GAAG,SAAS,CAqBxB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B9B,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,WAwBzC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,WAAW,EAmBlD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,SAuBvC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,SAe1C,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,SAqB7C,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const FHIR_OBSERVATION_URL: (patientUuid: string, conceptCodes
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const FHIR_OBSERVATION_URL: (patientUuid: string, conceptCodes?: string[], serviceRequestId?: string, includeEncounter?: boolean) => string;
|
|
2
|
+
export declare const FHIR_OBSERVATIONS_BY_ENCOUNTER_URL: (encounterUUID: string) => string;
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/observationService/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,GAC/B,aAAa,MAAM,EACnB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/observationService/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,GAC/B,aAAa,MAAM,EACnB,eAAe,MAAM,EAAE,EACvB,mBAAmB,MAAM,EACzB,mBAAmB,OAAO,WAkB3B,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAAI,eAAe,MAAM,WACA,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { getPatientObservationsBundle, getPatientObservationsWithEncounterBundle, getPatientObservations, } from './observationService';
|
|
1
|
+
export { getPatientObservationsBundle, getPatientObservationsWithEncounterBundle, getPatientObservations, getObservationsBundleByEncounterUuid, groupObservationsByEncounter, } from './observationService';
|
|
2
|
+
export type { EncounterGroup } from './observationService';
|
|
2
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observationService/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,yCAAyC,EACzC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observationService/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,yCAAyC,EACzC,sBAAsB,EACtB,oCAAoC,EACpC,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { Observation, Bundle, Encounter } from 'fhir/r4';
|
|
2
|
-
|
|
3
|
-
* Fetch patient observation bundle from FHIR API
|
|
4
|
-
* @param patientUuid - Patient UUID
|
|
5
|
-
* @param conceptCodes - Array of concept UUIDs
|
|
6
|
-
* @returns Promise resolving to FHIR observation bundle
|
|
7
|
-
*/
|
|
8
|
-
export declare function getPatientObservationsBundle(patientUuid: string, conceptCodes: string[]): Promise<Bundle<Observation>>;
|
|
9
|
-
/**
|
|
10
|
-
* Fetch patient observation and their encounter bundle from FHIR API
|
|
11
|
-
* @param patientUuid - Patient UUID
|
|
12
|
-
* @param conceptCodes - Array of concept UUIDs
|
|
13
|
-
* @returns Promise resolving to FHIR observation and encounter bundle
|
|
14
|
-
*/
|
|
2
|
+
export declare function getPatientObservationsBundle(patientUuid: string, conceptCodes?: string[], serviceRequestId?: string): Promise<Bundle<Observation>>;
|
|
15
3
|
export declare function getPatientObservationsWithEncounterBundle(patientUuid: string, conceptCodes: string[]): Promise<Bundle<Observation | Encounter>>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
export declare function getPatientObservations(patientUUID: string, conceptCodes?: string[], serviceRequestId?: string): Promise<Observation[]>;
|
|
5
|
+
export declare function getObservationsBundleByEncounterUuid(encounterUUID: string): Promise<Bundle<Observation>>;
|
|
6
|
+
export interface EncounterGroup {
|
|
7
|
+
encounterUuid: string;
|
|
8
|
+
encounterDateTime: number;
|
|
9
|
+
providerName: string;
|
|
10
|
+
observations: Observation[];
|
|
11
|
+
}
|
|
12
|
+
export declare const groupObservationsByEncounter: (observations: Observation[], bundle: Bundle<Encounter>) => EncounterGroup[];
|
|
23
13
|
//# sourceMappingURL=observationService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observationService.d.ts","sourceRoot":"","sources":["../../src/observationService/observationService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAOzD
|
|
1
|
+
{"version":3,"file":"observationService.d.ts","sourceRoot":"","sources":["../../src/observationService/observationService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAOzD,wBAAsB,4BAA4B,CAChD,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,EAAE,EACvB,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAG9B;AAED,wBAAsB,yCAAyC,CAC7D,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC,CAG1C;AAED,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,EAAE,EACvB,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,WAAW,EAAE,CAAC,CAYxB;AAED,wBAAsB,oCAAoC,CACxD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAI9B;AACD,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAMD,eAAO,MAAM,4BAA4B,GACvC,cAAc,WAAW,EAAE,EAC3B,QAAQ,MAAM,CAAC,SAAS,CAAC,KACxB,cAAc,EA8ChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bahmni/services",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.348",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"prepublishOnly": "yarn run build"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"axios": "^1.
|
|
28
|
+
"axios": "^1.18.0",
|
|
29
29
|
"html-entities": "^2.6.0",
|
|
30
30
|
"i18next": "^24.2.3",
|
|
31
31
|
"i18next-browser-languagedetector": "^8.0.4",
|