Skip to content

Commit 1f0722d

Browse files
committed
missing value check in Qfile
1 parent ba94163 commit 1f0722d

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

pegr/grails-app/services/pegr/QfileService.groovy

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,48 @@ class QfileService {
145145
}
146146
}
147147
}
148+
149+
def checkMissingValueInSampleRow(def data) {
150+
def requiredFields = [
151+
'senderNameStr', //E
152+
'senderEmail', //F
153+
'senderPhone', //G
154+
'dataToUser', //H
155+
'dataToEmail', //I
156+
'projectName', //J
157+
'projectUser', //K
158+
'projectUserEmail', //L
159+
'service', //M
160+
'invoice', //N
161+
'abCompName', //O
162+
'abCatNum', //P
163+
'abLotNum', //Q
164+
'samplePrepUser', //AD
165+
'genus', //AE
166+
'species', //AF
167+
'strain', //AG
168+
'target', //AV
169+
'assay', //BA
170+
'genomeBuild1', //BB
171+
'chipUser', //BK
172+
'chipDate', //BM
173+
'protocolVersion',//BO
174+
'runStr', //CQ
175+
'indexStr' //DJ
176+
]
177+
178+
requiredFields.each { field ->
179+
if (data[field] == null) {
180+
throw new QfileException(message: "Field ${field} is missing!")
181+
}
182+
}
183+
}
148184

149185
def migrateOneSampleRow(String[] rawdata, RunStatus runStatus, Map laneData, boolean basicCheck) {
150186

151187
cleanRawData(rawdata)
152188
def data = getNamedData(rawdata)
189+
checkMissingValueInSampleRow(data)
153190

154191
// stop if basiceCheck is true and this row does not have a run number
155192
if (basicCheck && (!data.runStr || data.runStr == "Run #")) {

0 commit comments

Comments
 (0)