@minvws/mgo-hcim-ui 0.1.1-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/LICENSE.md +7 -0
  2. package/README.md +78 -0
  3. package/dist/common/index.d.ts +7 -0
  4. package/dist/common/index.d.ts.map +1 -0
  5. package/dist/common/index.js +6 -0
  6. package/dist/common/organization/organization.d.ts +6 -0
  7. package/dist/common/organization/organization.d.ts.map +1 -0
  8. package/dist/common/organization/organization.js +7 -0
  9. package/dist/common/summaryOptions/summaryOptions.d.ts +8 -0
  10. package/dist/common/summaryOptions/summaryOptions.d.ts.map +1 -0
  11. package/dist/common/summaryOptions/summaryOptions.js +12 -0
  12. package/dist/context/formatLabel.d.ts +14 -0
  13. package/dist/context/formatLabel.d.ts.map +1 -0
  14. package/dist/context/formatLabel.js +61 -0
  15. package/dist/context/index.d.ts +14 -0
  16. package/dist/context/index.d.ts.map +1 -0
  17. package/dist/context/index.js +16 -0
  18. package/dist/format/date/date.d.ts +4 -0
  19. package/dist/format/date/date.d.ts.map +1 -0
  20. package/dist/format/date/date.js +44 -0
  21. package/dist/format/index.d.ts +6 -0
  22. package/dist/format/index.d.ts.map +1 -0
  23. package/dist/format/index.js +6 -0
  24. package/dist/format/system/system.d.ts +4 -0
  25. package/dist/format/system/system.d.ts.map +1 -0
  26. package/dist/format/system/system.js +21 -0
  27. package/dist/format/systemCode/systemCode.d.ts +4 -0
  28. package/dist/format/systemCode/systemCode.d.ts.map +1 -0
  29. package/dist/format/systemCode/systemCode.js +12 -0
  30. package/dist/format/systemValue/systemValue.d.ts +4 -0
  31. package/dist/format/systemValue/systemValue.d.ts.map +1 -0
  32. package/dist/format/systemValue/systemValue.js +16 -0
  33. package/dist/format/value/value.d.ts +4 -0
  34. package/dist/format/value/value.d.ts.map +1 -0
  35. package/dist/format/value/value.js +18 -0
  36. package/dist/generator/createGeneratorContext/createGeneratorContext.d.ts +12 -0
  37. package/dist/generator/createGeneratorContext/createGeneratorContext.d.ts.map +1 -0
  38. package/dist/generator/createGeneratorContext/createGeneratorContext.js +12 -0
  39. package/dist/generator/createUiElementHelper/createUiElementHelper.d.ts +6 -0
  40. package/dist/generator/createUiElementHelper/createUiElementHelper.d.ts.map +1 -0
  41. package/dist/generator/createUiElementHelper/createUiElementHelper.js +60 -0
  42. package/dist/generator/generateUiSchema/generateUiSchema.d.ts +5 -0
  43. package/dist/generator/generateUiSchema/generateUiSchema.d.ts.map +1 -0
  44. package/dist/generator/generateUiSchema/generateUiSchema.js +40 -0
  45. package/dist/generator/getProfileKey/getProfileKey.d.ts +3 -0
  46. package/dist/generator/getProfileKey/getProfileKey.d.ts.map +1 -0
  47. package/dist/generator/getProfileKey/getProfileKey.js +5 -0
  48. package/dist/generator/getUiElements/getUiElements.d.ts +3 -0
  49. package/dist/generator/getUiElements/getUiElements.d.ts.map +1 -0
  50. package/dist/generator/getUiElements/getUiElements.js +4 -0
  51. package/dist/generator/index.d.ts +2 -0
  52. package/dist/generator/index.d.ts.map +1 -0
  53. package/dist/generator/index.js +1 -0
  54. package/dist/generator/processArray/processArray.d.ts +4 -0
  55. package/dist/generator/processArray/processArray.d.ts.map +1 -0
  56. package/dist/generator/processArray/processArray.js +39 -0
  57. package/dist/generator/processMgoType/processMgoType.d.ts +5 -0
  58. package/dist/generator/processMgoType/processMgoType.d.ts.map +1 -0
  59. package/dist/generator/processMgoType/processMgoType.js +52 -0
  60. package/dist/generator/processObject/processObject.d.ts +4 -0
  61. package/dist/generator/processObject/processObject.d.ts.map +1 -0
  62. package/dist/generator/processObject/processObject.js +34 -0
  63. package/dist/generator/processValue/processValue.d.ts +5 -0
  64. package/dist/generator/processValue/processValue.d.ts.map +1 -0
  65. package/dist/generator/processValue/processValue.js +38 -0
  66. package/dist/helpers/dropEmptyEntries/dropEmptyEntries.d.ts +5 -0
  67. package/dist/helpers/dropEmptyEntries/dropEmptyEntries.d.ts.map +1 -0
  68. package/dist/helpers/dropEmptyEntries/dropEmptyEntries.js +28 -0
  69. package/dist/helpers/getChildren/getChildren.d.ts +4 -0
  70. package/dist/helpers/getChildren/getChildren.d.ts.map +1 -0
  71. package/dist/helpers/getChildren/getChildren.js +9 -0
  72. package/dist/helpers/hasExtensions/hasExtensions.d.ts +4 -0
  73. package/dist/helpers/hasExtensions/hasExtensions.d.ts.map +1 -0
  74. package/dist/helpers/hasExtensions/hasExtensions.js +23 -0
  75. package/dist/helpers/index.d.ts +8 -0
  76. package/dist/helpers/index.d.ts.map +1 -0
  77. package/dist/helpers/index.js +7 -0
  78. package/dist/helpers/isEmptyUiEntry/isEmptyUiEntry.d.ts +3 -0
  79. package/dist/helpers/isEmptyUiEntry/isEmptyUiEntry.d.ts.map +1 -0
  80. package/dist/helpers/isEmptyUiEntry/isEmptyUiEntry.js +18 -0
  81. package/dist/helpers/isUiEntry/isUiEntry.d.ts +5 -0
  82. package/dist/helpers/isUiEntry/isUiEntry.d.ts.map +1 -0
  83. package/dist/helpers/isUiEntry/isUiEntry.js +3 -0
  84. package/dist/helpers/isUiSchemaGroup/isUiSchemaGroup.d.ts +3 -0
  85. package/dist/helpers/isUiSchemaGroup/isUiSchemaGroup.d.ts.map +1 -0
  86. package/dist/helpers/isUiSchemaGroup/isUiSchemaGroup.js +3 -0
  87. package/dist/helpers/numberToString/numberToString.d.ts +3 -0
  88. package/dist/helpers/numberToString/numberToString.d.ts.map +1 -0
  89. package/dist/helpers/numberToString/numberToString.js +6 -0
  90. package/dist/helpers/setEmptyEntries/setEmptyEntries.d.ts +4 -0
  91. package/dist/helpers/setEmptyEntries/setEmptyEntries.d.ts.map +1 -0
  92. package/dist/helpers/setEmptyEntries/setEmptyEntries.js +31 -0
  93. package/dist/helpers/toString/toString.d.ts +3 -0
  94. package/dist/helpers/toString/toString.d.ts.map +1 -0
  95. package/dist/helpers/toString/toString.js +6 -0
  96. package/dist/helpers/valueOf/valueOf.d.ts +4 -0
  97. package/dist/helpers/valueOf/valueOf.d.ts.map +1 -0
  98. package/dist/helpers/valueOf/valueOf.js +11 -0
  99. package/dist/index.d.ts +9 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +8 -0
  102. package/dist/special/attachment/attachment.d.ts +4 -0
  103. package/dist/special/attachment/attachment.d.ts.map +1 -0
  104. package/dist/special/attachment/attachment.js +18 -0
  105. package/dist/special/index.d.ts +8 -0
  106. package/dist/special/index.d.ts.map +1 -0
  107. package/dist/special/index.js +12 -0
  108. package/dist/special/oneOfValueX/oneOfValueX.d.ts +6 -0
  109. package/dist/special/oneOfValueX/oneOfValueX.d.ts.map +1 -0
  110. package/dist/special/oneOfValueX/oneOfValueX.js +22 -0
  111. package/dist/special/valueWithMax/valueWithMax.d.ts +3 -0
  112. package/dist/special/valueWithMax/valueWithMax.d.ts.map +1 -0
  113. package/dist/special/valueWithMax/valueWithMax.js +8 -0
  114. package/dist/special/valueWithUnit/valueWithUnit.d.ts +4 -0
  115. package/dist/special/valueWithUnit/valueWithUnit.d.ts.map +1 -0
  116. package/dist/special/valueWithUnit/valueWithUnit.js +9 -0
  117. package/dist/type/annotation/annotation.d.ts +6 -0
  118. package/dist/type/annotation/annotation.d.ts.map +1 -0
  119. package/dist/type/annotation/annotation.js +18 -0
  120. package/dist/type/boolean/boolean.d.ts +4 -0
  121. package/dist/type/boolean/boolean.d.ts.map +1 -0
  122. package/dist/type/boolean/boolean.js +11 -0
  123. package/dist/type/code/code.d.ts +12 -0
  124. package/dist/type/code/code.d.ts.map +1 -0
  125. package/dist/type/code/code.js +31 -0
  126. package/dist/type/codeableConcept/codeableConcept.d.ts +4 -0
  127. package/dist/type/codeableConcept/codeableConcept.d.ts.map +1 -0
  128. package/dist/type/codeableConcept/codeableConcept.js +25 -0
  129. package/dist/type/coding/coding.d.ts +4 -0
  130. package/dist/type/coding/coding.d.ts.map +1 -0
  131. package/dist/type/coding/coding.js +18 -0
  132. package/dist/type/date/date.d.ts +4 -0
  133. package/dist/type/date/date.d.ts.map +1 -0
  134. package/dist/type/date/date.js +8 -0
  135. package/dist/type/dateTime/dateTime.d.ts +4 -0
  136. package/dist/type/dateTime/dateTime.d.ts.map +1 -0
  137. package/dist/type/dateTime/dateTime.js +19 -0
  138. package/dist/type/decimal/decimal.d.ts +4 -0
  139. package/dist/type/decimal/decimal.d.ts.map +1 -0
  140. package/dist/type/decimal/decimal.js +8 -0
  141. package/dist/type/duration/duration.d.ts +4 -0
  142. package/dist/type/duration/duration.d.ts.map +1 -0
  143. package/dist/type/duration/duration.js +2 -0
  144. package/dist/type/identifier/identifier.d.ts +5 -0
  145. package/dist/type/identifier/identifier.d.ts.map +1 -0
  146. package/dist/type/identifier/identifier.js +15 -0
  147. package/dist/type/index.d.ts +32 -0
  148. package/dist/type/index.d.ts.map +1 -0
  149. package/dist/type/index.js +54 -0
  150. package/dist/type/instant/instant.d.ts +4 -0
  151. package/dist/type/instant/instant.d.ts.map +1 -0
  152. package/dist/type/instant/instant.js +18 -0
  153. package/dist/type/integer/integer.d.ts +4 -0
  154. package/dist/type/integer/integer.d.ts.map +1 -0
  155. package/dist/type/integer/integer.js +8 -0
  156. package/dist/type/integer64/integer64.d.ts +4 -0
  157. package/dist/type/integer64/integer64.d.ts.map +1 -0
  158. package/dist/type/integer64/integer64.js +8 -0
  159. package/dist/type/period/period.d.ts +9 -0
  160. package/dist/type/period/period.d.ts.map +1 -0
  161. package/dist/type/period/period.js +19 -0
  162. package/dist/type/positiveInt/positiveInt.d.ts +4 -0
  163. package/dist/type/positiveInt/positiveInt.d.ts.map +1 -0
  164. package/dist/type/positiveInt/positiveInt.js +8 -0
  165. package/dist/type/quantity/quantity.d.ts +4 -0
  166. package/dist/type/quantity/quantity.d.ts.map +1 -0
  167. package/dist/type/quantity/quantity.js +9 -0
  168. package/dist/type/range/range.d.ts +9 -0
  169. package/dist/type/range/range.d.ts.map +1 -0
  170. package/dist/type/range/range.js +19 -0
  171. package/dist/type/ratio/ratio.d.ts +9 -0
  172. package/dist/type/ratio/ratio.d.ts.map +1 -0
  173. package/dist/type/ratio/ratio.js +19 -0
  174. package/dist/type/reference/reference.d.ts +4 -0
  175. package/dist/type/reference/reference.d.ts.map +1 -0
  176. package/dist/type/reference/reference.js +23 -0
  177. package/dist/type/sampledData/sampledData.d.ts +4 -0
  178. package/dist/type/sampledData/sampledData.d.ts.map +1 -0
  179. package/dist/type/sampledData/sampledData.js +37 -0
  180. package/dist/type/simpleQuantity/simpleQuantity.d.ts +4 -0
  181. package/dist/type/simpleQuantity/simpleQuantity.d.ts.map +1 -0
  182. package/dist/type/simpleQuantity/simpleQuantity.js +9 -0
  183. package/dist/type/string/string.d.ts +4 -0
  184. package/dist/type/string/string.d.ts.map +1 -0
  185. package/dist/type/string/string.js +16 -0
  186. package/dist/type/time/time.d.ts +4 -0
  187. package/dist/type/time/time.d.ts.map +1 -0
  188. package/dist/type/time/time.js +17 -0
  189. package/dist/type/timing/timing.d.ts +4 -0
  190. package/dist/type/timing/timing.d.ts.map +1 -0
  191. package/dist/type/timing/timing.js +65 -0
  192. package/dist/type/unsignedInt/unsignedInt.d.ts +4 -0
  193. package/dist/type/unsignedInt/unsignedInt.d.ts.map +1 -0
  194. package/dist/type/unsignedInt/unsignedInt.js +9 -0
  195. package/dist/types/context.d.ts +22 -0
  196. package/dist/types/context.d.ts.map +1 -0
  197. package/dist/types/context.js +1 -0
  198. package/dist/types/index.d.ts +3 -0
  199. package/dist/types/index.d.ts.map +1 -0
  200. package/dist/types/index.js +3 -0
  201. package/dist/types/schema.d.ts +39 -0
  202. package/dist/types/schema.d.ts.map +1 -0
  203. package/dist/types/schema.js +1 -0
  204. package/dist/ui.d.ts +40 -0
  205. package/dist/ui.d.ts.map +1 -0
  206. package/dist/ui.js +12 -0
  207. package/health-ui-schema.png +0 -0
  208. package/package.json +37 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/type/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,KAAK,aAAa,EAAkB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA2BxF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4B1C"}
