@openmrs/esm-generic-patient-widgets-app 11.3.1-pre.9054 → 11.3.1-pre.9066

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 (89) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/dist/1119.js +1 -1
  3. package/dist/1197.js +1 -1
  4. package/dist/2146.js +1 -1
  5. package/dist/2690.js +1 -1
  6. package/dist/3099.js +1 -1
  7. package/dist/3584.js +1 -1
  8. package/dist/4055.js +1 -1
  9. package/dist/4132.js +1 -1
  10. package/dist/4300.js +1 -1
  11. package/dist/4335.js +1 -1
  12. package/dist/4618.js +1 -1
  13. package/dist/4652.js +1 -1
  14. package/dist/4944.js +1 -1
  15. package/dist/5173.js +1 -1
  16. package/dist/5241.js +1 -1
  17. package/dist/5442.js +1 -1
  18. package/dist/5661.js +1 -1
  19. package/dist/5986.js +1 -1
  20. package/dist/5986.js.map +1 -1
  21. package/dist/6022.js +1 -1
  22. package/dist/6468.js +1 -1
  23. package/dist/6679.js +1 -1
  24. package/dist/6840.js +1 -1
  25. package/dist/6859.js +1 -1
  26. package/dist/7097.js +1 -1
  27. package/dist/7159.js +1 -1
  28. package/dist/723.js +1 -1
  29. package/dist/7617.js +1 -1
  30. package/dist/795.js +1 -1
  31. package/dist/8163.js +1 -1
  32. package/dist/8349.js +1 -1
  33. package/dist/8618.js +1 -1
  34. package/dist/890.js +1 -1
  35. package/dist/9214.js +1 -1
  36. package/dist/9538.js +1 -1
  37. package/dist/9569.js +1 -1
  38. package/dist/986.js +1 -1
  39. package/dist/9879.js +1 -1
  40. package/dist/9895.js +1 -1
  41. package/dist/9900.js +1 -1
  42. package/dist/9913.js +1 -1
  43. package/dist/main.js +1 -1
  44. package/dist/main.js.map +1 -1
  45. package/dist/openmrs-esm-generic-patient-widgets-app.js +1 -1
  46. package/dist/openmrs-esm-generic-patient-widgets-app.js.buildmanifest.json +124 -124
  47. package/dist/routes.json +1 -1
  48. package/package.json +2 -2
  49. package/src/obs-graph/obs-graph.component.tsx +17 -5
  50. package/src/obs-switchable/obs-switchable.test.tsx +13 -13
  51. package/translations/am.json +1 -0
  52. package/translations/ar.json +1 -0
  53. package/translations/ar_SY.json +1 -0
  54. package/translations/bn.json +1 -0
  55. package/translations/de.json +1 -0
  56. package/translations/en.json +1 -0
  57. package/translations/en_US.json +1 -0
  58. package/translations/es.json +1 -0
  59. package/translations/es_MX.json +1 -0
  60. package/translations/fr.json +1 -0
  61. package/translations/he.json +1 -0
  62. package/translations/hi.json +1 -0
  63. package/translations/hi_IN.json +1 -0
  64. package/translations/id.json +1 -0
  65. package/translations/it.json +1 -0
  66. package/translations/ka.json +1 -0
  67. package/translations/km.json +1 -0
  68. package/translations/ku.json +1 -0
  69. package/translations/ky.json +1 -0
  70. package/translations/lg.json +1 -0
  71. package/translations/ne.json +1 -0
  72. package/translations/pl.json +1 -0
  73. package/translations/pt.json +1 -0
  74. package/translations/pt_BR.json +1 -0
  75. package/translations/qu.json +1 -0
  76. package/translations/ro_RO.json +1 -0
  77. package/translations/ru_RU.json +1 -0
  78. package/translations/si.json +1 -0
  79. package/translations/sw.json +1 -0
  80. package/translations/sw_KE.json +1 -0
  81. package/translations/tr.json +1 -0
  82. package/translations/tr_TR.json +1 -0
  83. package/translations/uk.json +1 -0
  84. package/translations/uz.json +1 -0
  85. package/translations/uz@Latn.json +1 -0
  86. package/translations/uz_UZ.json +1 -0
  87. package/translations/vi.json +1 -0
  88. package/translations/zh.json +1 -0
  89. package/translations/zh_CN.json +1 -0
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2"},"extensions":[{"name":"obs-by-encounter-widget","component":"switchableObs","online":true,"offline":true,"meta":{"fullWidth":false}},{"name":"obs-table-horizontal-widget-small","component":"obsTableHorizontal","online":true,"offline":true,"meta":{"fullWidth":false}},{"name":"obs-table-horizontal-widget","component":"obsTableHorizontal","online":true,"offline":true,"meta":{"fullWidth":true}}],"version":"11.3.1-pre.9054"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2"},"extensions":[{"name":"obs-by-encounter-widget","component":"switchableObs","online":true,"offline":true,"meta":{"fullWidth":false}},{"name":"obs-table-horizontal-widget-small","component":"obsTableHorizontal","online":true,"offline":true,"meta":{"fullWidth":false}},{"name":"obs-table-horizontal-widget","component":"obsTableHorizontal","online":true,"offline":true,"meta":{"fullWidth":true}}],"version":"11.3.1-pre.9066"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-generic-patient-widgets-app",
3
- "version": "11.3.1-pre.9054",
3
+ "version": "11.3.1-pre.9066",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Generic widgets for the patient chart",
6
6
  "browser": "dist/openmrs-esm-generic-patient-widgets-app.js",
@@ -52,7 +52,7 @@
52
52
  "swr": "2.x"
53
53
  },
54
54
  "devDependencies": {
55
- "@openmrs/esm-patient-common-lib": "11.3.1-pre.9054",
55
+ "@openmrs/esm-patient-common-lib": "11.3.1-pre.9066",
56
56
  "webpack": "^5.99.9"
57
57
  },
58
58
  "stableVersion": "11.3.0"
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback, useMemo, useState } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { Tab, TabListVertical, TabPanel, TabPanels, TabsVertical } from '@carbon/react';
4
- import { LineChart, ScaleTypes } from '@carbon/charts-react';
4
+ import { LineChart, type LineChartOptions, ScaleTypes } from '@carbon/charts-react';
5
5
  import { ExtensionSlot, formatDate, useConfig } from '@openmrs/esm-framework';
6
6
  import { type ConfigObjectSwitchable } from '../config-schema-obs-switchable';
7
7
  import { useObs } from '../resources/useObs';
@@ -73,7 +73,7 @@ const ObsGraph: React.FC<ObsGraphProps> = ({ patientUuid }) => {
73
73
  group: conceptForObs[obs.conceptUuid].label
74
74
  ? t(conceptForObs[obs.conceptUuid].label, conceptForObs[obs.conceptUuid].label)
75
75
  : obs.code.text,
76
- key: formatDate(new Date(obs.effectiveDateTime), { year: true, time: false }),
76
+ key: new Date(obs.effectiveDateTime),
77
77
  value: obs.valueQuantity.value,
78
78
  }));
79
79
 
