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

(feat) O3-4068 Add ability to preview clinical view configurations in… #10

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

CynthiaKamau
Copy link
Collaborator

… the patient chart

Requirements

  • This PR has a title that briefly describes the work done including a conventional commit type prefix and a Jira ticket number if applicable. See existing PR titles for inspiration.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.

Summary

Add ability to preview clinical view configurations in the patient chart

Screenshots

Screen.Recording.2024-10-09.at.14.49.36.mov

Related Issue

Other

@lucyjemutai
Copy link
Contributor

Thanks @CynthiaKamau ]

Looks Good.

Were these translation changes manually committed, or were they automatically added by Git?

@CynthiaKamau
Copy link
Collaborator Author

Thanks @CynthiaKamau ]

Looks Good.

Were these translation changes manually committed, or were they automatically added by Git?

They are added when i do commits

Copy link
Collaborator

@eudson eudson left a comment

Choose a reason for hiding this comment

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

Check the suggested changes for the renderingError and apply everywhere

@@ -56,10 +57,18 @@ const ContentPackagesEditorContent: React.FC<TranslationFnProps> = ({ t }) => {
}, []);

const renderSchemaChanges = useCallback(() => {
if (!stringifiedSchema) {
showSnackbar({
title: t('errorRendering', 'Error rendering'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
title: t('errorRendering', 'Error rendering'),
title: t('renderingError', 'Rendering Error'),

if (existingSchema) {
// If it exists, update the schema
localStorage.setItem(`packageJSON_${schema.id}`, JSON.stringify(schema));
localStorage.setItem(schemaId, JSON.stringify(schema));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would suggest you create a small function called updateSchema, you can use here and on line 174 and remove the comment on the line above. This is just for readability purposes, otherwise just remove the comment

@@ -180,6 +189,10 @@ const ContentPackagesEditorContent: React.FC<TranslationFnProps> = ({ t }) => {
}
};

const handlePreviewPackage = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const handlePreviewPackage = () => {
const handlePreviewClinicalView= () => {

@@ -180,6 +189,10 @@ const ContentPackagesEditorContent: React.FC<TranslationFnProps> = ({ t }) => {
}
};

const handlePreviewPackage = () => {
window.open(window.getOpenmrsSpaBase() + `patient/${patientUuid}/chart/Patient%20Summary`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not opening the entry point of the Clinical View?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The preview is on the patient chart, because there is no way to view the chart side nav from the builder, on the form engine its easier because the libraries main component can be easily exposed

export const configSchema = {
patientUuid: {
_type: Type.String,
_description: 'UUID for the stock item category',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Stock item?

@@ -42,6 +42,7 @@
"errorCreatingTabColumns": "Error creating tab columns",
"errorDeletingConfiguration": "Error deleting configuration",
"errorFindingSlotName": "የቦታ ስም አገኘበት",
"errorRendering": "Error rendering",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"errorRendering": "Error rendering",
"renderingError": "Rendering Error",

Copy link
Collaborator

@eudson eudson left a comment

Choose a reason for hiding this comment

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

LGTM

@eudson eudson merged commit 1184b57 into openmrs:main Oct 14, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants