Skip to content

Conversation

@nikhil-ht-el
Copy link

Added the support for the Item Control grid extension.

package.json Outdated
"typescript": "~4.8.4",
"webpack-cli": "^4.10.0"
"webpack-cli": "^4.10.0",
"lodash": "^4.17.21"
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want to add another 70KB unless it's absolutely necessary. forEach and includes could be done without lodash.

import { LhcButtonPopoverComponent } from './lhc-button-popover/lhc-button-popover.component';
import { LhcItemAttachmentComponent } from './lhc-item-attachment/lhc-item-attachment.component';
import { LhcItemMessagesComponent } from './lhc-item-messages/lhc-item-messages.component';
import { LhcItemGirdComponent } from './lhc-item-gird/lhc-item-gird.component';
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename it to lhc-group-grid as it is similar to lhc-group-matrix.

Copy link
Contributor

@lhcye lhcye Jan 12, 2023

Choose a reason for hiding this comment

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

and LhcGroupGridComponent

@@ -0,0 +1,51 @@
<div *ngIf="item" class="lhc-layout-grid lf-table-item {{lhcDataService.getSiblingStatus(item)}}">
<div class="lf-form-grid-table-title" *ngIf="!formLevel">
Copy link
Contributor

Choose a reason for hiding this comment

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

The CSS class names starting with 'lf-' are legacy names used in the previous versions of lforms, and will be cleaned up eventually. Please use 'lhc-' when adding new CSS class names.

<table class="lf-form-grid-table lf-form-table">
<colgroup>
<col class="lf-question">
<col *ngFor="let answer of item.items[0].answers">
Copy link
Contributor

Choose a reason for hiding this comment

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

The number of columns should be from item.items, right? The "other-answer" is not needed. Your implementation looks similar to the "matrix" ("table in fhir itemControl). If that's what you need, "matrix" has been implemented in lforms.

There was discussion on chat.fhir.org (https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/Grid.20Question) that the items under each group are not necessary same. The grid could be sparse.

@plynchnlm plynchnlm self-requested a review January 12, 2023 16:15
@plynchnlm
Copy link
Contributor

plynchnlm commented Jan 12, 2023

Please add a small test Questionnaire and some tests. (But first see Ye's comment about about whether "grid" is what you need or not. Grid columns should not be from item answer lists. See https://build.fhir.org/valueset-questionnaire-item-control.html .)

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