@bahmni/services 0.0.1-dev.372 → 0.0.1-dev.376
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/episodeOfCareService/__mocks__/episodeOfCareMocks.d.ts +28 -0
- package/dist/episodeOfCareService/__mocks__/episodeOfCareMocks.d.ts.map +1 -0
- package/dist/episodeOfCareService/constants.d.ts +1 -0
- package/dist/episodeOfCareService/constants.d.ts.map +1 -1
- package/dist/episodeOfCareService/episodeOfCareService.d.ts +2 -0
- package/dist/episodeOfCareService/episodeOfCareService.d.ts.map +1 -1
- package/dist/episodeOfCareService/index.d.ts +1 -1
- package/dist/episodeOfCareService/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1397 -1393
- package/dist/observationFormsService/index.d.ts +1 -1
- package/dist/observationFormsService/index.d.ts.map +1 -1
- package/dist/observationFormsService/models.d.ts +6 -10
- package/dist/observationFormsService/models.d.ts.map +1 -1
- package/dist/observationFormsService/observationFormsTransformer.d.ts +8 -2
- package/dist/observationFormsService/observationFormsTransformer.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { fetchObservationForms, fetchFormMetadata, fetchFormUuidByObservationDate, getPatientFormData, } from './observationFormsService';
|
|
2
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
|
-
export { transformFormDataToObservations, transformObservationsToFormData, transformContainerObservationsToForm2Observations, convertImmutableToPlainObject, extractNotesFromFormData, type FormData, type FormControlData, type Form2Observation, type ConceptValue, } from './observationFormsTransformer';
|
|
3
|
+
export { transformFormDataToObservations, transformObservationsToFormData, transformContainerObservationsToForm2Observations, convertImmutableToPlainObject, extractNotesFromFormData, formatDateForControl, 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,8BAA8B,EAC9B,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,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observationFormsService/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,8BAA8B,EAC9B,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,oBAAoB,EACpB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,+BAA+B,CAAC"}
|
|
@@ -42,15 +42,13 @@ export interface FormMetadata {
|
|
|
42
42
|
translations?: ObservationFormTranslations;
|
|
43
43
|
}
|
|
44
44
|
export interface Form2Observation {
|
|
45
|
-
/** FHIR Observation resource UUID
|
|
46
|
-
* (edit flow). Used to emit PUT instead of POST in the encounter bundle. */
|
|
45
|
+
/** FHIR Observation resource UUID; present for observations fetched from the backend (edit flow). */
|
|
47
46
|
uuid?: string;
|
|
48
|
-
/** True when the observation was cleared/deleted by the user in edit mode.
|
|
49
|
-
* Combined with uuid, signals the bundle builder to emit DELETE. */
|
|
47
|
+
/** True when the observation was cleared/deleted by the user in edit mode. */
|
|
50
48
|
voided?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
/** True when this leaf obs's value/comment/interpretation exactly match what's already saved. */
|
|
50
|
+
unchanged?: boolean;
|
|
51
|
+
/** Current FHIR status stored in OpenMRS (e.g. "final", "amended"); echoed back on PUT. */
|
|
54
52
|
status?: string;
|
|
55
53
|
concept: {
|
|
56
54
|
uuid: string;
|
|
@@ -83,9 +81,7 @@ export interface FormResponseData {
|
|
|
83
81
|
formType: string;
|
|
84
82
|
formName: string;
|
|
85
83
|
formVersion: number;
|
|
86
|
-
/** UUID of the specific published form version used when the encounter was saved.
|
|
87
|
-
* This is the authoritative identifier — same field used by the old Bahmni
|
|
88
|
-
* Angular frontend (observationForm.formUuid) to load the correct form for edit. */
|
|
84
|
+
/** UUID of the specific published form version used when the encounter was saved. */
|
|
89
85
|
formUuid?: string;
|
|
90
86
|
visitUuid: string;
|
|
91
87
|
visitStartDateTime: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/observationFormsService/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,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B,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B"}
|
|
@@ -4,7 +4,7 @@ export interface FormControlData {
|
|
|
4
4
|
id: string;
|
|
5
5
|
conceptUuid: string;
|
|
6
6
|
type: 'text' | 'number' | 'date' | 'datetime' | 'select' | 'multiselect' | 'section' | 'obsControl';
|
|
7
|
-
value: string | number | boolean |
|
|
7
|
+
value: string | number | boolean | ConceptValue | ConceptValue[] | ComplexValue | null;
|
|
8
8
|
label?: string;
|
|
9
9
|
units?: string;
|
|
10
10
|
interpretation?: string;
|
|
@@ -15,13 +15,19 @@ export interface FormData {
|
|
|
15
15
|
controls: FormControlData[];
|
|
16
16
|
metadata?: Record<string, unknown>;
|
|
17
17
|
}
|
|
18
|
+
export declare function formatDateForControl(date: Date): string;
|
|
18
19
|
export declare function transformFormDataToObservations(formData: FormData, metadata: FormMetadata): Form2Observation[];
|
|
19
20
|
export declare function transformObservationsToFormData(observations: Form2Observation[], formMetadata: FormMetadata): FormData;
|
|
20
21
|
/**
|
|
21
22
|
* Transforms raw observations from Container.getValue() to Form2Observation format
|
|
22
23
|
* This ensures comment, interpretation, and other fields are properly included
|
|
24
|
+
*
|
|
25
|
+
* @param formMetadata - Optional form schema. When provided, each obs's concept.datatype
|
|
26
|
+
* is re-derived from the schema instead of the raw container value — FHIR has no separate
|
|
27
|
+
* value[x] for date-only vs datetime concepts (both use valueDateTime), so datatype echoed
|
|
28
|
+
* back from an edit-mode fetch is unreliable for that distinction; the schema is not.
|
|
23
29
|
*/
|
|
24
|
-
export declare function transformContainerObservationsToForm2Observations(containerObservations: Record<string, unknown>[]): Form2Observation[];
|
|
30
|
+
export declare function transformContainerObservationsToForm2Observations(containerObservations: Record<string, unknown>[], formMetadata?: FormMetadata): Form2Observation[];
|
|
25
31
|
/**
|
|
26
32
|
* Converts Immutable.js data structures to plain JavaScript objects
|
|
27
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observationFormsTransformer.d.ts","sourceRoot":"","sources":["../../src/observationFormsService/observationFormsTransformer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"observationFormsTransformer.d.ts","sourceRoot":"","sources":["../../src/observationFormsService/observationFormsTransformer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAElB,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EACA,MAAM,GACN,QAAQ,GACR,MAAM,GACN,UAAU,GACV,QAAQ,GACR,aAAa,GACb,SAAS,GACT,YAAY,CAAC;IACjB,KAAK,EACD,MAAM,GACN,MAAM,GACN,OAAO,GACP,YAAY,GACZ,YAAY,EAAE,GACd,YAAY,GACZ,IAAI,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CASvD;AAqGD,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,GACrB,gBAAgB,EAAE,CAgFpB;AAED,wBAAgB,+BAA+B,CAC7C,YAAY,EAAE,gBAAgB,EAAE,EAChC,YAAY,EAAE,YAAY,G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