Skip to content

Commit

Permalink
Added questionnaire-unitOption extension support to numeric answers
Browse files Browse the repository at this point in the history
  • Loading branch information
sp-nazar committed May 26, 2023
1 parent 347bf1a commit 8711dbb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.9.0-dev.1
### Faiadashu
* Added displaying units in numeric answer input
* Added questionnaire-unitOption extension support to make ability choose quantity units in numeric answers

## 0.9.0-alpha.1
**[Breaking]** This alpha release is beginning to use Flutter 3.10.0 and fhir 0.11.0.
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.8.0"
version: "0.9.0-dev.1"
ffi:
dependency: transitive
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@ class NumericalAnswerModel extends AnswerModel<String, Quantity> {
},
context: qi.linkId,
);
} else {
final unitOptionUri = FhirUri(
'http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption',
);
qi.extension_
?.where((e) => e.url == unitOptionUri)
.map((e) => e.valueCoding)
.forEach((coding) {
if (coding != null) {
_units[keyForUnitChoice(coding)] = coding;
}
});
}
}

Expand Down

0 comments on commit 8711dbb

Please sign in to comment.