@@ -0,0 +1,54 @@
1
+ import { annotation } from './annotation/annotation.js';
2
+ import { boolean } from './boolean/boolean.js';
3
+ import { code } from './code/code.js';
4
+ import { codeableConcept } from './codeableConcept/codeableConcept.js';
5
+ import { coding } from './coding/coding.js';
6
+ import { date } from './date/date.js';
7
+ import { dateTime } from './dateTime/dateTime.js';
8
+ import { decimal } from './decimal/decimal.js';
9
+ import { duration } from './duration/duration.js';
10
+ import { identifier } from './identifier/identifier.js';
11
+ import { instant } from './instant/instant.js';
12
+ import { integer } from './integer/integer.js';
13
+ import { integer64 } from './integer64/integer64.js';
14
+ import { period } from './period/period.js';
15
+ import { positiveInt } from './positiveInt/positiveInt.js';
16
+ import { quantity } from './quantity/quantity.js';
17
+ import { range } from './range/range.js';
18
+ import { ratio } from './ratio/ratio.js';
19
+ import { reference } from './reference/reference.js';
20
+ import { sampledData } from './sampledData/sampledData.js';
21
+ import { simpleQuantity } from './simpleQuantity/simpleQuantity.js';
22
+ import { string } from './string/string.js';
23
+ import { time } from './time/time.js';
24
+ import { timing } from './timing/timing.js';
25
+ import { unsignedInt } from './unsignedInt/unsignedInt.js';
26
+ export function getTypes(context) {
27
+ return {
28
+ annotation: annotation(context),
29
+ boolean: boolean(context),
30
+ code: code(context),
31
+ codeableConcept: codeableConcept(context),
32
+ coding: coding(context),
33
+ date: date(context),
34
+ dateTime: dateTime(context),
35
+ instant: instant(context),
36
+ duration: duration(context),
37
+ identifier: identifier(context),
38
+ period: period(context),
39
+ quantity: quantity(context),
40
+ range: range(context),
41
+ ratio: ratio(context),
42
+ reference: reference(context),
43
+ string: string(context),
44
+ decimal: decimal(context),
45
+ integer: integer(context),
46
+ integer64: integer64(context),
47
+ unsignedInt: unsignedInt(context),
48
+ positiveInt: positiveInt(context),
49
+ time: time(context),
50
+ simpleQuantity: simpleQuantity(context),
51
+ sampledData: sampledData(context),
52
+ timing: timing(context),
53
+ }; // eslint-disable-line @typescript-eslint/no-explicit-any
54
+ }
@@ -0,0 +1,4 @@
1
+ import { type MgoInstant } from '@minvws/mgo-hcim-parse';
2
+ import { type MultipleValues, type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const instant: WithUiContext<UiFunction<MgoInstant | MgoInstant[], SingleValue | MultipleValues>>;
4
+ //# sourceMappingURL=instant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instant.d.ts","sourceRoot":"","sources":["../../../src/type/instant/instant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,OAAO,EAAE,aAAa,CAC/B,UAAU,CAAC,UAAU,GAAG,UAAU,EAAE,EAAE,WAAW,GAAG,cAAc,CAAC,CAoBlE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ import { date } from '../../format/date/date.js';
3
+ export const instant = (context) => (label, value, options = {}) => {
4
+ const formatDate = date(context);
5
+ const { formatLabel } = context;
6
+ if (Array.isArray(value)) {
7
+ return {
8
+ label: formatLabel(label, value, options.defaultLabel),
9
+ type: 'MULTIPLE_VALUES',
10
+ display: value.map((x) => formatDate(x.value)).filter(isNonNullish),
11
+ };
12
+ }
13
+ return {
14
+ label: formatLabel(label, value, options.defaultLabel),
15
+ type: 'SINGLE_VALUE',
16
+ display: formatDate(value?.value),
17
+ };
18
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoInteger } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const integer: WithUiContext<UiFunction<MgoInteger, SingleValue>>;
4
+ //# sourceMappingURL=integer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../src/type/integer/integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,UAAU,EAAE,WAAW,CAAC,CAQlE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { numberToString } from '../../helpers/index.js';
2
+ export const integer = ({ formatLabel }) => (label, value, options = {}) => {
3
+ return {
4
+ label: formatLabel(label, value, options.defaultLabel),
5
+ type: 'SINGLE_VALUE',
6
+ display: numberToString(value?.value),
7
+ };
8
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoInteger64 } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const integer64: WithUiContext<UiFunction<MgoInteger64, SingleValue>>;
4
+ //# sourceMappingURL=integer64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../../src/type/integer64/integer64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,SAAS,EAAE,aAAa,CAAC,UAAU,CAAC,YAAY,EAAE,WAAW,CAAC,CAQtE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { numberToString } from '../../helpers/index.js';
2
+ export const integer64 = ({ formatLabel }) => (label, value, options = {}) => {
3
+ return {
4
+ label: formatLabel(label, value, options.defaultLabel),
5
+ type: 'SINGLE_VALUE',
6
+ display: numberToString(value?.value),
7
+ };
8
+ };
@@ -0,0 +1,9 @@
1
+ import { type MgoPeriod } from '@minvws/mgo-hcim-parse';
2
+ import { type FhirMessagesIds } from '@minvws/mgo-intl';
3
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
4
+ type HasStartLabel = Extract<FhirMessagesIds, `${string}.start`> extends `${infer R}.start` ? R : never;
5
+ type HasEndLabel = Extract<FhirMessagesIds, `${string}.end`> extends `${infer R}.end` ? R : never;
6
+ type PeriodLabel = HasStartLabel | HasEndLabel;
7
+ export declare const period: WithUiContext<UiFunction<MgoPeriod, SingleValue[], FhirMessagesIds | PeriodLabel>>;
8
+ export {};
9
+ //# sourceMappingURL=period.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"period.d.ts","sourceRoot":"","sources":["../../../src/type/period/period.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,KAAK,aAAa,GACd,OAAO,CAAC,eAAe,EAAE,GAAG,MAAM,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC;AACvF,KAAK,WAAW,GAAG,OAAO,CAAC,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC;AAClG,KAAK,WAAW,GAAG,aAAa,GAAG,WAAW,CAAC;AAE/C,eAAO,MAAM,MAAM,EAAE,aAAa,CAC9B,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,eAAe,GAAG,WAAW,CAAC,CAoBtE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { date } from '../../format/date/date.js';
2
+ export const period = (context) => (label, value) => {
3
+ const { formatLabel } = context;
4
+ const startLabel = `${label}.start`;
5
+ const endLabel = `${label}.end`;
6
+ const formatDate = date(context);
7
+ return [
8
+ {
9
+ label: formatLabel(startLabel, value, `fhir.period.start`),
10
+ type: `SINGLE_VALUE`,
11
+ display: formatDate(value?.start),
12
+ },
13
+ {
14
+ label: formatLabel(endLabel, value, `fhir.period.end`),
15
+ type: `SINGLE_VALUE`,
16
+ display: formatDate(value?.end),
17
+ },
18
+ ];
19
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoPositiveInt } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const positiveInt: WithUiContext<UiFunction<MgoPositiveInt, SingleValue>>;
4
+ //# sourceMappingURL=positiveInt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positiveInt.d.ts","sourceRoot":"","sources":["../../../src/type/positiveInt/positiveInt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,cAAc,EAAE,WAAW,CAAC,CAQ1E,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { numberToString } from '../../helpers/index.js';
2
+ export const positiveInt = ({ formatLabel }) => (label, value, options = {}) => {
3
+ return {
4
+ label: formatLabel(label, value, options.defaultLabel),
5
+ type: 'SINGLE_VALUE',
6
+ display: numberToString(value?.value),
7
+ };
8
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoDuration, type MgoQuantity } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const quantity: WithUiContext<UiFunction<MgoQuantity | MgoDuration, SingleValue>>;
4
+ //# sourceMappingURL=quantity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quantity.d.ts","sourceRoot":"","sources":["../../../src/type/quantity/quantity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,WAAW,GAAG,WAAW,EAAE,WAAW,CAAC,CAUlF,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { systemValue } from '../../format/systemValue/systemValue.js';
2
+ export const quantity = (context) => (label, value, options = {}) => {
3
+ const { formatLabel } = context;
4
+ return {
5
+ label: formatLabel(label, value, options.defaultLabel),
6
+ type: `SINGLE_VALUE`,
7
+ display: systemValue(context)(value),
8
+ };
9
+ };
@@ -0,0 +1,9 @@
1
+ import { type MgoRange } from '@minvws/mgo-hcim-parse';
2
+ import { type FhirMessagesIds } from '@minvws/mgo-intl';
3
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
4
+ type HasLowLabel = Extract<FhirMessagesIds, `${string}.low`> extends `${infer R}.low` ? R : never;
5
+ type HasHighLabel = Extract<FhirMessagesIds, `${string}.high`> extends `${infer R}.high` ? R : never;
6
+ type RangeLabel = HasLowLabel | HasHighLabel;
7
+ export declare const range: WithUiContext<UiFunction<MgoRange, SingleValue[], FhirMessagesIds | RangeLabel>>;
8
+ export {};
9
+ //# sourceMappingURL=range.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../src/type/range/range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,KAAK,WAAW,GAAG,OAAO,CAAC,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC;AAClG,KAAK,YAAY,GACb,OAAO,CAAC,eAAe,EAAE,GAAG,MAAM,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC;AACrF,KAAK,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;AAE7C,eAAO,MAAM,KAAK,EAAE,aAAa,CAC7B,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,eAAe,GAAG,UAAU,CAAC,CAmBpE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { systemValue } from '../../format/systemValue/systemValue.js';
2
+ export const range = (context) => (label, value) => {
3
+ const { formatLabel } = context;
4
+ const lowLabel = `${label}.low`;
5
+ const highLabel = `${label}.high`;
6
+ const formatSystemValue = systemValue(context);
7
+ return [
8
+ {
9
+ label: formatLabel(lowLabel, value, `fhir.range.low`),
10
+ type: `SINGLE_VALUE`,
11
+ display: formatSystemValue(value?.low),
12
+ },
13
+ {
14
+ label: formatLabel(highLabel, value, `fhir.range.high`),
15
+ type: `SINGLE_VALUE`,
16
+ display: formatSystemValue(value?.high),
17
+ },
18
+ ];
19
+ };
@@ -0,0 +1,9 @@
1
+ import { type MgoRatio } from '@minvws/mgo-hcim-parse';
2
+ import { type FhirMessagesIds } from '@minvws/mgo-intl';
3
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
4
+ type HasNumeratorLabel = Extract<FhirMessagesIds, `${string}.numerator`> extends `${infer R}.numerator` ? R : never;
5
+ type HasDenominatorLabel = Extract<FhirMessagesIds, `${string}.denominator`> extends `${infer R}.denominator` ? R : never;
6
+ type RatioLabel = HasNumeratorLabel | HasDenominatorLabel;
7
+ export declare const ratio: WithUiContext<UiFunction<MgoRatio, SingleValue[], FhirMessagesIds | RatioLabel>>;
8
+ export {};
9
+ //# sourceMappingURL=ratio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ratio.d.ts","sourceRoot":"","sources":["../../../src/type/ratio/ratio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,KAAK,iBAAiB,GAClB,OAAO,CAAC,eAAe,EAAE,GAAG,MAAM,YAAY,CAAC,SAAS,GAAG,MAAM,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,CAAC;AAC/F,KAAK,mBAAmB,GACpB,OAAO,CAAC,eAAe,EAAE,GAAG,MAAM,cAAc,CAAC,SAAS,GAAG,MAAM,CAAC,cAAc,GAAG,CAAC,GAAG,KAAK,CAAC;AACnG,KAAK,UAAU,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;AAE1D,eAAO,MAAM,KAAK,EAAE,aAAa,CAC7B,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,eAAe,GAAG,UAAU,CAAC,CAmBpE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { systemValue } from '../../format/systemValue/systemValue.js';
2
+ export const ratio = (context) => (label, value) => {
3
+ const { formatLabel } = context;
4
+ const numeratorLabel = `${label}.numerator`;
5
+ const denominatorLabel = `${label}.denominator`;
6
+ const formatSystemValue = systemValue(context);
7
+ return [
8
+ {
9
+ label: formatLabel(numeratorLabel, value, `fhir.ratio.numerator`),
10
+ type: `SINGLE_VALUE`,
11
+ display: formatSystemValue(value?.numerator),
12
+ },
13
+ {
14
+ label: formatLabel(denominatorLabel, value, `fhir.ratio.denominator`),
15
+ type: `SINGLE_VALUE`,
16
+ display: formatSystemValue(value?.denominator),
17
+ },
18
+ ];
19
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoReference } from '@minvws/mgo-hcim-parse';
2
+ import { type MultipleValues, type ReferenceValue, type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const reference: WithUiContext<UiFunction<MgoReference | MgoReference[], SingleValue | ReferenceValue | MultipleValues>>;
4
+ //# sourceMappingURL=reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/type/reference/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,SAAS,EAAE,aAAa,CACjC,UAAU,CAAC,YAAY,GAAG,YAAY,EAAE,EAAE,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC,CA0BvF,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ export const reference = ({ formatLabel, isSummary }) => (label, value, options = {}) => {
3
+ if (Array.isArray(value)) {
4
+ return {
5
+ label: formatLabel(label, value, options.defaultLabel),
6
+ type: 'MULTIPLE_VALUES',
7
+ display: value.map((x) => x.display).filter(isNonNullish),
8
+ };
9
+ }
10
+ if (isSummary) {
11
+ return {
12
+ label: formatLabel(label, value, options.defaultLabel),
13
+ type: 'SINGLE_VALUE',
14
+ display: value?.display,
15
+ };
16
+ }
17
+ return {
18
+ label: formatLabel(label, value, options.defaultLabel),
19
+ type: 'REFERENCE_VALUE',
20
+ display: value?.display,
21
+ reference: value?.reference,
22
+ };
23
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoSampledData } from '@minvws/mgo-hcim-parse';
2
+ import { type HealthUiGroup, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const sampledData: WithUiContext<UiFunction<MgoSampledData, HealthUiGroup>>;
4
+ //# sourceMappingURL=sampledData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sampledData.d.ts","sourceRoot":"","sources":["../../../src/type/sampledData/sampledData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAM/F,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,cAAc,EAAE,aAAa,CAAC,CAkC5E,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { decimal } from '../decimal/decimal.js';
2
+ import { positiveInt } from '../positiveInt/positiveInt.js';
3
+ import { simpleQuantity } from '../simpleQuantity/simpleQuantity.js';
4
+ import { string } from '../string/string.js';
5
+ export const sampledData = (context) => (label, value) => {
6
+ const { formatLabel } = context;
7
+ const formatSimpleQuantity = simpleQuantity(context);
8
+ const formatDecimal = decimal(context);
9
+ const formatPositiveInt = positiveInt(context);
10
+ const formatString = string(context);
11
+ return {
12
+ label: formatLabel(label, null, 'fhir.sample_data'),
13
+ children: [
14
+ formatSimpleQuantity(`${label}.origin`, value?.origin, {
15
+ defaultLabel: 'fhir.sample_data.origin',
16
+ }),
17
+ formatDecimal(`${label}.period`, value?.period, {
18
+ defaultLabel: 'fhir.sample_data.period',
19
+ }),
20
+ formatDecimal(`${label}.factor`, value?.factor, {
21
+ defaultLabel: 'fhir.sample_data.factor',
22
+ }),
23
+ formatDecimal(`${label}.lower_limit`, value?.lowerLimit, {
24
+ defaultLabel: 'fhir.sample_data.lower_limit',
25
+ }),
26
+ formatDecimal(`${label}.upper_limit`, value?.upperLimit, {
27
+ defaultLabel: 'fhir.sample_data.upper_limit',
28
+ }),
29
+ formatPositiveInt(`${label}.dimensions`, value?.dimensions, {
30
+ defaultLabel: 'fhir.sample_data.dimensions',
31
+ }),
32
+ formatString(`${label}.data`, value?.data, {
33
+ defaultLabel: 'fhir.sample_data.data',
34
+ }),
35
+ ],
36
+ };
37
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoSimpleQuantity } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const simpleQuantity: WithUiContext<UiFunction<MgoSimpleQuantity, SingleValue>>;
4
+ //# sourceMappingURL=simpleQuantity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleQuantity.d.ts","sourceRoot":"","sources":["../../../src/type/simpleQuantity/simpleQuantity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,UAAU,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAUhF,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { systemValue } from '../../format/systemValue/systemValue.js';
2
+ export const simpleQuantity = (context) => (label, value, options = {}) => {
3
+ const { formatLabel } = context;
4
+ return {
5
+ label: formatLabel(label, value, options.defaultLabel),
6
+ type: `SINGLE_VALUE`,
7
+ display: systemValue(context)(value),
8
+ };
9
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoString } from '@minvws/mgo-hcim-parse';
2
+ import { type MultipleValues, type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const string: WithUiContext<UiFunction<MgoString | MgoString[], SingleValue | MultipleValues>>;
4
+ //# sourceMappingURL=string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/type/string/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,MAAM,EAAE,aAAa,CAC9B,UAAU,CAAC,SAAS,GAAG,SAAS,EAAE,EAAE,WAAW,GAAG,cAAc,CAAC,CAiBhE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ import { valueOf } from '../../helpers/valueOf/valueOf.js';
3
+ export const string = ({ formatLabel }) => (label, value, options = {}) => {
4
+ if (Array.isArray(value)) {
5
+ return {
6
+ label: formatLabel(label, value, options.defaultLabel),
7
+ type: 'MULTIPLE_VALUES',
8
+ display: value.map((x) => valueOf(x)).filter(isNonNullish),
9
+ };
10
+ }
11
+ return {
12
+ label: formatLabel(label, value, options.defaultLabel),
13
+ type: 'SINGLE_VALUE',
14
+ display: valueOf(value),
15
+ };
16
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoTime } from '@minvws/mgo-hcim-parse';
2
+ import { type MultipleValues, type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const time: WithUiContext<UiFunction<MgoTime | MgoTime[], SingleValue | MultipleValues>>;
4
+ //# sourceMappingURL=time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../src/type/time/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,IAAI,EAAE,aAAa,CAAC,UAAU,CAAC,OAAO,GAAG,OAAO,EAAE,EAAE,WAAW,GAAG,cAAc,CAAC,CAkBzF,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ import { valueOf } from '../../helpers/valueOf/valueOf.js';
3
+ export const time = (context) => (label, value, options = {}) => {
4
+ const { formatLabel } = context;
5
+ if (Array.isArray(value)) {
6
+ return {
7
+ label: formatLabel(label, value, options.defaultLabel),
8
+ type: 'MULTIPLE_VALUES',
9
+ display: value.map(valueOf).filter(isNonNullish),
10
+ };
11
+ }
12
+ return {
13
+ label: formatLabel(label, value, options.defaultLabel),
14
+ type: 'SINGLE_VALUE',
15
+ display: valueOf(value),
16
+ };
17
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoTiming } from '@minvws/mgo-hcim-parse';
2
+ import { type HealthUiGroup, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const timing: WithUiContext<UiFunction<MgoTiming, HealthUiGroup>>;
4
+ //# sourceMappingURL=timing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../../src/type/timing/timing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAQ/F,eAAO,MAAM,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,SAAS,EAAE,aAAa,CAAC,CAyFlE,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { codeableConcept } from '../codeableConcept/codeableConcept.js';
2
+ import { dateTime } from '../dateTime/dateTime.js';
3
+ import { decimal } from '../decimal/decimal.js';
4
+ import { integer } from '../integer/integer.js';
5
+ import { string } from '../string/string.js';
6
+ import { unsignedInt } from '../unsignedInt/unsignedInt.js';
7
+ export const timing = (context) => (label, value) => {
8
+ const { formatLabel } = context;
9
+ const uiCodeableConcept = codeableConcept(context);
10
+ const uiDateTime = dateTime(context);
11
+ const uiDecimal = decimal(context);
12
+ const uiInteger = integer(context);
13
+ const uiString = string(context);
14
+ const uiUnsignedInt = unsignedInt(context);
15
+ return {
16
+ label: formatLabel(label, null, 'fhir.timing'),
17
+ children: [
18
+ uiCodeableConcept(`${label}.code`, value?.code, {
19
+ defaultLabel: 'fhir.timing.code',
20
+ }),
21
+ uiDateTime(`${label}.event`, value?.event, {
22
+ defaultLabel: 'fhir.timing.event',
23
+ }),
24
+ uiDecimal(`${label}.repeat.duration`, value?.repeat?.duration, {
25
+ defaultLabel: 'fhir.timing.repeat.duration',
26
+ }),
27
+ uiInteger(`${label}.repeat.count`, value?.repeat?.count, {
28
+ defaultLabel: 'fhir.timing.repeat.count',
29
+ }),
30
+ uiInteger(`${label}.repeat.frequency`, value?.repeat?.frequency, {
31
+ defaultLabel: 'fhir.timing.repeat.frequency',
32
+ }),
33
+ uiDecimal(`${label}.repeat.period`, value?.repeat?.period, {
34
+ defaultLabel: 'fhir.timing.repeat.period',
35
+ }),
36
+ uiInteger(`${label}.repeat.countMax`, value?.repeat?.countMax, {
37
+ defaultLabel: 'fhir.timing.repeat.count_max',
38
+ }),
39
+ uiInteger(`${label}.repeat.frequency_max`, value?.repeat?.frequencyMax, {
40
+ defaultLabel: 'fhir.timing.repeat.frequency_max',
41
+ }),
42
+ uiDecimal(`${label}.repeat.period_max`, value?.repeat?.periodMax, {
43
+ defaultLabel: 'fhir.timing.repeat.period_max',
44
+ }),
45
+ uiString(`${label}.repeat.duration_unit`, value?.repeat?.durationUnit, {
46
+ defaultLabel: 'fhir.timing.repeat.duration_unit',
47
+ }),
48
+ uiString(`${label}.repeat.period_unit`, value?.repeat?.periodUnit, {
49
+ defaultLabel: 'fhir.timing.repeat.period_unit',
50
+ }),
51
+ uiString(`${label}.repeat.day_of_week`, value?.repeat?.dayOfWeek, {
52
+ defaultLabel: 'fhir.timing.repeat.day_of_week',
53
+ }),
54
+ uiString(`${label}.repeat.time_of_day`, value?.repeat?.timeOfDay, {
55
+ defaultLabel: 'fhir.timing.repeat.time_of_day',
56
+ }),
57
+ uiString(`${label}.repeat.when`, value?.repeat?.when, {
58
+ defaultLabel: 'fhir.timing.repeat.when',
59
+ }),
60
+ uiUnsignedInt(`${label}.repeat.offset`, value?.repeat?.offset, {
61
+ defaultLabel: 'fhir.timing.repeat.offset',
62
+ }),
63
+ ],
64
+ };
65
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoUnsignedInt } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const unsignedInt: WithUiContext<UiFunction<MgoUnsignedInt, SingleValue>>;
4
+ //# sourceMappingURL=unsignedInt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsignedInt.d.ts","sourceRoot":"","sources":["../../../src/type/unsignedInt/unsignedInt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,cAAc,EAAE,WAAW,CAAC,CAQ1E,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { numberToString } from '../../helpers/index.js';
2
+ import { valueOf } from '../../helpers/valueOf/valueOf.js';
3
+ export const unsignedInt = ({ formatLabel }) => (label, value, options = {}) => {
4
+ return {
5
+ label: formatLabel(label, value, options.defaultLabel),
6
+ type: 'SINGLE_VALUE',
7
+ display: numberToString(valueOf(value)),
8
+ };
9
+ };
@@ -0,0 +1,22 @@
1
+ import { type MgoResourceMeta, type ValueType } from '@minvws/mgo-hcim-parse';
2
+ import { type FhirMessagesIds } from '@minvws/mgo-intl';
3
+ import { type Lossless, type Nullable } from '@minvws/mgo-utils';
4
+ import { type UiContext } from '../context/index.js';
5
+ import { type UiHelpers } from '../ui.js';
6
+ import { type HealthUiGroup, type HealthUiSchema, type UiElement } from './schema.js';
7
+ export type WithUiContext<T> = (context: UiContext) => T;
8
+ export type FormatFunction<Input, Output extends string | string[] = string> = (value: Nullable<Input | Lossless<Input>>) => Output | undefined;
9
+ export type FormatDisplayFunction<Input, Output extends string[] | string | undefined = string> = (value: Nullable<Input | Lossless<Input>>) => Output;
10
+ export type UiFunctionOptions = {
11
+ defaultLabel?: FhirMessagesIds;
12
+ };
13
+ export type UiFunction<Input extends ValueType | ValueType[], Output extends UiElement | UiElement[] | HealthUiGroup, Label = FhirMessagesIds, Options extends UiFunctionOptions = UiFunctionOptions> = (label: Label, value: Nullable<Input>, options?: Options) => Output;
14
+ export type UiFunctionWithoutLabel<Input, Output extends UiElement | UiElement[]> = (value: Nullable<Input>) => Output;
15
+ export type CombinedUiFunction<Input1, Input2, Output extends UiElement | UiElement[]> = (label: FhirMessagesIds, value1: Nullable<Input1>, value2: Nullable<Input2>) => Output;
16
+ export type HealthUiSchemaFunction<T extends MgoResourceMeta, Context> = (parsedResource: T, context: Context) => HealthUiSchema;
17
+ export type HealthUiGroupFunction<ParsedResource extends object, G extends HealthUiGroup | HealthUiGroup[], Context> = (parsedResource: ParsedResource, context: Context) => G;
18
+ export type NonStrictLabel<T> = T extends (a: FhirMessagesIds, ...args: infer U) => infer R ? (a: FhirMessagesIds | string, ...args: U) => R : T;
19
+ export type NonStrictUi = {
20
+ [K in keyof UiHelpers]: NonStrictLabel<UiHelpers[K]>;
21
+ };
22
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtF,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,KAAK,CAAC,CAAC;AAEzD,MAAM,MAAM,cAAc,CAAC,KAAK,EAAE,MAAM,SAAS,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,IAAI,CAC3E,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,KACvC,MAAM,GAAG,SAAS,CAAC;AAExB,MAAM,MAAM,qBAAqB,CAAC,KAAK,EAAE,MAAM,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,IAAI,CAC9F,KAAK,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,KACvC,MAAM,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG;IAC5B,YAAY,CAAC,EAAE,eAAe,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,UAAU,CAClB,KAAK,SAAS,SAAS,GAAG,SAAS,EAAE,EACrC,MAAM,SAAS,SAAS,GAAG,SAAS,EAAE,GAAG,aAAa,EACtD,KAAK,GAAG,eAAe,EACvB,OAAO,SAAS,iBAAiB,GAAG,iBAAiB,IACrD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,MAAM,CAAC;AAExE,MAAM,MAAM,sBAAsB,CAAC,KAAK,EAAE,MAAM,SAAS,SAAS,GAAG,SAAS,EAAE,IAAI,CAChF,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KACrB,MAAM,CAAC;AAEZ,MAAM,MAAM,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,SAAS,GAAG,SAAS,EAAE,IAAI,CACrF,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EACxB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,KACvB,MAAM,CAAC;AAEZ,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,eAAe,EAAE,OAAO,IAAI,CACrE,cAAc,EAAE,CAAC,EACjB,OAAO,EAAE,OAAO,KACf,cAAc,CAAC;AAEpB,MAAM,MAAM,qBAAqB,CAC7B,cAAc,SAAS,MAAM,EAC7B,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,EACzC,OAAO,IACP,CAAC,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,KAAK,CAAC,CAAC;AAE5D,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACrF,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAC9C,CAAC,CAAC;AAER,MAAM,MAAM,WAAW,GAAG;KACrB,CAAC,IAAI,MAAM,SAAS,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;CACvD,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './context.js';
2
+ export * from './schema.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ /* c8 ignore start - We're only re-exporting types */
2
+ export * from './context.js';
3
+ export * from './schema.js';
@@ -0,0 +1,39 @@
1
+ interface BaseUiElement<T extends string> {
2
+ type: T;
3
+ }
4
+ interface BaseUiValueElement<T extends string, Display> extends BaseUiElement<T> {
5
+ label: string;
6
+ display: Display | undefined;
7
+ }
8
+ /**
9
+ * Note: using `undefined` as the `Display` type breaks the Kotlin types.
10
+ */
11
+ export type SingleValue = BaseUiValueElement<'SINGLE_VALUE', string>;
12
+ export type MultipleValues = BaseUiValueElement<'MULTIPLE_VALUES', string[]>;
13
+ export type MultipleGroupedValues = BaseUiValueElement<'MULTIPLE_GROUPED_VALUES', string[][]>;
14
+ export interface ReferenceValue extends BaseUiValueElement<'REFERENCE_VALUE', string> {
15
+ reference: string | undefined;
16
+ }
17
+ export interface DownloadLink extends BaseUiElement<'DOWNLOAD_LINK'> {
18
+ label: string;
19
+ url?: string;
20
+ }
21
+ export interface DownloadBinary extends BaseUiElement<'DOWNLOAD_BINARY'> {
22
+ label: string;
23
+ reference?: string;
24
+ }
25
+ export interface ReferenceLink extends BaseUiElement<'REFERENCE_LINK'> {
26
+ label: string;
27
+ reference: string;
28
+ }
29
+ export type UiElement = SingleValue | MultipleValues | MultipleGroupedValues | ReferenceValue | DownloadLink | DownloadBinary | ReferenceLink;
30
+ export interface HealthUiGroup {
31
+ label?: string;
32
+ children: UiElement[];
33
+ }
34
+ export interface HealthUiSchema {
35
+ label: string;
36
+ children: HealthUiGroup[];
37
+ }
38
+ export {};
39
+ //# sourceMappingURL=schema.d.ts.map