@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,22 @@
1
+ import { isNonNullish, isNullish } from '@minvws/mgo-utils';
2
+ import { upperFirst } from 'lodash-es';
3
+ import { isUiSchemaGroup } from '../../helpers/isUiSchemaGroup/isUiSchemaGroup.js';
4
+ import { getTypes } from '../../type/index.js';
5
+ export const oneOfValueX = (context) => (label, value, prefix = 'value') => {
6
+ if (isNullish(value)) {
7
+ return [];
8
+ }
9
+ const typeUiFunctions = getTypes(context);
10
+ let type;
11
+ for (type in typeUiFunctions) {
12
+ const key = `${prefix}${upperFirst(type)}`;
13
+ if (key in value && isNonNullish(value[key])) {
14
+ const uiValue = typeUiFunctions[type](label, value[key]); // eslint-disable-line @typescript-eslint/no-explicit-any
15
+ const elements = Array.isArray(uiValue)
16
+ ? uiValue
17
+ : [uiValue];
18
+ return elements.map((x) => (isUiSchemaGroup(x) ? x.children : x)).flat();
19
+ }
20
+ }
21
+ return [];
22
+ };
@@ -0,0 +1,3 @@
1
+ import { type CombinedUiFunction, type SingleValue, type WithUiContext } from '../../types/index.js';
2
+ export declare const valueWithMax: WithUiContext<CombinedUiFunction<number, number, SingleValue>>;
3
+ //# sourceMappingURL=valueWithMax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valueWithMax.d.ts","sourceRoot":"","sources":["../../../src/special/valueWithMax/valueWithMax.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAQnF,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { format } from '../../format/index.js';
2
+ export const valueWithMax = ({ formatLabel }) => (label, value, max) => {
3
+ return {
4
+ label: formatLabel(label, value),
5
+ display: format.valueWithMaxValue(value, max),
6
+ type: 'SINGLE_VALUE',
7
+ };
8
+ };
@@ -0,0 +1,4 @@
1
+ import { type PrimitiveValueType } from '@minvws/mgo-hcim-parse';
2
+ import { type CombinedUiFunction, type SingleValue, type WithUiContext } from '../../types/index.js';
3
+ export declare const valueWithUnit: WithUiContext<CombinedUiFunction<number | PrimitiveValueType<string, number>, string | PrimitiveValueType<string, string>, SingleValue>>;
4
+ //# sourceMappingURL=valueWithUnit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valueWithUnit.d.ts","sourceRoot":"","sources":["../../../src/special/valueWithUnit/valueWithUnit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,aAAa,EAAE,aAAa,CACrC,kBAAkB,CACd,MAAM,GAAG,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3C,MAAM,GAAG,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3C,WAAW,CACd,CASA,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { format } from '../../format/index.js';
2
+ import { valueOf } from '../../helpers/valueOf/valueOf.js';
3
+ export const valueWithUnit = ({ formatLabel }) => (label, value, unit) => {
4
+ return {
5
+ label: formatLabel(label, value),
6
+ display: format.valueWithUnit(valueOf(value), valueOf(unit)),
7
+ type: 'SINGLE_VALUE',
8
+ };
9
+ };
@@ -0,0 +1,6 @@
1
+ import { type MgoAnnotation } from '@minvws/mgo-hcim-parse';
2
+ import { type Nullable } from '@minvws/mgo-utils';
3
+ import { type MultipleValues, type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
4
+ export declare const annotationDisplay: (value: Nullable<MgoAnnotation>) => string | undefined;
5
+ export declare const annotation: WithUiContext<UiFunction<MgoAnnotation | MgoAnnotation[], SingleValue | MultipleValues>>;
6
+ //# sourceMappingURL=annotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../../src/type/annotation/annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,iBAAiB,GAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,uBAE/D,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,aAAa,CAClC,UAAU,CAAC,aAAa,GAAG,aAAa,EAAE,EAAE,WAAW,GAAG,cAAc,CAAC,CAiBxE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ export const annotationDisplay = (value) => {
3
+ return value?.text;
4
+ };
5
+ export const annotation = ({ formatLabel }) => (label, value, options = {}) => {
6
+ if (Array.isArray(value)) {
7
+ return {
8
+ label: formatLabel(label, value, options.defaultLabel),
9
+ type: 'MULTIPLE_VALUES',
10
+ display: value.map(annotationDisplay).filter(isNonNullish),
11
+ };
12
+ }
13
+ return {
14
+ label: formatLabel(label, value, options.defaultLabel),
15
+ display: annotationDisplay(value),
16
+ type: 'SINGLE_VALUE',
17
+ };
18
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoBoolean } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const boolean: WithUiContext<UiFunction<MgoBoolean, SingleValue>>;
4
+ //# sourceMappingURL=boolean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src/type/boolean/boolean.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,CAYlE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ export const boolean = ({ formatLabel, formatMessage }) => (label, value, options = {}) => {
3
+ const truthyString = value?.value
4
+ ? formatMessage('fhir.boolean.true')
5
+ : formatMessage('fhir.boolean.false');
6
+ return {
7
+ label: formatLabel(label, value, options.defaultLabel),
8
+ type: 'SINGLE_VALUE',
9
+ display: isNonNullish(value?.value) ? truthyString : undefined,
10
+ };
11
+ };
@@ -0,0 +1,12 @@
1
+ import { type MgoCode } from '@minvws/mgo-hcim-parse';
2
+ import { type FhirMessagesIds } from '@minvws/mgo-intl';
3
+ import { type Nullable } from '@minvws/mgo-utils';
4
+ import { type UiContext } from '../../context/index.js';
5
+ import { type MultipleValues, type SingleValue, type UiFunctionOptions } from '../../types/index.js';
6
+ type i18nCode<T extends string | undefined> = Extract<FhirMessagesIds, `codes.${string}.${T}`> extends `codes.${infer R}.${T}` ? R : never;
7
+ type CodeOptions<T extends string | undefined> = {
8
+ i18nCode: i18nCode<T>;
9
+ };
10
+ export declare function code(context: UiContext): <T extends string>(label: FhirMessagesIds, value: Nullable<MgoCode<T> | MgoCode<T>[]>, options?: CodeOptions<T> & UiFunctionOptions) => SingleValue | MultipleValues;
11
+ export {};
12
+ //# sourceMappingURL=code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/type/code/code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACzB,MAAM,sBAAsB,CAAC;AAE9B,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,SAAS,IACtC,OAAO,CAAC,eAAe,EAAE,SAAS,MAAM,IAAI,CAAC,EAAE,CAAC,SAAS,SAAS,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;AAEjG,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,SAAS,IAAI;IAC7C,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;CACzB,CAAC;AAEF,wBAAgB,IAAI,CAAC,OAAO,EAAE,SAAS,IAGlB,CAAC,SAAS,MAAM,EAC7B,OAAO,eAAe,EACtB,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAC1C,UAAU,WAAW,CAAC,CAAC,CAAC,GAAG,iBAAiB,KAC7C,WAAW,GAAG,cAAc,CA6BlC"}
@@ -0,0 +1,31 @@
1
+ import { isNonNullish, isNullish } from '@minvws/mgo-utils';
2
+ import { valueOf } from '../../helpers/valueOf/valueOf.js';
3
+ export function code(context) {
4
+ const { hasMessage, formatMessage, formatLabel } = context;
5
+ return function (label, value, options) {
6
+ const { i18nCode, defaultLabel } = options ?? {};
7
+ function translateCode(code) {
8
+ const codeValue = valueOf(code);
9
+ const i18nKey = `codes.${i18nCode}.${codeValue}`;
10
+ if (isNullish(codeValue)) {
11
+ return;
12
+ }
13
+ if (i18nCode && hasMessage(i18nKey)) {
14
+ return formatMessage(i18nKey);
15
+ }
16
+ return codeValue;
17
+ }
18
+ if (Array.isArray(value)) {
19
+ return {
20
+ label: formatLabel(label, value, defaultLabel),
21
+ type: 'MULTIPLE_VALUES',
22
+ display: value.map(translateCode).filter(isNonNullish),
23
+ };
24
+ }
25
+ return {
26
+ label: formatLabel(label, value, defaultLabel),
27
+ type: 'SINGLE_VALUE',
28
+ display: translateCode(value),
29
+ };
30
+ };
31
+ }
@@ -0,0 +1,4 @@
1
+ import { type MgoCodeableConcept } from '@minvws/mgo-hcim-parse';
2
+ import { type MultipleGroupedValues, type MultipleValues, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const codeableConcept: WithUiContext<UiFunction<MgoCodeableConcept | MgoCodeableConcept[], MultipleValues | MultipleGroupedValues>>;
4
+ //# sourceMappingURL=codeableConcept.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeableConcept.d.ts","sourceRoot":"","sources":["../../../src/type/codeableConcept/codeableConcept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,OAAO,EAEH,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAY9B,eAAO,MAAM,eAAe,EAAE,aAAa,CACvC,UAAU,CAAC,kBAAkB,GAAG,kBAAkB,EAAE,EAAE,cAAc,GAAG,qBAAqB,CAAC,CAoB5F,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ import { system } from '../../format/system/system.js';
3
+ const codeableDisplay = (context) => (value) => {
4
+ if (value?.text?.length) {
5
+ return [value.text];
6
+ }
7
+ const formatSystem = system(context);
8
+ return value?.coding.map(formatSystem).filter(isNonNullish) ?? [];
9
+ };
10
+ export const codeableConcept = (context) => (label, value, options = {}) => {
11
+ const { formatLabel } = context;
12
+ const display = codeableDisplay(context);
13
+ if (Array.isArray(value)) {
14
+ return {
15
+ label: formatLabel(label, value, options.defaultLabel),
16
+ type: 'MULTIPLE_GROUPED_VALUES',
17
+ display: value.map(display),
18
+ };
19
+ }
20
+ return {
21
+ label: formatLabel(label, value, options.defaultLabel),
22
+ type: 'MULTIPLE_VALUES',
23
+ display: display(value),
24
+ };
25
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoCoding } from '@minvws/mgo-hcim-parse';
2
+ import { type MultipleValues, type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const coding: WithUiContext<UiFunction<MgoCoding | MgoCoding[], SingleValue | MultipleValues>>;
4
+ //# sourceMappingURL=coding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coding.d.ts","sourceRoot":"","sources":["../../../src/type/coding/coding.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,CAmBhE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ import { system } from '../../format/system/system.js';
3
+ export const coding = (context) => (label, value, options = {}) => {
4
+ const { formatLabel } = context;
5
+ const display = system(context);
6
+ if (Array.isArray(value)) {
7
+ return {
8
+ label: formatLabel(label, value, options.defaultLabel),
9
+ type: 'MULTIPLE_VALUES',
10
+ display: value.map(display).filter(isNonNullish),
11
+ };
12
+ }
13
+ return {
14
+ label: formatLabel(label, value, options.defaultLabel),
15
+ type: 'SINGLE_VALUE',
16
+ display: display(value),
17
+ };
18
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoDate } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const date: WithUiContext<UiFunction<MgoDate, SingleValue>>;
4
+ //# sourceMappingURL=date.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../src/type/date/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,IAAI,EAAE,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,CAQ5D,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { date as formatDate } from '../../format/date/date.js';
2
+ export const date = (i18nContext) => (label, value, options = {}) => {
3
+ return {
4
+ label: i18nContext.formatLabel(label, value, options.defaultLabel),
5
+ type: 'SINGLE_VALUE',
6
+ display: formatDate(i18nContext)(value?.value),
7
+ };
8
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoDateTime } from '@minvws/mgo-hcim-parse';
2
+ import { type MultipleValues, type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const dateTime: WithUiContext<UiFunction<MgoDateTime | MgoDateTime[], SingleValue | MultipleValues>>;
4
+ //# sourceMappingURL=dateTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTime.d.ts","sourceRoot":"","sources":["../../../src/type/dateTime/dateTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1D,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,QAAQ,EAAE,aAAa,CAChC,UAAU,CAAC,WAAW,GAAG,WAAW,EAAE,EAAE,WAAW,GAAG,cAAc,CAAC,CAoBpE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ import { date } from '../../format/date/date.js';
3
+ import { valueOf } from '../../helpers/valueOf/valueOf.js';
4
+ export const dateTime = (context) => (label, value, options = {}) => {
5
+ const formatDate = date(context);
6
+ const { formatLabel } = context;
7
+ if (Array.isArray(value)) {
8
+ return {
9
+ label: formatLabel(label, value, options.defaultLabel),
10
+ type: 'MULTIPLE_VALUES',
11
+ display: value.map((x) => formatDate(valueOf(x))).filter(isNonNullish),
12
+ };
13
+ }
14
+ return {
15
+ label: formatLabel(label, value, options.defaultLabel),
16
+ type: 'SINGLE_VALUE',
17
+ display: formatDate(valueOf(value)),
18
+ };
19
+ };
@@ -0,0 +1,4 @@
1
+ import { type MgoDecimal } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const decimal: WithUiContext<UiFunction<MgoDecimal, SingleValue>>;
4
+ //# sourceMappingURL=decimal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../../src/type/decimal/decimal.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 decimal = ({ 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 } from '@minvws/mgo-hcim-parse';
2
+ import { type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
3
+ export declare const duration: WithUiContext<UiFunction<MgoDuration, SingleValue>>;
4
+ //# sourceMappingURL=duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../src/type/duration/duration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG7F,eAAO,MAAM,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { quantity } from '../quantity/quantity.js';
2
+ export const duration = quantity;
@@ -0,0 +1,5 @@
1
+ import { type MgoIdentifier } from '@minvws/mgo-hcim-parse';
2
+ import { type FhirMessagesIds } from '@minvws/mgo-intl';
3
+ import { type MultipleValues, type SingleValue, type UiFunction, type WithUiContext } from '../../types/index.js';
4
+ export declare const identifier: WithUiContext<UiFunction<MgoIdentifier | MgoIdentifier[], SingleValue | MultipleValues, FhirMessagesIds>>;
5
+ //# sourceMappingURL=identifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../../src/type/identifier/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EACrB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,UAAU,EAAE,aAAa,CAClC,UAAU,CAAC,aAAa,GAAG,aAAa,EAAE,EAAE,WAAW,GAAG,cAAc,EAAE,eAAe,CAAC,CAgBzF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { isNonNullish } from '@minvws/mgo-utils';
2
+ export const identifier = ({ formatLabel }) => (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?.value).filter(isNonNullish),
8
+ };
9
+ }
10
+ return {
11
+ label: formatLabel(label, value, options.defaultLabel),
12
+ type: 'SINGLE_VALUE',
13
+ display: value?.value,
14
+ };
15
+ };