griffithlab / civic-client

Web client for CIViC: Clinical Interpretations of Variants in Cancer
MIT License
50 stars 28 forks source link

Predictive EID submitted without drug #1608

Open kkrysiak opened 3 years ago

kkrysiak commented 3 years ago

I didn't think this was possible so I just want to suss out if this is an implementation mistake or something happened at the time of submission. In the admin interface the drug field is also empty.

https://civicdb.org/events/genes/4/summary/variants/2660/summary/evidence/9150/summary#evidence

acoffman commented 3 years ago

It appears that the form (and underlying API) do in fact allow submission of a Predictive EID without a drug. It is also not marked as required (with a *) in the form help text.

Seems like an implementation mistake - we should be able to make at least one drug required going forward for predictive EIDs!

acoffman commented 3 years ago

@jmcmichael I added

expressionProperties: {
  'templateOptions.required': function ($viewValue, $modelValue, scope) {
    return scope.model.evidence_type === 'Predictive';
}

To the drugs form field which "works" in the sense that it now puts the * required annotation, but it doesn't seem to actually enforce the behavior. You can still submit without specifying a drug (even if you manually delete the empty row). AM I missing somewhere else this needs to be set? Or is it an issue with array types that I need to deal with in the controller or something?