@kenyaemr/esm-patient-clinical-view-app 5.4.2-pre.2128 → 5.4.2-pre.2135

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 (31) hide show
  1. package/.turbo/turbo-build.log +67 -80
  2. package/dist/574.js +1 -1
  3. package/dist/{551.js → 825.js} +1 -1
  4. package/dist/825.js.map +1 -0
  5. package/dist/kenyaemr-esm-patient-clinical-view-app.js +1 -1
  6. package/dist/kenyaemr-esm-patient-clinical-view-app.js.buildmanifest.json +32 -32
  7. package/dist/main.js +1 -1
  8. package/dist/main.js.map +1 -1
  9. package/dist/routes.json +1 -1
  10. package/package.json +1 -1
  11. package/src/config-schema.ts +21 -5
  12. package/src/contact-list/contact-list.component.tsx +3 -1
  13. package/src/contact-list/contact-list.resource.tsx +15 -13
  14. package/src/contact-list/contact-list.workspace.tsx +10 -249
  15. package/src/contact-list/contact-tracing-history.component.tsx +1 -1
  16. package/src/family-partner-history/family-history.component.tsx +40 -9
  17. package/src/family-partner-history/family-relationship.workspace.tsx +10 -4
  18. package/src/family-partner-history/relationships.resource.tsx +24 -98
  19. package/src/hooks/useContacts.ts +1 -1
  20. package/src/hooks/usePersonAttributes.ts +15 -0
  21. package/src/index.ts +0 -4
  22. package/src/relationships/forms/baseline-info-form-section.component.tsx +315 -0
  23. package/src/relationships/forms/patient-search-create-form.tsx +38 -23
  24. package/src/relationships/relationship.resources.ts +15 -5
  25. package/src/relationships/tabs/relationships-tabs-component.tsx +0 -5
  26. package/src/routes.json +0 -16
  27. package/translations/en.json +13 -3
  28. package/dist/551.js.map +0 -1
  29. package/src/other-relationships/other-relationships.component.tsx +0 -229
  30. package/src/other-relationships/other-relationships.scss +0 -125
  31. package/src/other-relationships/other-relationships.workspace.tsx +0 -155
@@ -5,6 +5,9 @@ import { Patient } from '../types';
5
5
  import { ConfigObject } from '../config-schema';
6
6
  import omit from 'lodash/omit';
7
7
 
8
+ export const BOOLEAN_YES = '1065';
9
+ export const BOOLEAN_NO = '1066';
10
+
8
11
  export const relationshipUpdateFormSchema = z
