Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(enhancement) Add ability to display poc forms only and filter out ht… #573

Merged
merged 2 commits into from
Feb 24, 2022

Conversation

makombe
Copy link
Contributor

@makombe makombe commented Feb 22, 2022

…ml forms

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
  • My work conforms to the OpenMRS 3.0 Styleguide.
  • I checked for feature overlap with existing widgets.

Summary

The PR introduces config to assist with filtering out POC forms(forms created through ampath form builder ) from html forms. When config is set you will only be able to fetch published poc forms.

Screenshots

None.

Issue

None.

Other

None.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 22, 2022

File size impact

Merging poc-form-config into master impact files as follow:

@openmrs/esm-form-entry-app (+8.02%)
Files new size
packages/esm-form-entry-app/dist/1.openmrs-esm-form-entry-app.js 1.48 MB (+109 kB / +7.92%) ↗️
packages/esm-form-entry-app/dist/openmrs-esm-form-entry-app.js 84.5 kB (+5.83 kB / +7.41%) ↗️
packages/esm-form-entry-app/dist/2.openmrs-esm-form-entry-app.js 46.5 kB (+5.21 kB / +12.59%) ↗️
Unmodified (1) 155 B (0 B / +0%) 👻
Total (4) 1.62 MB (+120 kB / +8.02%) ↗️
@openmrs/esm-generic-patient-widgets-app (no impact)
Files new size
Unmodified (14) 2.9 MB (0 B / +0%) 👻
Total (14) 2.9 MB (0 B / +0%) 👻
@openmrs/esm-patient-allergies-app (no impact)
Files new size
Unmodified (32) 2.57 MB (0 B / +0%) 👻
Total (32) 2.57 MB (0 B / +0%) 👻
@openmrs/esm-patient-appointments-app (no impact)
Files new size
Unmodified (24) 2.05 MB (0 B / +0%) 👻
Total (24) 2.05 MB (0 B / +0%) 👻
@openmrs/esm-patient-attachments-app (no impact)
Files new size
Unmodified (19) 1.6 MB (0 B / +0%) 👻
Total (19) 1.6 MB (0 B / +0%) 👻
@openmrs/esm-patient-banner-app (no impact)
Files new size
Unmodified (15) 992 kB (0 B / +0%) 👻
Total (15) 992 kB (0 B / +0%) 👻
@openmrs/esm-patient-biometrics-app (no impact)
Files new size
Unmodified (21) 2.53 MB (0 B / +0%) 👻
Total (21) 2.53 MB (0 B / +0%) 👻
@openmrs/esm-patient-chart-app (no impact)
Files new size
Unmodified (40) 3.58 MB (0 B / +0%) 👻
Total (40) 3.58 MB (0 B / +0%) 👻
@openmrs/esm-patient-clinical-view-app (no impact)
Files new size
Unmodified (18) 1.41 MB (0 B / +0%) 👻
Total (18) 1.41 MB (0 B / +0%) 👻
@openmrs/esm-patient-common-lib (no impact)

No file in @openmrs/esm-patient-common-lib group (see config below).

{
  "./packages/esm-patient-common-lib/dist/*.js": true,
  "./packages/esm-patient-common-lib/dist/*.css": true,
  "./packages/esm-patient-common-lib/dist/*.map": false,
  "./packages/esm-patient-common-lib/dist/*.txt": false,
  "./packages/esm-patient-common-lib/dist/*.json": false
}
@openmrs/esm-patient-conditions-app (no impact)
Files new size
Unmodified (25) 1.91 MB (0 B / +0%) 👻
Total (25) 1.91 MB (0 B / +0%) 👻
@openmrs/esm-patient-forms-app (+0.03%)
Files new size
packages/esm-patient-forms-app/dist/489.js 4.37 kB (+140 B / +3.31%) ↗️
packages/esm-patient-forms-app/dist/openmrs-esm-patient-forms-app.js 12.4 kB (+140 B / +1.14%) ↗️
packages/esm-patient-forms-app/dist/324.js 351 kB (+74 B / +0.02%) ↗️
packages/esm-patient-forms-app/dist/369.js 37.4 kB (+74 B / +0.2%) ↗️
packages/esm-patient-forms-app/dist/88.js 44.1 kB (+74 B / +0.17%) ↗️
Unmodified (19) 1.52 MB (0 B / +0%) 👻
Total (24) 1.97 MB (+502 B / +0.03%) ↗️
@openmrs/esm-patient-immunizations-app (no impact)
Files new size
Unmodified (21) 1.81 MB (0 B / +0%) 👻
Total (21) 1.81 MB (0 B / +0%) 👻
@openmrs/esm-patient-medications-app (no impact)
Files new size
Unmodified (19) 2.77 MB (0 B / +0%) 👻
Total (19) 2.77 MB (0 B / +0%) 👻
@openmrs/esm-patient-notes-app (no impact)
Files new size
Unmodified (24) 1.94 MB (0 B / +0%) 👻
Total (24) 1.94 MB (0 B / +0%) 👻
@openmrs/esm-patient-programs-app (no impact)
Files new size
Unmodified (21) 1.91 MB (0 B / +0%) 👻
Total (21) 1.91 MB (0 B / +0%) 👻
@openmrs/esm-patient-test-results-app (no impact)
Files new size
Unmodified (27) 3.92 MB (0 B / +0%) 👻
Total (27) 3.92 MB (0 B / +0%) 👻
@openmrs/esm-patient-vitals-app (no impact)
Files new size
Unmodified (25) 3.58 MB (0 B / +0%) 👻
Total (25) 3.58 MB (0 B / +0%) 👻
Generated by @jsenv/file-size-impact during Report bundle size#1892643008 on 05f15ae

@makombe makombe requested a review from brandones February 23, 2022 08:52
import { ListResponse, FormEncounter, EncounterWithFormRef, CompletedFormInfo } from '../types';
import { customEncounterRepresentation, formEncounterUrl } from '../constants';
import { isFormFullyCached } from '../offline-forms/offline-form-helpers';

export function useFormEncounters(cachedOfflineFormsOnly = false) {
return useSWR([formEncounterUrl, cachedOfflineFormsOnly], async () => {
const res = await openmrsFetch<ListResponse<FormEncounter>>(formEncounterUrl);
const config = useConfig();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: @brandones do we normally declare the config outside of a function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean by "declare the config." This all looks reasonable though. useConfig is a hook, so it's subject to the normal rules of hooks; since useFormEncounters is also a hook, this is usage is good.

@@ -61,6 +61,11 @@ export const configSchema = {
},
],
},
displayPOCForms: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, to my dismay, the term AMPATH Forms, has stucky. I think you are specifically referring her to AMPATH forms when using the term POC. Perhaps replace with AF for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my requested change above

@makombe
Copy link
Contributor Author

makombe commented Feb 24, 2022

@brandones Thanks for the review. Please look again I have effected the requested changes.

@brandones brandones merged commit 3f90ee0 into openmrs:master Feb 24, 2022
@brandones
Copy link
Contributor

Thanks @makombe !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants