Week2

WEEK 2:

Hello folks! Another week done and another batch of code written and merged !! In the coming sections I will be explaining the details of the work done this week.

LibreHealth

PROGRESS MADE THIS WEEK

In the previous week, I had implemented the checkin workflow in the react application. According to my plan in the proposal, this week was to be used to create components for the resources that will be used in the Appointment workflow.

the resources are:

  • Slot
  • Schedule
  • Appointment

In the beginning of the week, I started looking into the lit: upon which the components are based. I read the documentation and decided how to create the components so that they can be utilised for different CRUD operations.

I also noticed a few bugs in the components while implementing the checkin workflow, for this I created a MR and fixed them :





By wednesday I started creating the components. Most of these components have a reference or codeable-concept property datatype, hence creation of components that can be used in different contexts to implement the mentioned datatypes will help a lot.

By the end of wednesday I had created these datatype components :


Once these components were created, the resource components were not difficult to develop. By thursday I had created Slot-Schedule and by friday Appointment.

During this period my mentor noticed a few bugs in the project:

  • inconsistent label case use
  • unavailable demo files (build issue)

So along with the development of the components, I made a couple of commits for these issues as well.

Template used for component creation:

As a component will be used for CREATE / GET / PUT request , I made it compatible with everything.

For the create part, inside the constructor an initial empty skeleton value was provided. This value property would be overwritten if the component contains the value attribute. Hence this supports both the cases of create and get operations as a user can avoid the value attribute if the intention is to use the component for creating entries and provide a value after fetching a specific endpoint if the intent is to show entries.

Moreover even if a value property is provided and some of the keys are missing, the component will still remain the same as I have done a check for individual property existence and default value allocation as well, this feature will be helpful for the edit operation.

here is the default value property set inside the Appointment component constructor. Similar structure is used in the other 2 components.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
identifier: [{}],
status: '',
serviceCategory: [{coding: [{ system: "", code: "", display: ""}],text: ""}],
serviceType: [{coding: [{ system: "", code: "", display: ""}],text: ""}],
specialty: [{coding: [{ system: "", code: "", display: ""}],text: ""}],
appointmentType: {coding: [{ system: "", code: "", display: ""}],text: ""},
slot: [{reference: "", display: "", type: ""}],
comment: '',
start: moment().format('YYYY-MM-DDThh:mm:ss[Z]'),
end: moment().format('YYYY-MM-DDThh:mm:ss[Z]'),
participant: [{type: [{coding: [{ system: "", code: "", display: ""}],text: ""}], status: '', actor: {reference: "", display: "", type: ""}}]
}

here are the screenshots of the implemented components:

Appointment


Slot


Schedule


upcoming days:

  • write unit test for the components.

thanks for reading till the end ❤️ , see you next week 😄

Author

Shashwat

Posted on

2021-06-19

Updated on

2021-08-16

Licensed under