9
12
  .object({
10
13
  startDate: z.date({ coerce: true }).max(new Date(), 'Can not be a furture date'),
@@ -72,6 +75,15 @@ export const relationshipFormSchema = z.object({
72
75
  startDate: z.date({ coerce: true }),
73
76
  endDate: z.date({ coerce: true }).optional(),
74
77
  mode: z.enum(['create', 'search']).default('search'),
78
+ baselineStatus: z.string().optional(),
79
+ preferedPNSAproach: z.string().optional(),
80
+ livingWithClient: z.string().optional(),
81
+
82
+ physicalAssault: z.enum([BOOLEAN_YES, BOOLEAN_NO]).optional(),
83
+ threatened: z.enum([BOOLEAN_YES, BOOLEAN_NO]).optional(),
84
+ sexualAssault: z.enum([BOOLEAN_YES, BOOLEAN_NO]).optional(),
85
+ ipvOutCome: z.enum(['True', 'False']).optional(),
86
+
75
87
  personBInfo: z
76
88
  .object({
77
89
  givenName: z.string().min(1, 'Given name required'),
@@ -102,7 +114,7 @@ export const saveRelationship = async (
102
114
  data: z.infer<typeof relationshipFormSchema>,
103
115
  config: ConfigObject,
104
116
  session: Session,
105
- extraAttributes: Array<{ attributeType: string; value: string }> = [],
117
+ extraAttributes: Array<{ attributeType: string; value: string; attribute?: string }> = [],
106
118
  ) => {
107
119
  // Handle patient creation
108
120
  let patient: string = data.personB;
@@ -155,14 +167,12 @@ export const saveRelationship = async (
155
167
  if (data.mode === 'search' && extraAttributes.length > 0) {
156
168
  const results = await Promise.allSettled(
157
169
  extraAttributes.map((attr) =>
158
- openmrsFetch(`${restBaseUrl}/person/${patient}/attribute`, {
170
+ openmrsFetch(`${restBaseUrl}/person/${patient}/attribute/${attr.attribute ?? ''}`, {
159
171
  method: 'POST',
160
172
  headers: {
161
173
  'Content-Type': 'application/json',
162
174
  },
163
- body: JSON.stringify({
164
- attr,
165
- }),
175
+ body: JSON.stringify(omit(attr, ['attribute'])),
166
176
  }),
167
177
  ),
168
178
  );
@@ -4,7 +4,6 @@ import { useTranslation } from 'react-i18next';
4
4
  import styles from './relationships-tabs.scss';
5
5
  import ContactList from '../../contact-list/contact-list.component';
6
6
  import FamilyHistory from '../../family-partner-history/family-history.component';
7
- import { OtherRelationships } from '../../other-relationships/other-relationships.component';
8
7
 
9
8
  interface RelationshipsTabProps {
10
9
  patientUuid: string;
@@ -18,7 +17,6 @@ export const RelationshipsTab: React.FC<RelationshipsTabProps> = ({ patientUuid
18
17
  <TabList className={styles.relationshipTablist} aria-label="List tabs" contained>
19
18
  <Tab className={styles.relationshipTab}>{t('family', 'Family')}</Tab>
20
19
  <Tab className={styles.relationshipTab}>{t('pnsContacts', 'PNS Contacts')}</Tab>
21
- <Tab className={styles.relationshipTab}>{t('other', 'Other')}</Tab>
22
20
  </TabList>
23
21
  <TabPanels>
24
22
  <TabPanel>
@@ -27,9 +25,6 @@ export const RelationshipsTab: React.FC<RelationshipsTabProps> = ({ patientUuid
27
25
  <TabPanel>
28
26
  <ContactList patientUuid={patientUuid} />
29
27
  </TabPanel>
30
- <TabPanel>
31
- <OtherRelationships patientUuid={patientUuid} />
32
- </TabPanel>
33
28
  </TabPanels>
34
29
  </Tabs>
35
30
  </main>
package/src/routes.json CHANGED
@@ -18,14 +18,6 @@
18
18
  "online": true,
19
19
  "offline": false
20
20
  },
21
- {
22
- "name": "other-relationships",
23
- "slot": "patient-chart-family-history-slot",
24
- "component": "otherRelationships",
25
- "order": 0,
26
- "online": true,
27
- "offline": false
28
- },
29
21
  {
30
22
  "name": "relationships-link",
31
23
  "component": "relationshipsLink",
@@ -200,7 +192,6 @@
200
192
  {
201
193
  "component": "caseManagementDashboardLink",
202
194
  "name": "case-management-dashboard-link",
203
- "slot": "homepage-dashboard-slot",
204
195
  "meta": {
205
196
  "name": "case-management",
206
197
  "title": "Case Management",
@@ -261,7 +252,6 @@
261
252
  {
262
253
  "component": "peerCalendarDashboardLink",
263
254
  "name": "peer-calendar-dashboard-link",
264
- "slot": "homepage-dashboard-slot",
265
255
  "meta": {
266
256
  "name": "peer-calendar",
267
257
  "title": "Peer Calendar",
@@ -334,12 +324,6 @@
334
324
  "title": "Family Relationship Form",
335
325
  "type": "form"
336
326
  },
337
- {
338
- "name": "other-relationship-form",
339
- "component": "otherRelationshipsForm",
340
- "title": "Other Relationships Form",
341
- "type": "form"
342
- },
343
327
  {
344
328
  "name": "peers-form",
345
329
  "component": "peersForm",
@@ -23,6 +23,8 @@
23
23
  "autopsyReport": "Autopsy report",
24
24
  "babyGivenVitaminD": "Baby Given Vitamin K",
25
25
  "baselineHivStatus": "Baseline HIV Status",
26
+ "baselineInformation": "Baseline Information",
27
+ "baselineStatus": "HIV Status",
26
28
  "beds": "Beds",
27
29
  "billingHistory": "Billing history",
28
30
  "birthInjuriesTrauma": "Birth Injuries/Trauma",
@@ -42,7 +44,7 @@
42
44
  "contact": "Contact",
43
45
  "contactCreated": "Contact created",
44
46
  "contacted": "Contacted",
45
- "contactList": "Contact list",
47
+ "contactTracingForm": "Contact tracing form",
46
48
  "contactType": "Contact Type",
47
49
  "customViews": "In this section, you'll find custom clinical views tailored to patients' conditions and enrolled care programs.",
48
50
  "date": "Date",
@@ -107,6 +109,8 @@
107
109
  "inPatientView": "In Patient View",
108
110
  "inPatientVisitMessage": "in-patient encounter found for current {{visitType}} visit",
109
111
  "ipvOutcome": "IPV Outcome",
112
+ "ipvOutCome": "IPV Outcome",
113
+ "ipvQuestions": "IPV Questions",
110
114
  "labourAndDelivery": "Labour and Delivery",
111
115
  "listingDate": "Listing date",
112
116
  "livingWithClient": "Living with client",
@@ -127,12 +131,12 @@
127
131
  "neonatalSummary": "Neonatal Summary",
128
132
  "nextPage": "Next page",
129
133
  "nextVisitDate": "Next visit date",
134
+ "no": "No",
130
135
  "noContactToDisplay": "There is no contact data to display for this patient.",
131
136
  "noEncounters": "No encounters found",
132
137
  "noEncounterToDisplay": "There are no encounters to display for this patient.",
133
138
  "noObservationsFound": "No observations found",
134
139
  "operatingDoctor": "Operating Doctor",
135
- "otherRelationships": "Other Relationships",
136
140
  "otherSubstanceAbuse": "Other Substance Abuse",
137
141
  "partnerStatus": "HIV status of partner)",
138
142
  "partograph": "Partograph",
@@ -140,13 +144,16 @@
140
144
  "peerCalendar": "Peer Calendar",
141
145
  "pending": "Pending",
142
146
  "pendingDocumentations": "Pending Documentation",
147
+ "physicalAssault": "1. Has he/she ever hit, kicked, slapped, or otherwise physically hurt you?",
143
148
  "placeOfDelivery": "Place of Delivery",
144
149
  "pnsAproach": "PNS Aproach",
150
+ "pnsContactList": "PNS Contact list",
145
151
  "populationType": "Population type",
146
152
  "postnatalCare": "Postnatal Care",
147
153
  "postOperativeComplications": "Post Operative Complications",
148
154
  "postOperativeDiagnosis": "Post Operative Diagnosis",
149
155
  "pphCondition": "PPH present",
156
+ "preferedPNSAproach": "Prefered PNS Aproach",
150
157
  "previousPage": "Previous page",
151
158
  "primaryDiagnosis": "Primary Diagnosis",
152
159
  "priorityOfAdmission": "Priority Of Admission",
@@ -165,6 +172,7 @@
165
172
  "save": "Save",
166
173
  "savedRelationship": "Relationship ended successfully",
167
174
  "sex": "Sex",
175
+ "sexualAssault": "3.Has he/she ever forced you to do something sexually that made you feel uncomfortable?",
168
176
  "smoking": "Smoking",
169
177
  "smokingDuration": "Smoking Duration",
170
178
  "socialHistory": "Social History",
@@ -182,6 +190,7 @@
182
190
  "testingRecommended": "Testing recommended",
183
191
  "testStrategy": "Strategy",
184
192
  "therapiesPrescribed": "Therapies Prescribed",
193
+ "threatened": "2. Has he/she ever threatened to hurt you?",
185
194
  "timeRecorded": "Time Recorded",
186
195
  "total": "Total",
187
196
  "totalPeers": "Total Peers",
@@ -195,5 +204,6 @@
195
204
  "viewBeds": "View beds",
196
205
  "viewEncounter": "View",
197
206
  "visitDate": "Screening Date",
198
- "visitType": "Visit type"
207
+ "visitType": "Visit type",
208
+ "yes": "Yes"
199
209
  }