1#!/usr/bin/env cwl-runner
2### Creates helper tables for Medicare QC
3# Copyright (c) 2022. Harvard University
4#
5# Developed by Research Software Engineering,
6# Faculty of Arts and Sciences, Research Computing (FAS RC)
7# Author: Michael A Bouzinier
8#
9# Licensed under the Apache License, Version 2.0 (the "License");
10# you may not use this file except in compliance with the License.
11# You may obtain a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS,
17# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18# See the License for the specific language governing permissions and
19# limitations under the License.
20#
21
22cwlVersion: v1.2
23class: Workflow
24
25requirements:
26 SubworkflowFeatureRequirement: {}
27 StepInputExpressionRequirement: {}
28 InlineJavascriptRequirement: {}
29
30doc: |
31 This workflow creates helper tables to be used in Quality Checks (QC)
32 for Medicare data
33
34inputs:
35 database:
36 type: File
37 doc: Path to database connection file, usually database.ini
38 connection_name:
39 type: string
40 doc: The name of the section in the database.ini file
41 depends_on:
42 type: File?
43 doc: a special field used to enforce dependencies and execution order
44
45steps:
46 create_enrl_qc_view:
47 run: create.cwl
48 doc: >
49 Creates a joined view with Beneficiaries and Enrollments tables
50 in:
51 database: database
52 connection_name: connection_name
53 table:
54 valueFrom: "qc_enrl_bene"
55 domain:
56 valueFrom: "medicare"
57 out: [ log, errors ]
58
59 create_adm_qc_view:
60 run: create.cwl
61 doc: >
62 Creates a union of admissions validated records and records
63 discarded because of validation issues
64 in:
65 database: database
66 connection_name: connection_name
67 table:
68 valueFrom: "qc_adm_union"
69 domain:
70 valueFrom: "medicare"
71 out: [ log, errors ]
72
73 create_enrollments_qc_table:
74 run: matview.cwl
75 doc: Creates a table with aggregate data for beneficiaries and enrollments
76 in:
77 depends_on: create_enrl_qc_view/log
78 table:
79 valueFrom: "qc_enrollments"
80 domain:
81 valueFrom: "medicare"
82 database: database
83 connection_name: connection_name
84 out:
85 - create_log
86 - index_log
87 - vacuum_log
88 - create_err
89 - index_err
90 - vacuum_err
91
92 create_admissions_qc_table:
93 run: matview.cwl
94 doc: Creates a table with aggregate data for inpatient admissions
95 in:
96 depends_on: create_adm_qc_view/log
97 table:
98 valueFrom: "qc_admissions"
99 domain:
100 valueFrom: "medicare"
101 database: database
102 connection_name: connection_name
103 out:
104 - create_log
105 - index_log
106 - vacuum_log
107 - create_err
108 - index_err
109 - vacuum_err
110
111
112outputs:
113 ev_create_log:
114 type: File
115 outputSource: create_enrl_qc_view/log
116 ev_create_err:
117 type: File
118 outputSource: create_enrl_qc_view/errors
119 av_create_log:
120 type: File
121 outputSource: create_adm_qc_view/log
122 av_create_err:
123 type: File
124 outputSource: create_adm_qc_view/errors
125
126 enrollmen343_create_log:
127 type: File
128 outputSource: create_enrollments_qc_table/create_log
129 enrollmen343_index_log:
130 type: File
131 outputSource: create_enrollments_qc_table/index_log
132 enrollmen343_vacuum_log:
133 type: File
134 outputSource: create_enrollments_qc_table/vacuum_log
135 enrollmen343_create_err:
136 type: File
137 outputSource: create_enrollments_qc_table/create_err
138 enrollmen343_index_err:
139 type: File
140 outputSource: create_enrollments_qc_table/index_err
141 enrollmen343_vacuum_err:
142 type: File
143 outputSource: create_enrollments_qc_table/vacuum_err
144
145 admission697_create_log:
146 type: File
147 outputSource: create_admissions_qc_table/create_log
148 admission697_index_log:
149 type: File
150 outputSource: create_admissions_qc_table/index_log
151 admission697_vacuum_log:
152 type: File
153 outputSource: create_admissions_qc_table/vacuum_log
154 admission697_create_err:
155 type: File
156 outputSource: create_admissions_qc_table/create_err
157 admission697_index_err:
158 type: File
159 outputSource: create_admissions_qc_table/index_err
160 admission697_vacuum_err:
161 type: File
162 outputSource: create_admissions_qc_table/vacuum_err