-
Notifications
You must be signed in to change notification settings - Fork 249
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
Conversation
File size impactMerging poc-form-config into master impact files as follow: @openmrs/esm-form-entry-app (+8.02%)
@openmrs/esm-generic-patient-widgets-app (no impact)
@openmrs/esm-patient-allergies-app (no impact)
@openmrs/esm-patient-appointments-app (no impact)
@openmrs/esm-patient-attachments-app (no impact)
@openmrs/esm-patient-banner-app (no impact)
@openmrs/esm-patient-biometrics-app (no impact)
@openmrs/esm-patient-chart-app (no impact)
@openmrs/esm-patient-clinical-view-app (no impact)
@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)
@openmrs/esm-patient-forms-app (+0.03%)
@openmrs/esm-patient-immunizations-app (no impact)
@openmrs/esm-patient-medications-app (no impact)
@openmrs/esm-patient-notes-app (no impact)
@openmrs/esm-patient-programs-app (no impact)
@openmrs/esm-patient-test-results-app (no impact)
@openmrs/esm-patient-vitals-app (no impact)
|
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@brandones Thanks for the review. Please look again I have effected the requested changes. |
Thanks @makombe ! |
…ml forms
Requirements
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.