Skip to content

Pharmacy - Pharmaceuticals part 1#221

Draft
aldaprile wants to merge 48 commits intoinformatici:developfrom
aldaprile:develop
Draft

Pharmacy - Pharmaceuticals part 1#221
aldaprile wants to merge 48 commits intoinformatici:developfrom
aldaprile:develop

Conversation

@aldaprile
Copy link

No description provided.

aldaprile and others added 30 commits October 21, 2021 18:40
First implementation of

- Main Component showing pharmaceuticals
- Component for creating a new medical
* CSS changes in navigation menu in AppHeader component

* deleted commented code from AppHeader.tsx

* Delete package-lock.json
Creazione component EditMedical e correzione prima bozza dell'action relativa a updateMedical

Presenti issues in comunicazione con API per l'effettivo update, in attesa di meeting con ISF
Implementazione di Cancel in MedicalDataForm, adattamento del routing da Redirect a history.push
* Fix: Removed double column crit. level

* Add: Function to export table into .csv file

* Merge branch 'develop' into Omar Fork develop

Co-authored-by: OmarAvanade <omar.sobrino@avanade.com>
* Search bar UI: red icon, unified, outer outline.

* SearchIcon resizing

Co-authored-by: Natália Veras <natalia.veras.campos@avanade.com>
@tsognong
Copy link
Contributor

@aldaprile please is your pull request https://github.com/informatici/openhospital-ui/pull/221 reviewable? Please give me a response as soon as possible.
Also you should align your work with the actual develop branch.

<PrivateRoute path="/details/:id">
<PatientDetailsActivity />
</PrivateRoute>
<PrivateRoute path="/Pharmacy">
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the route path should start with lower case. In your case it should be "/pharmacy". Please apply that in the whole file.

<div className="medicalsGrid_main">
<Paper>
<TableContainer>
<Table aria-label="simple table" size="small">
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the custom table component in order to simplify the code. That path is here: \accessories\table\Table.tsx

};

//method to prepare .csv export
const csvDownload = (props: MedicalDTO[] | undefined): any => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please declare that function in libraries package in formatUtils directory, in order to simplify your code.


const infoBoxRef = useRef<HTMLDivElement>(null);

const initialValues : TValues = {critical: undefined, desc: undefined, nameSorted: undefined, type: undefined }
Copy link
Contributor

Choose a reason for hiding this comment

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

Please declare initialValues in a consts.ts file in order to simplify your code.

}
};

const [options, setOptions] = useState(medicalTypesOptions);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this state options and all its logic. The place where you use options instead use medicalTypesOptions directly and you will get the same result with few code.

}
};

const mapStateToProps = (state: IState): IStateProps => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to use hooks to handle the state logic. Please take a look on BillRecords for example to see how you can use hooks to handle your state logic. Also you should know that when you choose to use hooks to handle your state logic yoiu should not use mapStateToProps any more. Hooks are alternatives for that. I inivte you to apply that suggestion in all your components.

isValid={true}
errorText={""}
onBlur={onBlurSelect}
options={options || []}
Copy link
Contributor

Choose a reason for hiding this comment

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

Following the comment above you should use medicalTypesOptions variable here.

</div>
</div>
{/* Search bar */}
<form className="medicals__panel" onSubmit={formik.handleSubmit}>
Copy link
Contributor

Choose a reason for hiding this comment

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

According to me, we should keep things as simple as possible. Just add a filter form plus a filter button (or search button) in order to filter the table. Also I suggest to disjoint select field and textfield so one can add more filter item easily. What do you think? The filter form should be more expandable if we do that.

@axelpezzo
Copy link
Contributor

axelpezzo commented Jan 20, 2022

Hello guys, first of all thanks in advance for your work regarding the Pharmacy section. Let me introduce @almeida1492, @tsognong and me that we are the current dev team of this project.

I want to point out few things in order to make your code compliant with the Open Hospital standards.

In the past few weeks we reviewed your work and we point out some things that you should change, in particular:

  • when a Pull Request is not ready, you must marker it "as draft".
  • in order to make the code base clean and maintenable, you should use --when it's possibile-- the OH components already developed (eg. the Table component that @tsognong pointed out).
  • also, we use hook to the Redux logic. So, you should switch from the old logic to the new one. (you will find how to use this logic all around project).
  • before to change the navigation menu or the UI, we should discuss this before togheter. If you are developing a new section (e.g. Pharmacy content) you should keep the look & feel of the rest of the project (font, colors, indentation, spaces, components, and so on...).
  • also, keep in mind that this is a open source project with a team that is responsible to maintein and develop new features. So, when you submit a Pull Request of your work, this will be reviewd everytime. This is a best practice to keep the code secure and compliant. Be proactive when we'll review your code, in order to make this step as flexible as possibile.

Furthermore, I want to submit to you some giudeline references:

https://openhospital.atlassian.net/wiki/spaces/OH/pages/6946820/Contribution+Guidelines
https://oh2.open-hospital.org/oh20-developer-portal/

For any other suggestion we are at your disposal, just write here.

@mwithi
Copy link
Member

mwithi commented May 15, 2023

Hello all, has anyone in his/her hand this work? Is it possible to resume/continue it? Thanks!

@mwithi mwithi marked this pull request as draft July 5, 2023 23:12
@mwithi
Copy link
Member

mwithi commented Mar 12, 2026

@SteveGT96 I think this work will be replaced by a new one, am I right? If so, please close this PR. Thanks a lot!

@mwithi mwithi added the hold label Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants