@f1studio/form-spec 5.0.0-alpha.111 → 5.0.0-alpha.113
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.
- package/FormSpec.FS/BitmaskHelpers.d.ts +23 -0
- package/FormSpec.FS/BitmaskHelpers.d.ts.map +1 -0
- package/FormSpec.FS/BlueprintValidation.d.ts +16 -0
- package/FormSpec.FS/BlueprintValidation.d.ts.map +1 -0
- package/FormSpec.FS/FormSpec.d.ts +19 -5
- package/FormSpec.FS/FormSpec.d.ts.map +1 -1
- package/FormSpec.FS/FormSpecHelpers.d.ts +4 -0
- package/FormSpec.FS/FormSpecHelpers.d.ts.map +1 -1
- package/FormSpec.FS/FormSpecValues.d.ts +5 -0
- package/FormSpec.FS/FormSpecValues.d.ts.map +1 -1
- package/FormSpec.FS/Helpers.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts +13 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts +22 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts +22 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts +130 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.d.ts +37 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.d.ts +231 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.d.ts +10 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts +55 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.d.ts +69 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts +21 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts +133 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.d.ts +52 -0
- package/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.d.ts +46 -0
- package/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.d.ts +4 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.d.ts +36 -0
- package/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.d.ts +95 -0
- package/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.d.ts.map +1 -0
- package/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.d.ts +449 -0
- package/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.d.ts.map +1 -0
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts +3 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts.map +1 -1
- package/FormSpec.FS/Provenance.d.ts +10 -0
- package/FormSpec.FS/Provenance.d.ts.map +1 -0
- package/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.d.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.js +56 -0
- package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BitmaskHelpers.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js +116 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Designer.js +2 -2
- package/FormSpec.TS/FormSpec.FS/Designer.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Designer.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpec.js +72 -3
- package/FormSpec.TS/FormSpec.FS/FormSpec.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpec.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js +201 -3
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.js +38 -3
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Helpers.js +44 -27
- package/FormSpec.TS/FormSpec.FS/Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js +45 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js +145 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js +139 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js +801 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.js +121 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.js +1380 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js +29 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +172 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.js +406 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +317 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +622 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js +448 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.js +198 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.js +57 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.js +144 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.js +258 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.js +1768 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +22 -18
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js +18 -6
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Provenance.js +41 -0
- package/FormSpec.TS/FormSpec.FS/Provenance.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Provenance.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.js +36 -13
- package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Renderers/PathwayRenderers.js +1 -1
- package/FormSpec.TS/PathwayExecutor.withPlugins.js +0 -5
- package/FormSpec.TS/PathwayExecutor.withPlugins.js.map +1 -1
- package/FormSpec.TS/PluginRegistration.js +2 -0
- package/FormSpec.TS/PluginRegistration.js.map +1 -1
- package/FormSpec.TS/PluginRegistration.ts.map +1 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -1
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
- package/FormSpec.TS/plugins/demographics/src/DemographicsField.js +918 -0
- package/FormSpec.TS/plugins/demographics/src/DemographicsField.js.map +1 -0
- package/FormSpec.TS/plugins/demographics/src/DemographicsField.ts.map +1 -0
- package/FormSpec.TS/plugins/likert/src/LikertField.js +1 -1
- package/PathwayExecutor.withPlugins.d.ts +0 -5
- package/PathwayExecutor.withPlugins.d.ts.map +1 -1
- package/README.md +7 -7
- package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts +3 -0
- package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts.map +1 -0
- package/package.json +4 -4
- package/plugins/demographics/src/DemographicsField.d.ts +104 -0
- package/plugins/demographics/src/DemographicsField.d.ts.map +1 -0
- package/src/FormSpec.FS/BitmaskHelpers.ts +52 -0
- package/src/FormSpec.FS/BlueprintValidation.ts +108 -0
- package/src/FormSpec.FS/Designer.ts +2 -2
- package/src/FormSpec.FS/FormSpec.ts +39 -8
- package/src/FormSpec.FS/FormSpecHelpers.ts +190 -12
- package/src/FormSpec.FS/FormSpecValues.ts +42 -3
- package/src/FormSpec.FS/Helpers.ts +44 -27
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRAdapter.ts +37 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRElementTypeMap.ts +103 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts +129 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFormSpecValidator.ts +490 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSectioning.ts +87 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.ts +1046 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts +26 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +161 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTriggerConverter.ts +386 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +320 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +371 -0
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts +372 -0
- package/src/FormSpec.FS/Integrations/Adapters/FormSystemAdapter.ts +92 -0
- package/src/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormAdapter.ts +51 -0
- package/src/FormSpec.FS/Integrations/Adapters/ReactHookForm/ReactHookFormTypes.ts +71 -0
- package/src/FormSpec.FS/Integrations/CorEMR/CorEmrTemplates.ts +15 -0
- package/src/FormSpec.FS/Integrations/CorEMR/CoreMRTypes.ts +825 -0
- package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +19 -15
- package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +13 -7
- package/src/FormSpec.FS/PathwayExecutor.ts +1 -1
- package/src/FormSpec.FS/Provenance.ts +19 -0
- package/src/FormSpec.FS/Renderers/FormSpecMarkdownRenderer.ts +32 -12
- package/src/FormSpec.FS/Renderers/PathwayRenderers.ts +1 -1
- package/src/PathwayExecutor.withPlugins.ts +0 -5
- package/src/PluginRegistration.ts +2 -0
- package/src/plugins/demographics/src/DemographicsField.ts +502 -0
- package/src/plugins/likert/src/LikertField.ts +1 -1
|
@@ -0,0 +1,1380 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get ActionTypeAnalysis_analyzeEventType () {
|
|
13
|
+
return ActionTypeAnalysis_analyzeEventType;
|
|
14
|
+
},
|
|
15
|
+
get ActionTypeAnalysis_analyzeTrigger () {
|
|
16
|
+
return ActionTypeAnalysis_analyzeTrigger;
|
|
17
|
+
},
|
|
18
|
+
get ActionTypeAnalysis_generateSuggestedParameters () {
|
|
19
|
+
return ActionTypeAnalysis_generateSuggestedParameters;
|
|
20
|
+
},
|
|
21
|
+
get ActionTypeSuggestion () {
|
|
22
|
+
return ActionTypeSuggestion;
|
|
23
|
+
},
|
|
24
|
+
get ActionTypeSuggestion_$reflection () {
|
|
25
|
+
return ActionTypeSuggestion_$reflection;
|
|
26
|
+
},
|
|
27
|
+
get ChoiceCatalogEntry () {
|
|
28
|
+
return ChoiceCatalogEntry;
|
|
29
|
+
},
|
|
30
|
+
get ChoiceCatalogEntry_$reflection () {
|
|
31
|
+
return ChoiceCatalogEntry_$reflection;
|
|
32
|
+
},
|
|
33
|
+
get ComplexityLevel () {
|
|
34
|
+
return ComplexityLevel;
|
|
35
|
+
},
|
|
36
|
+
get ComplexityLevel_$reflection () {
|
|
37
|
+
return ComplexityLevel_$reflection;
|
|
38
|
+
},
|
|
39
|
+
get ComplexityLevel_Advanced () {
|
|
40
|
+
return ComplexityLevel_Advanced;
|
|
41
|
+
},
|
|
42
|
+
get ComplexityLevel_Essential () {
|
|
43
|
+
return ComplexityLevel_Essential;
|
|
44
|
+
},
|
|
45
|
+
get ComplexityLevel_Standard () {
|
|
46
|
+
return ComplexityLevel_Standard;
|
|
47
|
+
},
|
|
48
|
+
get ConfidenceMetrics () {
|
|
49
|
+
return ConfidenceMetrics;
|
|
50
|
+
},
|
|
51
|
+
get ConfidenceMetrics_$reflection () {
|
|
52
|
+
return ConfidenceMetrics_$reflection;
|
|
53
|
+
},
|
|
54
|
+
get FieldCatalogEntry () {
|
|
55
|
+
return FieldCatalogEntry;
|
|
56
|
+
},
|
|
57
|
+
get FieldCatalogEntry_$reflection () {
|
|
58
|
+
return FieldCatalogEntry_$reflection;
|
|
59
|
+
},
|
|
60
|
+
get FormReference () {
|
|
61
|
+
return FormReference;
|
|
62
|
+
},
|
|
63
|
+
get FormReference_$reflection () {
|
|
64
|
+
return FormReference_$reflection;
|
|
65
|
+
},
|
|
66
|
+
get InferredRelationship () {
|
|
67
|
+
return InferredRelationship;
|
|
68
|
+
},
|
|
69
|
+
get InferredRelationship_$reflection () {
|
|
70
|
+
return InferredRelationship_$reflection;
|
|
71
|
+
},
|
|
72
|
+
get InstructionItem () {
|
|
73
|
+
return InstructionItem;
|
|
74
|
+
},
|
|
75
|
+
get InstructionItem_$reflection () {
|
|
76
|
+
return InstructionItem_$reflection;
|
|
77
|
+
},
|
|
78
|
+
get PathwayContext () {
|
|
79
|
+
return PathwayContext;
|
|
80
|
+
},
|
|
81
|
+
get PathwayContext_$reflection () {
|
|
82
|
+
return PathwayContext_$reflection;
|
|
83
|
+
},
|
|
84
|
+
get PathwayState () {
|
|
85
|
+
return PathwayState;
|
|
86
|
+
},
|
|
87
|
+
get PathwayState_$reflection () {
|
|
88
|
+
return PathwayState_$reflection;
|
|
89
|
+
},
|
|
90
|
+
get PathwayTransition () {
|
|
91
|
+
return PathwayTransition;
|
|
92
|
+
},
|
|
93
|
+
get PathwayTransition_$reflection () {
|
|
94
|
+
return PathwayTransition_$reflection;
|
|
95
|
+
},
|
|
96
|
+
get SemanticReport () {
|
|
97
|
+
return SemanticReport;
|
|
98
|
+
},
|
|
99
|
+
get SemanticReport_$reflection () {
|
|
100
|
+
return SemanticReport_$reflection;
|
|
101
|
+
},
|
|
102
|
+
get addActionTypeSuggestion () {
|
|
103
|
+
return addActionTypeSuggestion;
|
|
104
|
+
},
|
|
105
|
+
get addCrossFormReference () {
|
|
106
|
+
return addCrossFormReference;
|
|
107
|
+
},
|
|
108
|
+
get addInferredRelationship () {
|
|
109
|
+
return addInferredRelationship;
|
|
110
|
+
},
|
|
111
|
+
get addUnmappedInstruction () {
|
|
112
|
+
return addUnmappedInstruction;
|
|
113
|
+
},
|
|
114
|
+
get buildActionTypeSuggestions () {
|
|
115
|
+
return buildActionTypeSuggestions;
|
|
116
|
+
},
|
|
117
|
+
get buildChoiceCatalog () {
|
|
118
|
+
return buildChoiceCatalog;
|
|
119
|
+
},
|
|
120
|
+
get buildFieldCatalog () {
|
|
121
|
+
return buildFieldCatalog;
|
|
122
|
+
},
|
|
123
|
+
get buildPathwayContext () {
|
|
124
|
+
return buildPathwayContext;
|
|
125
|
+
},
|
|
126
|
+
get buildReport () {
|
|
127
|
+
return buildReport;
|
|
128
|
+
},
|
|
129
|
+
get calculateMetrics () {
|
|
130
|
+
return calculateMetrics;
|
|
131
|
+
},
|
|
132
|
+
get complexityToEmoji () {
|
|
133
|
+
return complexityToEmoji;
|
|
134
|
+
},
|
|
135
|
+
get complexityToString () {
|
|
136
|
+
return complexityToString;
|
|
137
|
+
},
|
|
138
|
+
get empty () {
|
|
139
|
+
return empty;
|
|
140
|
+
},
|
|
141
|
+
get extractFormCode () {
|
|
142
|
+
return extractFormCode;
|
|
143
|
+
},
|
|
144
|
+
get extractFormReferences () {
|
|
145
|
+
return extractFormReferences;
|
|
146
|
+
},
|
|
147
|
+
get hasFormReference () {
|
|
148
|
+
return hasFormReference;
|
|
149
|
+
},
|
|
150
|
+
get hasInstruction () {
|
|
151
|
+
return hasInstruction;
|
|
152
|
+
},
|
|
153
|
+
get scoreFieldComplexity () {
|
|
154
|
+
return scoreFieldComplexity;
|
|
155
|
+
},
|
|
156
|
+
get scoreInstructionComplexity () {
|
|
157
|
+
return scoreInstructionComplexity;
|
|
158
|
+
},
|
|
159
|
+
get toMarkdown () {
|
|
160
|
+
return toMarkdown;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const _Types = require("@fable-org/fable-library-js/Types.js");
|
|
164
|
+
const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
|
|
165
|
+
const _Option = require("@fable-org/fable-library-js/Option.js");
|
|
166
|
+
const _Util = require("@fable-org/fable-library-js/Util.js");
|
|
167
|
+
const _BigInt = require("@fable-org/fable-library-js/BigInt.js");
|
|
168
|
+
const _List = require("@fable-org/fable-library-js/List.js");
|
|
169
|
+
const _Map = require("@fable-org/fable-library-js/Map.js");
|
|
170
|
+
const _Date = require("@fable-org/fable-library-js/Date.js");
|
|
171
|
+
const _RegExp = require("@fable-org/fable-library-js/RegExp.js");
|
|
172
|
+
const _Seq = require("@fable-org/fable-library-js/Seq.js");
|
|
173
|
+
const _CorEMRElementTypeMap = require("./CorEMRElementTypeMap.js");
|
|
174
|
+
const _Helpers = require("../../../Helpers.js");
|
|
175
|
+
const _String = require("@fable-org/fable-library-js/String.js");
|
|
176
|
+
const _SystemText = require("@fable-org/fable-library-js/System.Text.js");
|
|
177
|
+
const _Seq2 = require("@fable-org/fable-library-js/Seq2.js");
|
|
178
|
+
const _Guid = require("@fable-org/fable-library-js/Guid.js");
|
|
179
|
+
function ComplexityLevel_Essential() {
|
|
180
|
+
return new ComplexityLevel(0, []);
|
|
181
|
+
}
|
|
182
|
+
function ComplexityLevel_Standard() {
|
|
183
|
+
return new ComplexityLevel(1, []);
|
|
184
|
+
}
|
|
185
|
+
function ComplexityLevel_Advanced() {
|
|
186
|
+
return new ComplexityLevel(2, []);
|
|
187
|
+
}
|
|
188
|
+
class ComplexityLevel extends _Types.Union {
|
|
189
|
+
cases() {
|
|
190
|
+
return [
|
|
191
|
+
"Essential",
|
|
192
|
+
"Standard",
|
|
193
|
+
"Advanced"
|
|
194
|
+
];
|
|
195
|
+
}
|
|
196
|
+
constructor(tag, fields){
|
|
197
|
+
super(), this.tag = tag, this.fields = fields;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function ComplexityLevel_$reflection() {
|
|
201
|
+
return (0, _Reflection.union_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.ComplexityLevel", [], ComplexityLevel, ()=>[
|
|
202
|
+
[],
|
|
203
|
+
[],
|
|
204
|
+
[]
|
|
205
|
+
]);
|
|
206
|
+
}
|
|
207
|
+
function complexityToEmoji(_arg) {
|
|
208
|
+
switch(_arg.tag){
|
|
209
|
+
case /* Standard */ 1:
|
|
210
|
+
return "🟡";
|
|
211
|
+
case /* Advanced */ 2:
|
|
212
|
+
return "🔴";
|
|
213
|
+
default:
|
|
214
|
+
return "🟢";
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function complexityToString(_arg) {
|
|
218
|
+
switch(_arg.tag){
|
|
219
|
+
case /* Standard */ 1:
|
|
220
|
+
return "Standard";
|
|
221
|
+
case /* Advanced */ 2:
|
|
222
|
+
return "Advanced";
|
|
223
|
+
default:
|
|
224
|
+
return "Essential";
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
class InstructionItem extends _Types.Record {
|
|
228
|
+
constructor(ItemId, ItemType, Text$, Pattern, Confidence, Complexity){
|
|
229
|
+
super();
|
|
230
|
+
this.ItemId = ItemId | 0;
|
|
231
|
+
this.ItemType = ItemType | 0;
|
|
232
|
+
this.Text = Text$;
|
|
233
|
+
this.Pattern = Pattern;
|
|
234
|
+
this.Confidence = Confidence;
|
|
235
|
+
this.Complexity = Complexity;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function InstructionItem_$reflection() {
|
|
239
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.InstructionItem", [], InstructionItem, ()=>[
|
|
240
|
+
[
|
|
241
|
+
"ItemId",
|
|
242
|
+
_Reflection.int32_type
|
|
243
|
+
],
|
|
244
|
+
[
|
|
245
|
+
"ItemType",
|
|
246
|
+
_Reflection.int32_type
|
|
247
|
+
],
|
|
248
|
+
[
|
|
249
|
+
"Text",
|
|
250
|
+
_Reflection.string_type
|
|
251
|
+
],
|
|
252
|
+
[
|
|
253
|
+
"Pattern",
|
|
254
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
255
|
+
],
|
|
256
|
+
[
|
|
257
|
+
"Confidence",
|
|
258
|
+
_Reflection.float64_type
|
|
259
|
+
],
|
|
260
|
+
[
|
|
261
|
+
"Complexity",
|
|
262
|
+
ComplexityLevel_$reflection()
|
|
263
|
+
]
|
|
264
|
+
]);
|
|
265
|
+
}
|
|
266
|
+
class FormReference extends _Types.Record {
|
|
267
|
+
constructor(SourceItemId, SourceText, ReferencedFormCode, ActionSuggested, Complexity){
|
|
268
|
+
super();
|
|
269
|
+
this.SourceItemId = SourceItemId | 0;
|
|
270
|
+
this.SourceText = SourceText;
|
|
271
|
+
this.ReferencedFormCode = ReferencedFormCode;
|
|
272
|
+
this.ActionSuggested = ActionSuggested;
|
|
273
|
+
this.Complexity = Complexity;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function FormReference_$reflection() {
|
|
277
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.FormReference", [], FormReference, ()=>[
|
|
278
|
+
[
|
|
279
|
+
"SourceItemId",
|
|
280
|
+
_Reflection.int32_type
|
|
281
|
+
],
|
|
282
|
+
[
|
|
283
|
+
"SourceText",
|
|
284
|
+
_Reflection.string_type
|
|
285
|
+
],
|
|
286
|
+
[
|
|
287
|
+
"ReferencedFormCode",
|
|
288
|
+
_Reflection.string_type
|
|
289
|
+
],
|
|
290
|
+
[
|
|
291
|
+
"ActionSuggested",
|
|
292
|
+
_Reflection.string_type
|
|
293
|
+
],
|
|
294
|
+
[
|
|
295
|
+
"Complexity",
|
|
296
|
+
ComplexityLevel_$reflection()
|
|
297
|
+
]
|
|
298
|
+
]);
|
|
299
|
+
}
|
|
300
|
+
class InferredRelationship extends _Types.Record {
|
|
301
|
+
constructor(Field1, Field2, RelationType, Evidence, Confidence, Complexity){
|
|
302
|
+
super();
|
|
303
|
+
this.Field1 = Field1;
|
|
304
|
+
this.Field2 = Field2;
|
|
305
|
+
this.RelationType = RelationType;
|
|
306
|
+
this.Evidence = Evidence;
|
|
307
|
+
this.Confidence = Confidence;
|
|
308
|
+
this.Complexity = Complexity;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
function InferredRelationship_$reflection() {
|
|
312
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.InferredRelationship", [], InferredRelationship, ()=>[
|
|
313
|
+
[
|
|
314
|
+
"Field1",
|
|
315
|
+
_Reflection.string_type
|
|
316
|
+
],
|
|
317
|
+
[
|
|
318
|
+
"Field2",
|
|
319
|
+
_Reflection.string_type
|
|
320
|
+
],
|
|
321
|
+
[
|
|
322
|
+
"RelationType",
|
|
323
|
+
_Reflection.string_type
|
|
324
|
+
],
|
|
325
|
+
[
|
|
326
|
+
"Evidence",
|
|
327
|
+
_Reflection.string_type
|
|
328
|
+
],
|
|
329
|
+
[
|
|
330
|
+
"Confidence",
|
|
331
|
+
_Reflection.float64_type
|
|
332
|
+
],
|
|
333
|
+
[
|
|
334
|
+
"Complexity",
|
|
335
|
+
ComplexityLevel_$reflection()
|
|
336
|
+
]
|
|
337
|
+
]);
|
|
338
|
+
}
|
|
339
|
+
class ConfidenceMetrics extends _Types.Record {
|
|
340
|
+
constructor(MechanicalConversionRate, InstructionDetectionRate, EnhancementOpportunities, UnmappedItemCount){
|
|
341
|
+
super();
|
|
342
|
+
this.MechanicalConversionRate = MechanicalConversionRate;
|
|
343
|
+
this.InstructionDetectionRate = InstructionDetectionRate;
|
|
344
|
+
this.EnhancementOpportunities = EnhancementOpportunities | 0;
|
|
345
|
+
this.UnmappedItemCount = UnmappedItemCount | 0;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function ConfidenceMetrics_$reflection() {
|
|
349
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.ConfidenceMetrics", [], ConfidenceMetrics, ()=>[
|
|
350
|
+
[
|
|
351
|
+
"MechanicalConversionRate",
|
|
352
|
+
_Reflection.float64_type
|
|
353
|
+
],
|
|
354
|
+
[
|
|
355
|
+
"InstructionDetectionRate",
|
|
356
|
+
_Reflection.float64_type
|
|
357
|
+
],
|
|
358
|
+
[
|
|
359
|
+
"EnhancementOpportunities",
|
|
360
|
+
_Reflection.int32_type
|
|
361
|
+
],
|
|
362
|
+
[
|
|
363
|
+
"UnmappedItemCount",
|
|
364
|
+
_Reflection.int32_type
|
|
365
|
+
]
|
|
366
|
+
]);
|
|
367
|
+
}
|
|
368
|
+
class FieldCatalogEntry extends _Types.Record {
|
|
369
|
+
constructor(ItemId, FieldKey, Label, FieldType, IsRequired, ParentId, Notes, Complexity){
|
|
370
|
+
super();
|
|
371
|
+
this.ItemId = ItemId | 0;
|
|
372
|
+
this.FieldKey = FieldKey;
|
|
373
|
+
this.Label = Label;
|
|
374
|
+
this.FieldType = FieldType;
|
|
375
|
+
this.IsRequired = IsRequired;
|
|
376
|
+
this.ParentId = ParentId;
|
|
377
|
+
this.Notes = Notes;
|
|
378
|
+
this.Complexity = Complexity;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function FieldCatalogEntry_$reflection() {
|
|
382
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.FieldCatalogEntry", [], FieldCatalogEntry, ()=>[
|
|
383
|
+
[
|
|
384
|
+
"ItemId",
|
|
385
|
+
_Reflection.int32_type
|
|
386
|
+
],
|
|
387
|
+
[
|
|
388
|
+
"FieldKey",
|
|
389
|
+
_Reflection.string_type
|
|
390
|
+
],
|
|
391
|
+
[
|
|
392
|
+
"Label",
|
|
393
|
+
_Reflection.string_type
|
|
394
|
+
],
|
|
395
|
+
[
|
|
396
|
+
"FieldType",
|
|
397
|
+
_Reflection.string_type
|
|
398
|
+
],
|
|
399
|
+
[
|
|
400
|
+
"IsRequired",
|
|
401
|
+
_Reflection.bool_type
|
|
402
|
+
],
|
|
403
|
+
[
|
|
404
|
+
"ParentId",
|
|
405
|
+
(0, _Reflection.option_type)(_Reflection.int32_type)
|
|
406
|
+
],
|
|
407
|
+
[
|
|
408
|
+
"Notes",
|
|
409
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
410
|
+
],
|
|
411
|
+
[
|
|
412
|
+
"Complexity",
|
|
413
|
+
ComplexityLevel_$reflection()
|
|
414
|
+
]
|
|
415
|
+
]);
|
|
416
|
+
}
|
|
417
|
+
class ChoiceCatalogEntry extends _Types.Record {
|
|
418
|
+
constructor(ChoiceId, ItemId, FieldKey, OptionKey, Text$, Score, Sequence){
|
|
419
|
+
super();
|
|
420
|
+
this.ChoiceId = ChoiceId | 0;
|
|
421
|
+
this.ItemId = ItemId | 0;
|
|
422
|
+
this.FieldKey = FieldKey;
|
|
423
|
+
this.OptionKey = OptionKey;
|
|
424
|
+
this.Text = Text$;
|
|
425
|
+
this.Score = Score;
|
|
426
|
+
this.Sequence = Sequence | 0;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
function ChoiceCatalogEntry_$reflection() {
|
|
430
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.ChoiceCatalogEntry", [], ChoiceCatalogEntry, ()=>[
|
|
431
|
+
[
|
|
432
|
+
"ChoiceId",
|
|
433
|
+
_Reflection.int32_type
|
|
434
|
+
],
|
|
435
|
+
[
|
|
436
|
+
"ItemId",
|
|
437
|
+
_Reflection.int32_type
|
|
438
|
+
],
|
|
439
|
+
[
|
|
440
|
+
"FieldKey",
|
|
441
|
+
_Reflection.string_type
|
|
442
|
+
],
|
|
443
|
+
[
|
|
444
|
+
"OptionKey",
|
|
445
|
+
_Reflection.string_type
|
|
446
|
+
],
|
|
447
|
+
[
|
|
448
|
+
"Text",
|
|
449
|
+
_Reflection.string_type
|
|
450
|
+
],
|
|
451
|
+
[
|
|
452
|
+
"Score",
|
|
453
|
+
_Reflection.int64_type
|
|
454
|
+
],
|
|
455
|
+
[
|
|
456
|
+
"Sequence",
|
|
457
|
+
_Reflection.int32_type
|
|
458
|
+
]
|
|
459
|
+
]);
|
|
460
|
+
}
|
|
461
|
+
class PathwayState extends _Types.Record {
|
|
462
|
+
constructor(StateKey, StateType, StateLabel, StateOrder){
|
|
463
|
+
super();
|
|
464
|
+
this.StateKey = StateKey;
|
|
465
|
+
this.StateType = StateType;
|
|
466
|
+
this.StateLabel = StateLabel;
|
|
467
|
+
this.StateOrder = StateOrder | 0;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
function PathwayState_$reflection() {
|
|
471
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.PathwayState", [], PathwayState, ()=>[
|
|
472
|
+
[
|
|
473
|
+
"StateKey",
|
|
474
|
+
_Reflection.string_type
|
|
475
|
+
],
|
|
476
|
+
[
|
|
477
|
+
"StateType",
|
|
478
|
+
_Reflection.string_type
|
|
479
|
+
],
|
|
480
|
+
[
|
|
481
|
+
"StateLabel",
|
|
482
|
+
_Reflection.string_type
|
|
483
|
+
],
|
|
484
|
+
[
|
|
485
|
+
"StateOrder",
|
|
486
|
+
_Reflection.int32_type
|
|
487
|
+
]
|
|
488
|
+
]);
|
|
489
|
+
}
|
|
490
|
+
class PathwayTransition extends _Types.Record {
|
|
491
|
+
constructor(TransitionKey, FromState, ToState, ConditionType, ConditionSummary){
|
|
492
|
+
super();
|
|
493
|
+
this.TransitionKey = TransitionKey;
|
|
494
|
+
this.FromState = FromState;
|
|
495
|
+
this.ToState = ToState;
|
|
496
|
+
this.ConditionType = ConditionType;
|
|
497
|
+
this.ConditionSummary = ConditionSummary;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function PathwayTransition_$reflection() {
|
|
501
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.PathwayTransition", [], PathwayTransition, ()=>[
|
|
502
|
+
[
|
|
503
|
+
"TransitionKey",
|
|
504
|
+
_Reflection.string_type
|
|
505
|
+
],
|
|
506
|
+
[
|
|
507
|
+
"FromState",
|
|
508
|
+
_Reflection.string_type
|
|
509
|
+
],
|
|
510
|
+
[
|
|
511
|
+
"ToState",
|
|
512
|
+
_Reflection.string_type
|
|
513
|
+
],
|
|
514
|
+
[
|
|
515
|
+
"ConditionType",
|
|
516
|
+
_Reflection.string_type
|
|
517
|
+
],
|
|
518
|
+
[
|
|
519
|
+
"ConditionSummary",
|
|
520
|
+
_Reflection.string_type
|
|
521
|
+
]
|
|
522
|
+
]);
|
|
523
|
+
}
|
|
524
|
+
class PathwayContext extends _Types.Record {
|
|
525
|
+
constructor(States, Transitions, ExecutionMode){
|
|
526
|
+
super();
|
|
527
|
+
this.States = States;
|
|
528
|
+
this.Transitions = Transitions;
|
|
529
|
+
this.ExecutionMode = ExecutionMode;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function PathwayContext_$reflection() {
|
|
533
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.PathwayContext", [], PathwayContext, ()=>[
|
|
534
|
+
[
|
|
535
|
+
"States",
|
|
536
|
+
(0, _Reflection.list_type)(PathwayState_$reflection())
|
|
537
|
+
],
|
|
538
|
+
[
|
|
539
|
+
"Transitions",
|
|
540
|
+
(0, _Reflection.list_type)(PathwayTransition_$reflection())
|
|
541
|
+
],
|
|
542
|
+
[
|
|
543
|
+
"ExecutionMode",
|
|
544
|
+
_Reflection.string_type
|
|
545
|
+
]
|
|
546
|
+
]);
|
|
547
|
+
}
|
|
548
|
+
class SemanticReport extends _Types.Record {
|
|
549
|
+
constructor(FormId, FormName, FormCode, FieldCatalog, ChoiceCatalog, PathwayContext, UnmappedInstructions, InferredRelationships, CrossFormReferences, Confidence, GeneratedAt, ActionTypeSuggestions){
|
|
550
|
+
super();
|
|
551
|
+
this.FormId = FormId;
|
|
552
|
+
this.FormName = FormName;
|
|
553
|
+
this.FormCode = FormCode;
|
|
554
|
+
this.FieldCatalog = FieldCatalog;
|
|
555
|
+
this.ChoiceCatalog = ChoiceCatalog;
|
|
556
|
+
this.PathwayContext = PathwayContext;
|
|
557
|
+
this.UnmappedInstructions = UnmappedInstructions;
|
|
558
|
+
this.InferredRelationships = InferredRelationships;
|
|
559
|
+
this.CrossFormReferences = CrossFormReferences;
|
|
560
|
+
this.Confidence = Confidence;
|
|
561
|
+
this.GeneratedAt = GeneratedAt;
|
|
562
|
+
this.ActionTypeSuggestions = ActionTypeSuggestions;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
function SemanticReport_$reflection() {
|
|
566
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.SemanticReport", [], SemanticReport, ()=>[
|
|
567
|
+
[
|
|
568
|
+
"FormId",
|
|
569
|
+
(0, _Reflection.class_type)("System.Guid")
|
|
570
|
+
],
|
|
571
|
+
[
|
|
572
|
+
"FormName",
|
|
573
|
+
_Reflection.string_type
|
|
574
|
+
],
|
|
575
|
+
[
|
|
576
|
+
"FormCode",
|
|
577
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
578
|
+
],
|
|
579
|
+
[
|
|
580
|
+
"FieldCatalog",
|
|
581
|
+
(0, _Reflection.list_type)(FieldCatalogEntry_$reflection())
|
|
582
|
+
],
|
|
583
|
+
[
|
|
584
|
+
"ChoiceCatalog",
|
|
585
|
+
(0, _Reflection.list_type)(ChoiceCatalogEntry_$reflection())
|
|
586
|
+
],
|
|
587
|
+
[
|
|
588
|
+
"PathwayContext",
|
|
589
|
+
(0, _Reflection.option_type)(PathwayContext_$reflection())
|
|
590
|
+
],
|
|
591
|
+
[
|
|
592
|
+
"UnmappedInstructions",
|
|
593
|
+
(0, _Reflection.list_type)(InstructionItem_$reflection())
|
|
594
|
+
],
|
|
595
|
+
[
|
|
596
|
+
"InferredRelationships",
|
|
597
|
+
(0, _Reflection.list_type)(InferredRelationship_$reflection())
|
|
598
|
+
],
|
|
599
|
+
[
|
|
600
|
+
"CrossFormReferences",
|
|
601
|
+
(0, _Reflection.list_type)(FormReference_$reflection())
|
|
602
|
+
],
|
|
603
|
+
[
|
|
604
|
+
"Confidence",
|
|
605
|
+
ConfidenceMetrics_$reflection()
|
|
606
|
+
],
|
|
607
|
+
[
|
|
608
|
+
"GeneratedAt",
|
|
609
|
+
(0, _Reflection.class_type)("System.DateTime")
|
|
610
|
+
],
|
|
611
|
+
[
|
|
612
|
+
"ActionTypeSuggestions",
|
|
613
|
+
(0, _Reflection.list_type)(ActionTypeSuggestion_$reflection())
|
|
614
|
+
]
|
|
615
|
+
]);
|
|
616
|
+
}
|
|
617
|
+
class ActionTypeSuggestion extends _Types.Record {
|
|
618
|
+
constructor(EventType, EventParams, SuggestedActionType, Confidence, Reasoning, SuggestedParameters, TargetItemId, TargetFieldKey){
|
|
619
|
+
super();
|
|
620
|
+
this.EventType = EventType;
|
|
621
|
+
this.EventParams = EventParams;
|
|
622
|
+
this.SuggestedActionType = SuggestedActionType;
|
|
623
|
+
this.Confidence = Confidence;
|
|
624
|
+
this.Reasoning = Reasoning;
|
|
625
|
+
this.SuggestedParameters = SuggestedParameters;
|
|
626
|
+
this.TargetItemId = TargetItemId;
|
|
627
|
+
this.TargetFieldKey = TargetFieldKey;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
function ActionTypeSuggestion_$reflection() {
|
|
631
|
+
return (0, _Reflection.record_type)("FormSpec.Integrations.CorEMR.CorEMRSemanticReportBuilder.ActionTypeSuggestion", [], ActionTypeSuggestion, ()=>[
|
|
632
|
+
[
|
|
633
|
+
"EventType",
|
|
634
|
+
_Reflection.string_type
|
|
635
|
+
],
|
|
636
|
+
[
|
|
637
|
+
"EventParams",
|
|
638
|
+
(0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
|
|
639
|
+
_Reflection.string_type,
|
|
640
|
+
_Reflection.string_type
|
|
641
|
+
])
|
|
642
|
+
],
|
|
643
|
+
[
|
|
644
|
+
"SuggestedActionType",
|
|
645
|
+
_Reflection.string_type
|
|
646
|
+
],
|
|
647
|
+
[
|
|
648
|
+
"Confidence",
|
|
649
|
+
_Reflection.float64_type
|
|
650
|
+
],
|
|
651
|
+
[
|
|
652
|
+
"Reasoning",
|
|
653
|
+
_Reflection.string_type
|
|
654
|
+
],
|
|
655
|
+
[
|
|
656
|
+
"SuggestedParameters",
|
|
657
|
+
(0, _Reflection.option_type)((0, _Reflection.class_type)("Microsoft.FSharp.Collections.FSharpMap`2", [
|
|
658
|
+
_Reflection.string_type,
|
|
659
|
+
_Reflection.string_type
|
|
660
|
+
]))
|
|
661
|
+
],
|
|
662
|
+
[
|
|
663
|
+
"TargetItemId",
|
|
664
|
+
(0, _Reflection.option_type)(_Reflection.int32_type)
|
|
665
|
+
],
|
|
666
|
+
[
|
|
667
|
+
"TargetFieldKey",
|
|
668
|
+
(0, _Reflection.option_type)(_Reflection.string_type)
|
|
669
|
+
]
|
|
670
|
+
]);
|
|
671
|
+
}
|
|
672
|
+
function ActionTypeAnalysis_analyzeEventType(eventType, eventParams) {
|
|
673
|
+
const matchValue = eventType.toLowerCase();
|
|
674
|
+
switch(matchValue){
|
|
675
|
+
case "task":
|
|
676
|
+
return [
|
|
677
|
+
"task",
|
|
678
|
+
0.95,
|
|
679
|
+
"CoreMR task events map directly to FormSpec task actions for workflow management"
|
|
680
|
+
];
|
|
681
|
+
case "taskcomplete":
|
|
682
|
+
return [
|
|
683
|
+
"task",
|
|
684
|
+
0.9,
|
|
685
|
+
"Task completion events should trigger task actions for workflow tracking"
|
|
686
|
+
];
|
|
687
|
+
case "alert":
|
|
688
|
+
return [
|
|
689
|
+
"alert",
|
|
690
|
+
0.95,
|
|
691
|
+
"CoreMR alert events map directly to FormSpec alert actions for clinical notifications"
|
|
692
|
+
];
|
|
693
|
+
case "medset":
|
|
694
|
+
if ((0, _Map.FSharpMap__ContainsKey)(eventParams, "quantity") ? true : (0, _Map.FSharpMap__ContainsKey)(eventParams, "refills")) {
|
|
695
|
+
return [
|
|
696
|
+
"prescription",
|
|
697
|
+
0.9,
|
|
698
|
+
"Medication event with quantity/refills suggests prescription action"
|
|
699
|
+
];
|
|
700
|
+
} else {
|
|
701
|
+
return [
|
|
702
|
+
"medication",
|
|
703
|
+
0.85,
|
|
704
|
+
"Medication event suggests administration action"
|
|
705
|
+
];
|
|
706
|
+
}
|
|
707
|
+
case "problem":
|
|
708
|
+
return [
|
|
709
|
+
"problem",
|
|
710
|
+
0.95,
|
|
711
|
+
"Problem events map directly to FormSpec problem actions for problem list management"
|
|
712
|
+
];
|
|
713
|
+
default:
|
|
714
|
+
return [
|
|
715
|
+
"documentation",
|
|
716
|
+
0.3,
|
|
717
|
+
`Unknown CoreMR event type '${eventType}' - defaulting to documentation with low confidence`
|
|
718
|
+
];
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
function ActionTypeAnalysis_generateSuggestedParameters(actionType, eventParams) {
|
|
722
|
+
switch(actionType){
|
|
723
|
+
case "task":
|
|
724
|
+
return (0, _Map.ofList)((0, _List.ofArray)([
|
|
725
|
+
[
|
|
726
|
+
"category",
|
|
727
|
+
(0, _Option.defaultArg)((0, _Map.FSharpMap__TryFind)(eventParams, "cat_desc"), "General")
|
|
728
|
+
],
|
|
729
|
+
[
|
|
730
|
+
"priority",
|
|
731
|
+
"medium"
|
|
732
|
+
],
|
|
733
|
+
[
|
|
734
|
+
"assignee",
|
|
735
|
+
"Assigned Clinician"
|
|
736
|
+
]
|
|
737
|
+
]), {
|
|
738
|
+
Compare: _Util.comparePrimitives
|
|
739
|
+
});
|
|
740
|
+
case "alert":
|
|
741
|
+
return (0, _Map.ofList)((0, _List.ofArray)([
|
|
742
|
+
[
|
|
743
|
+
"category",
|
|
744
|
+
(0, _Option.defaultArg)((0, _Map.FSharpMap__TryFind)(eventParams, "category_desc"), "Clinical")
|
|
745
|
+
],
|
|
746
|
+
[
|
|
747
|
+
"severity",
|
|
748
|
+
"medium"
|
|
749
|
+
]
|
|
750
|
+
]), {
|
|
751
|
+
Compare: _Util.comparePrimitives
|
|
752
|
+
});
|
|
753
|
+
case "medication":
|
|
754
|
+
return (0, _Map.ofList)((0, _List.ofArray)([
|
|
755
|
+
[
|
|
756
|
+
"medication_name",
|
|
757
|
+
(0, _Option.defaultArg)((0, _Map.FSharpMap__TryFind)(eventParams, "medication_name"), "As prescribed")
|
|
758
|
+
],
|
|
759
|
+
[
|
|
760
|
+
"dose",
|
|
761
|
+
(0, _Option.defaultArg)((0, _Map.FSharpMap__TryFind)(eventParams, "dose"), "As directed")
|
|
762
|
+
],
|
|
763
|
+
[
|
|
764
|
+
"route",
|
|
765
|
+
"PO"
|
|
766
|
+
],
|
|
767
|
+
[
|
|
768
|
+
"frequency",
|
|
769
|
+
"As directed"
|
|
770
|
+
]
|
|
771
|
+
]), {
|
|
772
|
+
Compare: _Util.comparePrimitives
|
|
773
|
+
});
|
|
774
|
+
case "prescription":
|
|
775
|
+
return (0, _Map.ofList)((0, _List.ofArray)([
|
|
776
|
+
[
|
|
777
|
+
"medication_name",
|
|
778
|
+
(0, _Option.defaultArg)((0, _Map.FSharpMap__TryFind)(eventParams, "medication_name"), "As prescribed")
|
|
779
|
+
],
|
|
780
|
+
[
|
|
781
|
+
"quantity",
|
|
782
|
+
"30"
|
|
783
|
+
]
|
|
784
|
+
]), {
|
|
785
|
+
Compare: _Util.comparePrimitives
|
|
786
|
+
});
|
|
787
|
+
case "problem":
|
|
788
|
+
return (0, _Map.ofList)((0, _List.ofArray)([
|
|
789
|
+
[
|
|
790
|
+
"problem_name",
|
|
791
|
+
(0, _Option.defaultArg)((0, _Map.FSharpMap__TryFind)(eventParams, "problem_desc"), "Clinical problem")
|
|
792
|
+
],
|
|
793
|
+
[
|
|
794
|
+
"status",
|
|
795
|
+
"active"
|
|
796
|
+
]
|
|
797
|
+
]), {
|
|
798
|
+
Compare: _Util.comparePrimitives
|
|
799
|
+
});
|
|
800
|
+
default:
|
|
801
|
+
return undefined;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
function ActionTypeAnalysis_analyzeTrigger(trigger, fieldCatalog) {
|
|
805
|
+
const matchValue = trigger.Events;
|
|
806
|
+
if ((0, _List.isEmpty)(matchValue)) {
|
|
807
|
+
return undefined;
|
|
808
|
+
} else {
|
|
809
|
+
const event = (0, _List.head)(matchValue);
|
|
810
|
+
const eventParams = event.EventParams;
|
|
811
|
+
const patternInput = ActionTypeAnalysis_analyzeEventType(event.EventType, eventParams);
|
|
812
|
+
const suggestedActionType = patternInput[0];
|
|
813
|
+
return new ActionTypeSuggestion(event.EventType, eventParams, suggestedActionType, patternInput[1], patternInput[2], ActionTypeAnalysis_generateSuggestedParameters(suggestedActionType, eventParams), trigger.TargetItemId, (0, _Option.map)((f_1)=>f_1.FieldKey, (0, _List.tryFind)((f)=>f.ItemId === trigger.TargetItemId, fieldCatalog)));
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
function empty(formId, formName) {
|
|
817
|
+
return new SemanticReport(formId, formName, undefined, (0, _List.empty)(), (0, _List.empty)(), undefined, (0, _List.empty)(), (0, _List.empty)(), (0, _List.empty)(), new ConfidenceMetrics(0, 0, 0, 0), (0, _Date.utcNow)(), (0, _List.empty)());
|
|
818
|
+
}
|
|
819
|
+
function extractFormCode(formName) {
|
|
820
|
+
const m = (0, _RegExp.match)((0, _RegExp.create)("\\b([A-Z]{2,3}-\\d{3}[A-Z]?)\\b"), formName);
|
|
821
|
+
if (m != null) {
|
|
822
|
+
return m[1] || "";
|
|
823
|
+
} else {
|
|
824
|
+
return undefined;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
function scoreInstructionComplexity(text, pattern) {
|
|
828
|
+
let p, p_1;
|
|
829
|
+
if (pattern == null) {
|
|
830
|
+
if (text.indexOf("protocol") >= 0 ? true : text.indexOf("navigate") >= 0) {
|
|
831
|
+
return ComplexityLevel_Advanced();
|
|
832
|
+
} else if (text.indexOf("if") >= 0 ? true : text.indexOf("when") >= 0) {
|
|
833
|
+
return ComplexityLevel_Standard();
|
|
834
|
+
} else {
|
|
835
|
+
return ComplexityLevel_Essential();
|
|
836
|
+
}
|
|
837
|
+
} else if (p = (0, _Option.value)(pattern), p.indexOf("cross-form") >= 0 ? true : p.indexOf("protocol") >= 0) {
|
|
838
|
+
const p_2 = (0, _Option.value)(pattern);
|
|
839
|
+
return ComplexityLevel_Advanced();
|
|
840
|
+
} else if (p_1 = (0, _Option.value)(pattern), p_1.indexOf("conditional") >= 0 ? true : p_1.indexOf("if") >= 0) {
|
|
841
|
+
const p_3 = (0, _Option.value)(pattern);
|
|
842
|
+
return ComplexityLevel_Standard();
|
|
843
|
+
} else {
|
|
844
|
+
return ComplexityLevel_Essential();
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
function scoreFieldComplexity(isRequired, hasDependency, hasComplexLogic) {
|
|
848
|
+
if (hasComplexLogic) {
|
|
849
|
+
return ComplexityLevel_Advanced();
|
|
850
|
+
} else if (isRequired) {
|
|
851
|
+
if (hasDependency) {
|
|
852
|
+
throw new _Types.MatchFailureException("/Users/luisfx/code/luisfx/f1-monorepo/packages/core/form-spec/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRSemanticReportBuilder.fs", 302, 14);
|
|
853
|
+
} else {
|
|
854
|
+
return ComplexityLevel_Essential();
|
|
855
|
+
}
|
|
856
|
+
} else if (hasDependency) {
|
|
857
|
+
return ComplexityLevel_Standard();
|
|
858
|
+
} else {
|
|
859
|
+
return ComplexityLevel_Standard();
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
function hasInstruction(text) {
|
|
863
|
+
return (0, _List.exists)((p)=>(0, _RegExp.isMatch)((0, _RegExp.create)(p, 1), text), (0, _List.ofArray)([
|
|
864
|
+
"\\bIf\\s+",
|
|
865
|
+
"\\bWhen\\s+",
|
|
866
|
+
"\\bcomplete\\s+",
|
|
867
|
+
"\\bperform\\s+",
|
|
868
|
+
"\\border\\s+",
|
|
869
|
+
"\\brefer\\s+"
|
|
870
|
+
]));
|
|
871
|
+
}
|
|
872
|
+
function hasFormReference(text) {
|
|
873
|
+
return (0, _RegExp.isMatch)((0, _RegExp.create)("\\[[A-Z]{2,3}-\\d{3}[A-Z]?\\]"), text);
|
|
874
|
+
}
|
|
875
|
+
function extractFormReferences(itemId, text) {
|
|
876
|
+
const matches = (0, _RegExp.matches)((0, _RegExp.create)("\\[([A-Z]{2,3}-\\d{3}[A-Z]?)\\]"), text);
|
|
877
|
+
return (0, _Seq.toList)((0, _Seq.delay)(()=>(0, _Seq.map)((m)=>new FormReference(itemId, text, m[1] || "", "Navigate to form", ComplexityLevel_Advanced()), matches)));
|
|
878
|
+
}
|
|
879
|
+
function buildFieldCatalog(items, formSpec) {
|
|
880
|
+
const fieldDataMap = (0, _Map.ofList)((0, _List.collect)((step)=>(0, _List.map)((field)=>[
|
|
881
|
+
field.Label,
|
|
882
|
+
[
|
|
883
|
+
field.FieldKey.fields[0],
|
|
884
|
+
field.Notes
|
|
885
|
+
]
|
|
886
|
+
], step.Fields), formSpec.Steps), {
|
|
887
|
+
Compare: _Util.comparePrimitives
|
|
888
|
+
});
|
|
889
|
+
return (0, _List.choose)((item)=>{
|
|
890
|
+
const matchValue = (0, _Map.tryFind)(item.Label, fieldDataMap);
|
|
891
|
+
if (matchValue == null) {
|
|
892
|
+
if ((0, _CorEMRElementTypeMap.getElementTypeInfo)(item.ItemTypeId).IsScaffold) {
|
|
893
|
+
return undefined;
|
|
894
|
+
} else {
|
|
895
|
+
return new FieldCatalogEntry(item.ItemId, `unmapped_${item.ItemId}`, item.Label, item.ItemTypeName, item.IsRequired, item.ParentId, undefined, scoreFieldComplexity(item.IsRequired, item.ParentId != null, false));
|
|
896
|
+
}
|
|
897
|
+
} else {
|
|
898
|
+
const notes = (0, _Option.value)(matchValue)[1];
|
|
899
|
+
return new FieldCatalogEntry(item.ItemId, (0, _Option.value)(matchValue)[0], item.Label, item.ItemTypeName, item.IsRequired, item.ParentId, notes, scoreFieldComplexity(item.IsRequired, item.ParentId != null, notes != null && (0, _Option.value)(notes).indexOf("if") >= 0));
|
|
900
|
+
}
|
|
901
|
+
}, items);
|
|
902
|
+
}
|
|
903
|
+
function buildChoiceCatalog(choices, formSpec, fieldCatalog) {
|
|
904
|
+
const fieldLookup = (0, _Map.ofList)((0, _List.map)((f)=>[
|
|
905
|
+
f.ItemId,
|
|
906
|
+
f.FieldKey
|
|
907
|
+
], fieldCatalog), {
|
|
908
|
+
Compare: _Util.comparePrimitives
|
|
909
|
+
});
|
|
910
|
+
return (0, _List.sortBy)((c)=>[
|
|
911
|
+
c.ItemId,
|
|
912
|
+
c.Sequence
|
|
913
|
+
], (0, _List.choose)((choice)=>{
|
|
914
|
+
const matchValue = (0, _Map.tryFind)(choice.ItemId, fieldLookup);
|
|
915
|
+
if (matchValue == null) {
|
|
916
|
+
return undefined;
|
|
917
|
+
} else {
|
|
918
|
+
return new ChoiceCatalogEntry(choice.ChoiceId, choice.ItemId, (0, _Option.value)(matchValue), (0, _Helpers.Helpers_generateDeterministicGuidRaw)(`coremr:semantic-choice:${choice.ItemId}:${choice.ChoiceId}:${choice.Sequence}:${choice.Text}`), choice.Text, (0, _BigInt.toInt64)((0, _BigInt.fromInt32)(choice.Score)), choice.Sequence);
|
|
919
|
+
}
|
|
920
|
+
}, choices), {
|
|
921
|
+
Compare: _Util.compareArrays
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
function buildPathwayContext(pathway) {
|
|
925
|
+
let matchValue_3;
|
|
926
|
+
if (pathway != null) {
|
|
927
|
+
const p = (0, _Option.value)(pathway);
|
|
928
|
+
return new PathwayContext((0, _List.map)((state)=>{
|
|
929
|
+
let matchValue;
|
|
930
|
+
return new PathwayState(state.StateKey.fields[0], (matchValue = state.StateType, matchValue.tag === /* Evaluation */ 1 ? "Evaluation" : matchValue.tag === /* Action */ 2 ? "Action" : matchValue.tag === /* Terminal */ 5 ? "Terminal" : matchValue.tag === /* CompoundAction */ 3 ? "CompoundAction" : matchValue.tag === /* ConditionalAction */ 4 ? "ConditionalAction" : (()=>{
|
|
931
|
+
throw new Error("Match failure: F1.Studio.ClinicalPathway.StateType");
|
|
932
|
+
})()), state.StateLabel, state.StateOrder);
|
|
933
|
+
}, p.States), (0, _List.map)((trans)=>{
|
|
934
|
+
let matchValue_2;
|
|
935
|
+
const transKey = trans.TransitionKey.fields[0];
|
|
936
|
+
const fromKey = trans.FromState.fields[0];
|
|
937
|
+
const toKey = trans.ToState.fields[0];
|
|
938
|
+
let conditionSummary;
|
|
939
|
+
const matchValue_1 = trans.Condition;
|
|
940
|
+
switch(matchValue_1.tag){
|
|
941
|
+
case /* Always */ 8:
|
|
942
|
+
{
|
|
943
|
+
conditionSummary = "Always";
|
|
944
|
+
break;
|
|
945
|
+
}
|
|
946
|
+
case /* FieldCondition */ 0:
|
|
947
|
+
{
|
|
948
|
+
const value = matchValue_1.fields[2];
|
|
949
|
+
const fieldKey = matchValue_1.fields[0];
|
|
950
|
+
conditionSummary = `Field: ${matchValue_1.fields[1]}`;
|
|
951
|
+
break;
|
|
952
|
+
}
|
|
953
|
+
case /* FieldOptionCondition */ 1:
|
|
954
|
+
{
|
|
955
|
+
const value_1 = matchValue_1.fields[4];
|
|
956
|
+
const optionKey = matchValue_1.fields[2];
|
|
957
|
+
const itemKey = matchValue_1.fields[1];
|
|
958
|
+
const fieldKey_1 = matchValue_1.fields[0];
|
|
959
|
+
conditionSummary = `Option: ${matchValue_1.fields[3]}`;
|
|
960
|
+
break;
|
|
961
|
+
}
|
|
962
|
+
case /* CompositeCondition */ 6:
|
|
963
|
+
{
|
|
964
|
+
const conditions = matchValue_1.fields[1];
|
|
965
|
+
conditionSummary = `Composite: ${matchValue_1.fields[0]}`;
|
|
966
|
+
break;
|
|
967
|
+
}
|
|
968
|
+
case /* StateCondition */ 5:
|
|
969
|
+
{
|
|
970
|
+
const stateKey = matchValue_1.fields[0];
|
|
971
|
+
conditionSummary = `State: ${matchValue_1.fields[1]}`;
|
|
972
|
+
break;
|
|
973
|
+
}
|
|
974
|
+
case /* TestResultCondition */ 7:
|
|
975
|
+
{
|
|
976
|
+
conditionSummary = `Test: ${matchValue_1.fields[0]} = ${matchValue_1.fields[1]}`;
|
|
977
|
+
break;
|
|
978
|
+
}
|
|
979
|
+
default:
|
|
980
|
+
throw new Error("Match failure: F1.Studio.ClinicalPathway.TransitionCondition");
|
|
981
|
+
}
|
|
982
|
+
return new PathwayTransition(transKey, fromKey, toKey, (matchValue_2 = trans.Condition, matchValue_2.tag === /* Always */ 8 ? "automatic" : matchValue_2.tag === /* FieldCondition */ 0 ? "field" : matchValue_2.tag === /* FieldOptionCondition */ 1 ? "field_option" : matchValue_2.tag === /* CompositeCondition */ 6 ? "composite" : matchValue_2.tag === /* StateCondition */ 5 ? "state" : matchValue_2.tag === /* TestResultCondition */ 7 ? "test_result" : (()=>{
|
|
983
|
+
throw new Error("Match failure: F1.Studio.ClinicalPathway.TransitionCondition");
|
|
984
|
+
})()), conditionSummary);
|
|
985
|
+
}, p.Transitions), (matchValue_3 = p.ExecutionMode, matchValue_3.tag === /* MultiPathway */ 1 ? "MultiPathway" : matchValue_3.tag === /* TriggerBased */ 2 ? "TriggerBased" : "SinglePathway"));
|
|
986
|
+
} else {
|
|
987
|
+
return undefined;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
function addUnmappedInstruction(report, item) {
|
|
991
|
+
let matchValue, text;
|
|
992
|
+
const pattern = (0, _String.startsWith)(item.Label, "If ", 5) ? "Conditional instruction" + (matchValue = (text = item.Label, text.indexOf("cardiac risk factors") >= 0 ? "Check Field 20984 (Cardiac Risk Factors)" : text.indexOf("no CV risk factors") >= 0 ? "Check Field 20984 is empty AND vitals normal" : text.indexOf("referral") >= 0 ? "Check if referral field has value" : undefined), matchValue == null ? "" : " - " + (0, _Option.value)(matchValue)) : undefined;
|
|
993
|
+
return new SemanticReport(report.FormId, report.FormName, report.FormCode, report.FieldCatalog, report.ChoiceCatalog, report.PathwayContext, (0, _List.cons)(new InstructionItem(item.ItemId, item.ItemTypeId, item.Label, pattern, 0.75, scoreInstructionComplexity(item.Label, pattern)), report.UnmappedInstructions), report.InferredRelationships, report.CrossFormReferences, report.Confidence, report.GeneratedAt, report.ActionTypeSuggestions);
|
|
994
|
+
}
|
|
995
|
+
function addCrossFormReference(report, reference) {
|
|
996
|
+
return new SemanticReport(report.FormId, report.FormName, report.FormCode, report.FieldCatalog, report.ChoiceCatalog, report.PathwayContext, report.UnmappedInstructions, report.InferredRelationships, (0, _List.cons)(reference, report.CrossFormReferences), report.Confidence, report.GeneratedAt, report.ActionTypeSuggestions);
|
|
997
|
+
}
|
|
998
|
+
function addInferredRelationship(report, field1, field2, relationType, evidence) {
|
|
999
|
+
return new SemanticReport(report.FormId, report.FormName, report.FormCode, report.FieldCatalog, report.ChoiceCatalog, report.PathwayContext, report.UnmappedInstructions, (0, _List.cons)(new InferredRelationship(field1, field2, relationType, evidence, 0.65, relationType === "triggers" ? ComplexityLevel_Standard() : relationType === "requires" ? ComplexityLevel_Standard() : relationType === "correlates with" ? ComplexityLevel_Essential() : ComplexityLevel_Standard()), report.InferredRelationships), report.CrossFormReferences, report.Confidence, report.GeneratedAt, report.ActionTypeSuggestions);
|
|
1000
|
+
}
|
|
1001
|
+
function buildActionTypeSuggestions(triggers, fieldCatalog) {
|
|
1002
|
+
return (0, _List.sortByDescending)((suggestion_2)=>suggestion_2.Confidence, (0, _List.choose)((trigger)=>{
|
|
1003
|
+
const matchValue = ActionTypeAnalysis_analyzeTrigger(trigger, fieldCatalog);
|
|
1004
|
+
let matchResult, suggestion_1;
|
|
1005
|
+
if (matchValue != null) {
|
|
1006
|
+
if ((0, _Option.value)(matchValue).Confidence > 0.5) {
|
|
1007
|
+
matchResult = 0;
|
|
1008
|
+
suggestion_1 = (0, _Option.value)(matchValue);
|
|
1009
|
+
} else {
|
|
1010
|
+
matchResult = 1;
|
|
1011
|
+
}
|
|
1012
|
+
} else {
|
|
1013
|
+
matchResult = 1;
|
|
1014
|
+
}
|
|
1015
|
+
switch(matchResult){
|
|
1016
|
+
case 0:
|
|
1017
|
+
return suggestion_1;
|
|
1018
|
+
default:
|
|
1019
|
+
return undefined;
|
|
1020
|
+
}
|
|
1021
|
+
}, triggers), {
|
|
1022
|
+
Compare: _Util.comparePrimitives
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
function addActionTypeSuggestion(report, suggestion) {
|
|
1026
|
+
return new SemanticReport(report.FormId, report.FormName, report.FormCode, report.FieldCatalog, report.ChoiceCatalog, report.PathwayContext, report.UnmappedInstructions, report.InferredRelationships, report.CrossFormReferences, report.Confidence, report.GeneratedAt, (0, _List.cons)(suggestion, report.ActionTypeSuggestions));
|
|
1027
|
+
}
|
|
1028
|
+
function calculateMetrics(report, totalItems, triggersConverted) {
|
|
1029
|
+
return new SemanticReport(report.FormId, report.FormName, report.FormCode, report.FieldCatalog, report.ChoiceCatalog, report.PathwayContext, report.UnmappedInstructions, report.InferredRelationships, report.CrossFormReferences, new ConfidenceMetrics(totalItems > 0 ? triggersConverted / totalItems * 100 : 0, totalItems > 0 ? (0, _List.length)(report.UnmappedInstructions) / totalItems * 100 : 0, (0, _List.length)(report.UnmappedInstructions) + (0, _List.length)(report.InferredRelationships) + (0, _List.length)(report.CrossFormReferences), (0, _List.length)(report.UnmappedInstructions)), report.GeneratedAt, report.ActionTypeSuggestions);
|
|
1030
|
+
}
|
|
1031
|
+
function toMarkdown(report) {
|
|
1032
|
+
let s;
|
|
1033
|
+
const sb = (0, _SystemText.StringBuilder_$ctor)();
|
|
1034
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `# Semantic Analysis Report - Form ${report.FormId}`);
|
|
1035
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `## ${report.FormName}`);
|
|
1036
|
+
if (report.FormCode != null) {
|
|
1037
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `**Form Code:** ${(0, _Option.value)(report.FormCode)}`);
|
|
1038
|
+
}
|
|
1039
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1040
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `*Generated: ${(0, _Date.toString)(report.GeneratedAt, "yyyy-MM-dd HH:mm:ss")} UTC*`);
|
|
1041
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1042
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## Complexity Legend");
|
|
1043
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "🟢 **Essential** - Core functionality, required fields, simple mappings");
|
|
1044
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "🟡 **Standard** - Optional logic, basic conditions, common workflows");
|
|
1045
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "🔴 **Advanced** - Complex branching, cross-form refs, edge cases");
|
|
1046
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1047
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## Summary Statistics");
|
|
1048
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `- Mechanical Conversion Rate: ${report.Confidence.MechanicalConversionRate}%`);
|
|
1049
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `- Instruction Detection Rate: ${report.Confidence.InstructionDetectionRate}%`);
|
|
1050
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `- Enhancement Opportunities: ${report.Confidence.EnhancementOpportunities}`);
|
|
1051
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `- Unmapped Items: ${report.Confidence.UnmappedItemCount}`);
|
|
1052
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1053
|
+
if (!(0, _List.isEmpty)(report.FieldCatalog)) {
|
|
1054
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## Field Catalog");
|
|
1055
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "*Use these FieldKeys when creating conditions and references*");
|
|
1056
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1057
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "| C | ItemId | FieldKey | Label | Type | Required | Notes |");
|
|
1058
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "|---|--------|----------|-------|------|----------|-------|");
|
|
1059
|
+
const enumerator = (0, _Util.getEnumerator)(report.FieldCatalog);
|
|
1060
|
+
try {
|
|
1061
|
+
while(enumerator["System.Collections.IEnumerator.MoveNext"]()){
|
|
1062
|
+
const field = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1063
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `| ${complexityToEmoji(field.Complexity)} | ${field.ItemId} | \`${field.FieldKey}\` | ${field.Label} | ${field.FieldType} | ${field.IsRequired ? "Yes" : "No"} | ${(s = (0, _Option.defaultArg)(field.Notes, ""), s.length > 50 ? (0, _String.substring)(s, 0, 47) + "..." : s)} |`);
|
|
1064
|
+
}
|
|
1065
|
+
} finally{
|
|
1066
|
+
(0, _Util.disposeSafe)(enumerator);
|
|
1067
|
+
}
|
|
1068
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1069
|
+
}
|
|
1070
|
+
if (!(0, _List.isEmpty)(report.ChoiceCatalog)) {
|
|
1071
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## Choice Catalog");
|
|
1072
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "*Use these OptionKeys when creating field_option conditions*");
|
|
1073
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1074
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "| ItemId | OptionKey | Text | Score |");
|
|
1075
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "|--------|-----------|------|-------|");
|
|
1076
|
+
const enumerator_1 = (0, _Util.getEnumerator)(report.ChoiceCatalog);
|
|
1077
|
+
try {
|
|
1078
|
+
while(enumerator_1["System.Collections.IEnumerator.MoveNext"]()){
|
|
1079
|
+
const choice = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1080
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `| ${choice.ItemId} | \`${choice.OptionKey}\` | ${choice.Text} | ${choice.Score} |`);
|
|
1081
|
+
}
|
|
1082
|
+
} finally{
|
|
1083
|
+
(0, _Util.disposeSafe)(enumerator_1);
|
|
1084
|
+
}
|
|
1085
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1086
|
+
}
|
|
1087
|
+
const matchValue = report.PathwayContext;
|
|
1088
|
+
if (matchValue == null) {} else {
|
|
1089
|
+
const context = (0, _Option.value)(matchValue);
|
|
1090
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## Current Clinical Pathway");
|
|
1091
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `*Execution Mode: ${context.ExecutionMode}*`);
|
|
1092
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1093
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "### Existing States");
|
|
1094
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "| StateKey | Type | Label |");
|
|
1095
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "|----------|------|-------|");
|
|
1096
|
+
const enumerator_2 = (0, _Util.getEnumerator)((0, _List.sortBy)((s_1)=>s_1.StateOrder, context.States, {
|
|
1097
|
+
Compare: _Util.comparePrimitives
|
|
1098
|
+
}));
|
|
1099
|
+
try {
|
|
1100
|
+
while(enumerator_2["System.Collections.IEnumerator.MoveNext"]()){
|
|
1101
|
+
const state = enumerator_2["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1102
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `| \`${state.StateKey}\` | ${state.StateType} | ${state.StateLabel} |`);
|
|
1103
|
+
}
|
|
1104
|
+
} finally{
|
|
1105
|
+
(0, _Util.disposeSafe)(enumerator_2);
|
|
1106
|
+
}
|
|
1107
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1108
|
+
if (!(0, _List.isEmpty)(context.Transitions)) {
|
|
1109
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "### Existing Transitions");
|
|
1110
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "| From → To | Condition |");
|
|
1111
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "|-----------|-----------|");
|
|
1112
|
+
const enumerator_3 = (0, _Util.getEnumerator)(context.Transitions);
|
|
1113
|
+
try {
|
|
1114
|
+
while(enumerator_3["System.Collections.IEnumerator.MoveNext"]()){
|
|
1115
|
+
const trans = enumerator_3["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1116
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `| \`${trans.FromState}\` → \`${trans.ToState}\` | ${trans.ConditionSummary} |`);
|
|
1117
|
+
}
|
|
1118
|
+
} finally{
|
|
1119
|
+
(0, _Util.disposeSafe)(enumerator_3);
|
|
1120
|
+
}
|
|
1121
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
if (!(0, _List.isEmpty)(report.UnmappedInstructions)) {
|
|
1125
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## Unmapped Conditional Logic");
|
|
1126
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1127
|
+
const enumerator_4 = (0, _Util.getEnumerator)((0, _List.reverse)(report.UnmappedInstructions));
|
|
1128
|
+
try {
|
|
1129
|
+
while(enumerator_4["System.Collections.IEnumerator.MoveNext"]()){
|
|
1130
|
+
const inst = enumerator_4["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1131
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `### ${complexityToEmoji(inst.Complexity)} Item ${inst.ItemId} (Type ${inst.ItemType})`);
|
|
1132
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `**Complexity:** ${complexityToString(inst.Complexity)}`);
|
|
1133
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `**Text:** ${inst.Text}`);
|
|
1134
|
+
if (inst.Pattern != null) {
|
|
1135
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `**Pattern:** ${(0, _Option.value)(inst.Pattern)}`);
|
|
1136
|
+
}
|
|
1137
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `**Confidence:** %P(F2)`);
|
|
1138
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1139
|
+
switch(inst.ItemId){
|
|
1140
|
+
case 21001:
|
|
1141
|
+
{
|
|
1142
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "**Clinical Context:** Emergency pathway for cardiac risk");
|
|
1143
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "**Suggested Actions:**");
|
|
1144
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "1. Check Field 20984 (Cardiac Risk Factors) for any value");
|
|
1145
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "2. If true: Create Task \'Contact HCP\' with urgent priority");
|
|
1146
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "3. If HCP unavailable: Create Alert \'911 Activation\'");
|
|
1147
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "4. Navigate to Emergency Protocol");
|
|
1148
|
+
break;
|
|
1149
|
+
}
|
|
1150
|
+
case 21002:
|
|
1151
|
+
{
|
|
1152
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "**Clinical Context:** Conservative treatment pathway");
|
|
1153
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "**Suggested Actions:**");
|
|
1154
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "1. Check Field 20984 is empty AND vitals are normal");
|
|
1155
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "2. If true: Create Task \'Prescribe OTC medication\'");
|
|
1156
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "3. Document treatment in appropriate fields");
|
|
1157
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "4. Navigate to discharge instructions");
|
|
1158
|
+
break;
|
|
1159
|
+
}
|
|
1160
|
+
default:
|
|
1161
|
+
{
|
|
1162
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "**Suggested Enhancement:**");
|
|
1163
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "```fsharp");
|
|
1164
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "// LLM should analyze this conditional and suggest:");
|
|
1165
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "// 1. What fields should be updated");
|
|
1166
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "// 2. What tasks should be created");
|
|
1167
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "// 3. What forms should be navigated to");
|
|
1168
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "```");
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1172
|
+
}
|
|
1173
|
+
} finally{
|
|
1174
|
+
(0, _Util.disposeSafe)(enumerator_4);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
if (!(0, _List.isEmpty)(report.ActionTypeSuggestions)) {
|
|
1178
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## 🚀 Action Type Intelligence");
|
|
1179
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1180
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "**AI-Suggested FormSpec Action Types** based on CoreMR event analysis:");
|
|
1181
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1182
|
+
const enumerator_5 = (0, _Util.getEnumerator)((0, _List.sortBy)((tuple)=>tuple[0], (0, _Seq2.List_groupBy)((s_2)=>s_2.SuggestedActionType, report.ActionTypeSuggestions, {
|
|
1183
|
+
Equals: (x_1, y_1)=>x_1 === y_1,
|
|
1184
|
+
GetHashCode: _Util.stringHash
|
|
1185
|
+
}), {
|
|
1186
|
+
Compare: _Util.comparePrimitives
|
|
1187
|
+
}));
|
|
1188
|
+
try {
|
|
1189
|
+
while(enumerator_5["System.Collections.IEnumerator.MoveNext"]()){
|
|
1190
|
+
const forLoopVar = enumerator_5["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1191
|
+
const suggestions = forLoopVar[1];
|
|
1192
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `### \`action_type: "${forLoopVar[0]}"\` (${(0, _List.length)(suggestions)} suggestions)`);
|
|
1193
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1194
|
+
const enumerator_6 = (0, _Util.getEnumerator)(suggestions);
|
|
1195
|
+
try {
|
|
1196
|
+
while(enumerator_6["System.Collections.IEnumerator.MoveNext"]()){
|
|
1197
|
+
const suggestion = enumerator_6["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1198
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `**CoreMR Event**: \`${suggestion.EventType}\``);
|
|
1199
|
+
const matchValue_1 = suggestion.TargetItemId;
|
|
1200
|
+
if (matchValue_1 == null) {} else {
|
|
1201
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `- **Target Item**: ${(0, _Option.value)(matchValue_1)}`);
|
|
1202
|
+
}
|
|
1203
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `- **Confidence**: %P(P0)`);
|
|
1204
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `- **Reasoning**: ${suggestion.Reasoning}`);
|
|
1205
|
+
const matchValue_2 = suggestion.SuggestedParameters;
|
|
1206
|
+
let matchResult, parameters_1;
|
|
1207
|
+
if (matchValue_2 != null) {
|
|
1208
|
+
if (!(0, _Map.FSharpMap__get_IsEmpty)((0, _Option.value)(matchValue_2))) {
|
|
1209
|
+
matchResult = 0;
|
|
1210
|
+
parameters_1 = (0, _Option.value)(matchValue_2);
|
|
1211
|
+
} else {
|
|
1212
|
+
matchResult = 1;
|
|
1213
|
+
}
|
|
1214
|
+
} else {
|
|
1215
|
+
matchResult = 1;
|
|
1216
|
+
}
|
|
1217
|
+
switch(matchResult){
|
|
1218
|
+
case 0:
|
|
1219
|
+
{
|
|
1220
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "- **Suggested Parameters**:");
|
|
1221
|
+
const enumerator_7 = (0, _Util.getEnumerator)(parameters_1);
|
|
1222
|
+
try {
|
|
1223
|
+
while(enumerator_7["System.Collections.IEnumerator.MoveNext"]()){
|
|
1224
|
+
const kvp = enumerator_7["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1225
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, ` - \`${kvp[0]}\`: "${kvp[1]}"`);
|
|
1226
|
+
}
|
|
1227
|
+
} finally{
|
|
1228
|
+
(0, _Util.disposeSafe)(enumerator_7);
|
|
1229
|
+
}
|
|
1230
|
+
break;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "- **Example YAML**:");
|
|
1234
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, " ```yaml");
|
|
1235
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, ` action_type: "${suggestion.SuggestedActionType}"`);
|
|
1236
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, ` description: "[Your clinical description based on ${suggestion.EventType} event]"`);
|
|
1237
|
+
const matchValue_3 = suggestion.SuggestedParameters;
|
|
1238
|
+
let matchResult_1, parameters_3;
|
|
1239
|
+
if (matchValue_3 != null) {
|
|
1240
|
+
if (!(0, _Map.FSharpMap__get_IsEmpty)((0, _Option.value)(matchValue_3))) {
|
|
1241
|
+
matchResult_1 = 0;
|
|
1242
|
+
parameters_3 = (0, _Option.value)(matchValue_3);
|
|
1243
|
+
} else {
|
|
1244
|
+
matchResult_1 = 1;
|
|
1245
|
+
}
|
|
1246
|
+
} else {
|
|
1247
|
+
matchResult_1 = 1;
|
|
1248
|
+
}
|
|
1249
|
+
switch(matchResult_1){
|
|
1250
|
+
case 0:
|
|
1251
|
+
{
|
|
1252
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, " parameters:");
|
|
1253
|
+
const enumerator_8 = (0, _Util.getEnumerator)(parameters_3);
|
|
1254
|
+
try {
|
|
1255
|
+
while(enumerator_8["System.Collections.IEnumerator.MoveNext"]()){
|
|
1256
|
+
const kvp_1 = enumerator_8["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1257
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, ` ${kvp_1[0]}: "${kvp_1[1]}"`);
|
|
1258
|
+
}
|
|
1259
|
+
} finally{
|
|
1260
|
+
(0, _Util.disposeSafe)(enumerator_8);
|
|
1261
|
+
}
|
|
1262
|
+
break;
|
|
1263
|
+
}
|
|
1264
|
+
case 1:
|
|
1265
|
+
{
|
|
1266
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, " parameters: {}");
|
|
1267
|
+
break;
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, " ```");
|
|
1271
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1272
|
+
}
|
|
1273
|
+
} finally{
|
|
1274
|
+
(0, _Util.disposeSafe)(enumerator_6);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
} finally{
|
|
1278
|
+
(0, _Util.disposeSafe)(enumerator_5);
|
|
1279
|
+
}
|
|
1280
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "💡 **LLM Guidance**: Use these suggestions to replace generic \"documentation\" actions with specific, clinically-appropriate action types.");
|
|
1281
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1282
|
+
}
|
|
1283
|
+
if (!(0, _List.isEmpty)(report.CrossFormReferences)) {
|
|
1284
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## Cross-Form References");
|
|
1285
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1286
|
+
const enumerator_9 = (0, _Util.getEnumerator)((0, _List.reverse)(report.CrossFormReferences));
|
|
1287
|
+
try {
|
|
1288
|
+
while(enumerator_9["System.Collections.IEnumerator.MoveNext"]()){
|
|
1289
|
+
const ref = enumerator_9["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1290
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `- ${complexityToEmoji(ref.Complexity)} Item ${ref.SourceItemId}: References **[${ref.ReferencedFormCode}]**`);
|
|
1291
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, ` - Context: ${ref.SourceText.length > 100 ? (0, _String.substring)(ref.SourceText, 0, 100) + "..." : ref.SourceText}`);
|
|
1292
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, ` - Suggested Action: ${ref.ActionSuggested}`);
|
|
1293
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1294
|
+
}
|
|
1295
|
+
} finally{
|
|
1296
|
+
(0, _Util.disposeSafe)(enumerator_9);
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
if (!(0, _List.isEmpty)(report.InferredRelationships)) {
|
|
1300
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## Inferred Relationships");
|
|
1301
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1302
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "| C | Field 1 | Relationship | Field 2 | Evidence | Confidence |");
|
|
1303
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "|---|---------|--------------|---------|----------|------------|");
|
|
1304
|
+
const enumerator_10 = (0, _Util.getEnumerator)((0, _List.reverse)(report.InferredRelationships));
|
|
1305
|
+
try {
|
|
1306
|
+
while(enumerator_10["System.Collections.IEnumerator.MoveNext"]()){
|
|
1307
|
+
const rel = enumerator_10["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1308
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `| ${complexityToEmoji(rel.Complexity)} | ${rel.Field1} | ${rel.RelationType} | ${rel.Field2} | ${rel.Evidence} | %P(F2) |`);
|
|
1309
|
+
}
|
|
1310
|
+
} finally{
|
|
1311
|
+
(0, _Util.disposeSafe)(enumerator_10);
|
|
1312
|
+
}
|
|
1313
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1314
|
+
}
|
|
1315
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## Recommended Enhancements");
|
|
1316
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1317
|
+
if ((0, _List.length)(report.UnmappedInstructions) > 0) {
|
|
1318
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `1. **Parse ${(0, _List.length)(report.UnmappedInstructions)} conditional instructions** for automated field updates`);
|
|
1319
|
+
}
|
|
1320
|
+
if ((0, _List.length)(report.CrossFormReferences) > 0) {
|
|
1321
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `2. **Implement ${(0, _List.length)(report.CrossFormReferences)} cross-form navigation** actions`);
|
|
1322
|
+
}
|
|
1323
|
+
if ((0, _List.length)(report.InferredRelationships) > 0) {
|
|
1324
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, `3. **Add ${(0, _List.length)(report.InferredRelationships)} inferred field relationships** for better UX`);
|
|
1325
|
+
}
|
|
1326
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1327
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "## LLM Enhancement Prompts");
|
|
1328
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1329
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "### For each unmapped instruction above:");
|
|
1330
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "```");
|
|
1331
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "Given the clinical context and instruction text,");
|
|
1332
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "suggest appropriate FormSpec actions:");
|
|
1333
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "1. SetFieldValue actions for automatic field updates");
|
|
1334
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "2. Task actions for clinical workflows");
|
|
1335
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "3. AdministerForm actions for form administration");
|
|
1336
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "4. Alert actions for critical conditions");
|
|
1337
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "```");
|
|
1338
|
+
(0, _SystemText.StringBuilder__AppendLine)(sb);
|
|
1339
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "---");
|
|
1340
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "*This report identifies conversion opportunities that require semantic understanding.*");
|
|
1341
|
+
(0, _SystemText.StringBuilder__AppendLine_Z721C83C5)(sb, "*Use with LLM/MCP tools to complete the enhancement process.*");
|
|
1342
|
+
return (0, _Types.toString)(sb);
|
|
1343
|
+
}
|
|
1344
|
+
function buildReport(formData) {
|
|
1345
|
+
let report = empty((0, _Guid.newGuid)(), formData.Metadata.FormName);
|
|
1346
|
+
const enumerator = (0, _Util.getEnumerator)(formData.Items);
|
|
1347
|
+
try {
|
|
1348
|
+
while(enumerator["System.Collections.IEnumerator.MoveNext"]()){
|
|
1349
|
+
const item = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1350
|
+
if (hasInstruction(item.Label)) {
|
|
1351
|
+
report = addUnmappedInstruction(report, item);
|
|
1352
|
+
}
|
|
1353
|
+
const enumerator_1 = (0, _Util.getEnumerator)(extractFormReferences(item.ItemId, item.Label));
|
|
1354
|
+
try {
|
|
1355
|
+
while(enumerator_1["System.Collections.IEnumerator.MoveNext"]()){
|
|
1356
|
+
const reference = enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1357
|
+
report = addCrossFormReference(report, reference);
|
|
1358
|
+
}
|
|
1359
|
+
} finally{
|
|
1360
|
+
(0, _Util.disposeSafe)(enumerator_1);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
} finally{
|
|
1364
|
+
(0, _Util.disposeSafe)(enumerator);
|
|
1365
|
+
}
|
|
1366
|
+
const enumerator_2 = (0, _Util.getEnumerator)(buildActionTypeSuggestions(formData.Triggers, (0, _List.empty)()));
|
|
1367
|
+
try {
|
|
1368
|
+
while(enumerator_2["System.Collections.IEnumerator.MoveNext"]()){
|
|
1369
|
+
const suggestion = enumerator_2["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1370
|
+
report = addActionTypeSuggestion(report, suggestion);
|
|
1371
|
+
}
|
|
1372
|
+
} finally{
|
|
1373
|
+
(0, _Util.disposeSafe)(enumerator_2);
|
|
1374
|
+
}
|
|
1375
|
+
const triggersConverted = (0, _List.length)(formData.Triggers) | 0;
|
|
1376
|
+
report = calculateMetrics(report, (0, _List.length)(formData.Items), triggersConverted);
|
|
1377
|
+
return toMarkdown(report);
|
|
1378
|
+
} //# sourceMappingURL=CorEMRSemanticReportBuilder.ts.map
|
|
1379
|
+
|
|
1380
|
+
//# sourceMappingURL=CorEMRSemanticReportBuilder.js.map
|