@@ -88,12 +88,15 @@ const ObsGraph: React.FC<ObsGraphProps> = ({ patientUuid }) => {
88
88
 
89
89
  const chartColors = Object.fromEntries(selectedMenuItem.concepts.map((d) => [d.label, d.color]));
90
90
 
91
- const chartOptions = {
91
+ const chartOptions: LineChartOptions = {
92
92
  axes: {
93
93
  bottom: {
94
- title: 'Date',
94
+ title: t('date', 'Date'),
95
95
  mapsTo: 'key',
96
- scaleType: ScaleTypes.LABELS,
96
+ scaleType: ScaleTypes.TIME,
97
+ ticks: {
98
+ formatter: (value: Date) => formatDate(value, { year: true, time: false }),
99
+ },
97
100
  },
98
101
  left: {
99
102
  mapsTo: 'value',
@@ -108,6 +111,15 @@ const ObsGraph: React.FC<ObsGraphProps> = ({ patientUuid }) => {
108
111
  color: {
109
112
  scale: chartColors,
110
113
  },
114
+ tooltip: {
115
+ alwaysShowRulerTooltip: true,
116
+ showTotal: false,
117
+ valueFormatter: (value: any, label: string) =>
118
+ label == t('date', 'Date') ? formatDate(value, { year: true, time: true }) : value.toString(),
119
+ truncation: {
120
+ numCharacter: 40,
121
+ },
122
+ },
111
123
  height: '400px',
112
124
  };
113
125
 
@@ -127,8 +127,8 @@ describe('ObsSwitchable', () => {
127
127
  1,
128
128
  expect.objectContaining({
129
129
  data: [
130
- { group: 'Tallitude', key: '01-Jan-2021', value: 180 },
131
- { group: 'Tallitude', key: '01-Feb-2021', value: 182 },
130
+ { group: 'Tallitude', key: new Date('2021-01-01T00:00:00.000Z'), value: 180 },
131
+ { group: 'Tallitude', key: new Date('2021-02-01T00:00:00.000Z'), value: 182 },
132
132
  ],
133
133
  options: expect.any(Object),
134
134
  }),
@@ -139,8 +139,8 @@ describe('ObsSwitchable', () => {
139
139
  2,
140
140
  expect.objectContaining({
141
141
  data: [
142
- { group: 'Weight', key: '01-Jan-2021', value: 70 },
143
- { group: 'Weight', key: '01-Feb-2021', value: 72 },
142
+ { group: 'Weight', key: new Date('2021-01-01T00:00:00.000Z'), value: 70 },
143
+ { group: 'Weight', key: new Date('2021-02-01T00:00:00.000Z'), value: 72 },
144
144
  ],
145
145
  options: expect.any(Object),
146
146
  }),
@@ -158,7 +158,7 @@ describe('ObsSwitchable', () => {
158
158
  expect(mockLineChart).toHaveBeenNthCalledWith(
159
159
  3,
160
160
  expect.objectContaining({
161
- data: [{ group: 'Power Level', key: '01-Jan-2021', value: 9001 }],
161
+ data: [{ group: 'Power Level', key: new Date('2021-01-01T00:00:00.000Z'), value: 9001 }],
162
162
  options: expect.any(Object),
163
163
  }),
164
164
  {},
@@ -189,8 +189,8 @@ describe('ObsSwitchable', () => {
189
189
  1,
190
190
  expect.objectContaining({
191
191
  data: [
192
- { group: 'Height', key: '01-Jan-2021', value: 180 },
193
- { group: 'Height', key: '01-Feb-2021', value: 182 },
192
+ { group: 'Height', key: new Date('2021-01-01T00:00:00.000Z'), value: 180 },
193
+ { group: 'Height', key: new Date('2021-02-01T00:00:00.000Z'), value: 182 },
194
194
  ],
195
195
  options: expect.any(Object),
196
196
  }),
@@ -225,7 +225,7 @@ describe('ObsSwitchable', () => {
225
225
  expect(mockLineChart).toHaveBeenNthCalledWith(
226
226
  1,
227
227
  expect.objectContaining({
228
- data: [{ group: 'Power Level', key: '01-Jan-2021', value: 9001 }],
228
+ data: [{ group: 'Power Level', key: new Date('2021-01-01T00:00:00.000Z'), value: 9001 }],
229
229
  options: expect.any(Object),
230
230
  }),
231
231
  {},
@@ -235,10 +235,10 @@ describe('ObsSwitchable', () => {
235
235
  2,
236
236
  expect.objectContaining({
237
237
  data: [
238
- { group: 'Height', key: '01-Jan-2021', value: 180 },
239
- { group: 'Height', key: '01-Feb-2021', value: 182 },
240
- { group: 'Weight', key: '01-Jan-2021', value: 70 },
241
- { group: 'Weight', key: '01-Feb-2021', value: 72 },
238
+ { group: 'Height', key: new Date('2021-01-01T00:00:00.000Z'), value: 180 },
239
+ { group: 'Height', key: new Date('2021-02-01T00:00:00.000Z'), value: 182 },
240
+ { group: 'Weight', key: new Date('2021-01-01T00:00:00.000Z'), value: 70 },
241
+ { group: 'Weight', key: new Date('2021-02-01T00:00:00.000Z'), value: 72 },
242
242
  ],
243
243
  options: expect.any(Object),
244
244
  }),
@@ -266,7 +266,7 @@ describe('ObsSwitchable', () => {
266
266
 
267
267
  expect(mockLineChart).toHaveBeenCalledWith(
268
268
  expect.objectContaining({
269
- data: [{ group: 'Power Level', key: '01-Jan-2021', value: 9001 }],
269
+ data: [{ group: 'Power Level', key: new Date('2021-01-01T00:00:00.000Z'), value: 9001 }],
270
270
  options: expect.any(Object),
271
271
  }),
272
272
  {},
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "التاريخ والوقت",
3
4
  "encounterType": "نوع اللقاء"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Fecha y hora",
3
4
  "encounterType": "Tipo de encuentro"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date et heure",
3
4
  "encounterType": "Type de consultation"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "תאריך ושעה",
3
4
  "encounterType": "סוג הביקור"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Tanggal dan waktu",
3
4
  "encounterType": "Jenis pertemuan"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Data e ora",
3
4
  "encounterType": "Tipo di incontro"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "თარიღი და დრო",
3
4
  "encounterType": "კონსულტაციის ტიპი"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "កាលបរិច្ឆេទ និងម៉ោង",
3
4
  "encounterType": "ប្រភេទនៃការជួបប្រទះ"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Data e hora",
3
4
  "encounterType": "Tipo de consulta"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Data e hora",
3
4
  "encounterType": "Tipo de encontro"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Data si ora",
3
4
  "encounterType": "Tip intalnire"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Date and time",
3
4
  "encounterType": "Encounter type"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "Ngày và giờ",
3
4
  "encounterType": "Loại gặp gỡ"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "日期&时间",
3
4
  "encounterType": "问诊类型"
4
5
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "date": "Date",
2
3
  "dateAndTime": "日期&时间",
3
4
  "encounterType": "问诊类型"
4
5
  }