<commit_before>/**
 * @typedef {Object} EHR.model.DataModelManager
 * @prop registerMetadata
 */
EHR.model.DataModelManager.registerMetadata('Breeding.Columns', {
    byQuery: {
        'study.breeding_encounters': {
            Id:                             { columnConfig: { columnIndex: 1 } },
            sireid:                         { columnConfig: { columnIndex: 2 } },
            date:                           { columnConfig: { columnIndex: 3 } },
            enddate:                        { columnConfig: { columnIndex: 4 } },
            ejaculation:                    { columnConfig: { columnIndex: 5 } },
            project:                        { columnConfig: { columnIndex: 6 } },
            remark:                         { columnConfig: { columnIndex: 7, width: 400 } },
            performedby:                    { columnConfig: { columnIndex: 8 } }
        },
        'study.pregnancies': {
            Id:                             { columnConfig: { columnIndex:  1 } },
            sireid:                         { columnConfig: { columnIndex:  2 } },
            breedingencounterid:            { columnConfig: { columnIndex:  3, width: 200 } },
            date_conception:                { columnConfig: { columnIndex:  4, width: 200 } },
            date_due:                       { columnConfig: { columnIndex:  5, width: 200 } },
            remark:                         { columnConfig: { columnIndex:  6, width: 200 } },
            pregnancyid:                    { columnConfig: { columnIndex:  7, width: 200 } },
            performedby:                    { columnConfig: { columnIndex:  8 } },
            date:                           { columnConfig: { columnIndex:  9 } }
        },
        'study.pregnancy_outcomes':         {
            Id:                             { columnConfig: { columnIndex: 1 } },
            date:                           { columnConfig: { columnIndex: 2 } },
            pregnancyid:                    { columnConfig: { columnIndex: 3, width: 200 } },
            outcome:                        { columnConfig: { columnIndex: 4 } },
            infantid:                       { columnConfig: { columnIndex: 5 } },
            project:                        { columnConfig: { columnIndex: 6 } },
            remark:                         { columnConfig: { columnIndex: 7, width: 400 } },
            performedby:                    { columnConfig: { columnIndex: 8 } }
        },
        'study.ultrasounds': {
            Id:                             { columnConfig: { columnIndex:  1 } },
            date:                           { columnConfig: { columnIndex:  2 } },
            pregnancyid:                    { columnConfig: { columnIndex:  3, width: 200 } },
            project:                        { columnConfig: { columnIndex:  4 } },
            restraint:                      { columnConfig: { columnIndex:  5 } },
            fetal_heartbeat:                { columnConfig: { columnIndex:  6 } },
            beats_per_minute:               { columnConfig: { columnIndex:  7 } },
            beats_per_minute_gest_day:      { columnConfig: { columnIndex:  8 } },
            crown_rump_mm:                  { columnConfig: { columnIndex:  9 } },
            crown_rump_gest_day:            { columnConfig: { columnIndex: 10 } },
            head_circumference_mm:          { columnConfig: { columnIndex: 11 } },
            head_circumference_gest_day:    { columnConfig: { columnIndex: 12 } },
            femur_length_mm:                { columnConfig: { columnIndex: 13 } },
            femur_length_gest_day:          { columnConfig: { columnIndex: 14 } },
            biparietal_diameter_mm:         { columnConfig: { columnIndex: 15 } },
            biparietal_diameter_gest_day:   { columnConfig: { columnIndex: 16 } },
            code:                           { columnConfig: { columnIndex: 17 } },
            remark:                         { columnConfig: { columnIndex: 18, width: 150 } },
            performedby:                    { columnConfig: { columnIndex: 19 } },
            followup_required:              { columnConfig: { columnIndex: 20 } }
        }
    }
});

EHR.model.DataModelManager.registerMetadata('Breeding.Editors', {});

EHR.model.DataModelManager.registerMetadata('Breeding.Config', {
    byQuery: {
        'study.pregnancies': {
            breedingencounterid: {
                xtype: 'wnprc-breedingencounteridfield'
            },
            date_conception_early: {
                hidden: true
            },
            date_conception_late: {
                hidden: true
            },
            date_due_early: {
                hidden: true
            },
            date_due_late: {
                hidden: true
            }
        },
        'study.pregnancy_outcomes': {
            pregnancyid: {
                xtype: 'wnprc-pregnancyidfield'
            },
<commit_msg>added plugins for calculating due date based on conception date<commit_after>/**
 * @typedef {Object} EHR.model.DataModelManager
 * @prop registerMetadata
 */
EHR.model.DataModelManager.registerMetadata('Breeding.Columns', {
    byQuery: {
        'study.breeding_encounters': {
            Id:                             { columnConfig: { columnIndex: 1 } },
            sireid:                         { columnConfig: { columnIndex: 2 } },
            date:                           { columnConfig: { columnIndex: 3 } },
            enddate:                        { columnConfig: { columnIndex: 4 } },
            ejaculation:                    { columnConfig: { columnIndex: 5 } },
            project:                        { columnConfig: { columnIndex: 6 } },
            remark:                         { columnConfig: { columnIndex: 7, width: 400 } },
            performedby:                    { columnConfig: { columnIndex: 8 } }
        },
        'study.pregnancies': {
            Id:                             { columnConfig: { columnIndex:  1 } },
            sireid:                         { columnConfig: { columnIndex:  2 } },
            breedingencounterid:            { columnConfig: { columnIndex:  3, width: 200 } },
            date_conception:                { columnConfig: { columnIndex:  4, width: 200 } },
            date_due:                       { columnConfig: { columnIndex:  5, width: 200 } },
            remark:                         { columnConfig: { columnIndex:  6, width: 200 } },
            pregnancyid:                    { columnConfig: { columnIndex:  7, width: 200 } },
            performedby:                    { columnConfig: { columnIndex:  8 } },
            date:                           { columnConfig: { columnIndex:  9 } }
        },
        'study.pregnancy_outcomes':         {
            Id:                             { columnConfig: { columnIndex: 1 } },
            date:                           { columnConfig: { columnIndex: 2 } },
            pregnancyid:                    { columnConfig: { columnIndex: 3, width: 200 } },
            outcome:                        { columnConfig: { columnIndex: 4 } },
            infantid:                       { columnConfig: { columnIndex: 5 } },
            project:                        { columnConfig: { columnIndex: 6 } },
            remark:                         { columnConfig: { columnIndex: 7, width: 400 } },
            performedby:                    { columnConfig: { columnIndex: 8 } }
        },
        'study.ultrasounds': {
            Id:                             { columnConfig: { columnIndex:  1 } },
            date:                           { columnConfig: { columnIndex:  2 } },
            pregnancyid:                    { columnConfig: { columnIndex:  3, width: 200 } },
            project:                        { columnConfig: { columnIndex:  4 } },
            restraint:                      { columnConfig: { columnIndex:  5 } },
            fetal_heartbeat:                { columnConfig: { columnIndex:  6 } },
            beats_per_minute:               { columnConfig: { columnIndex:  7 } },
            beats_per_minute_gest_day:      { columnConfig: { columnIndex:  8 } },
            crown_rump_mm:                  { columnConfig: { columnIndex:  9 } },
            crown_rump_gest_day:            { columnConfig: { columnIndex: 10 } },
            head_circumference_mm:          { columnConfig: { columnIndex: 11 } },
            head_circumference_gest_day:    { columnConfig: { columnIndex: 12 } },
            femur_length_mm:                { columnConfig: { columnIndex: 13 } },
            femur_length_gest_day:          { columnConfig: { columnIndex: 14 } },
            biparietal_diameter_mm:         { columnConfig: { columnIndex: 15 } },
            biparietal_diameter_gest_day:   { columnConfig: { columnIndex: 16 } },
            code:                           { columnConfig: { columnIndex: 17 } },
            remark:                         { columnConfig: { columnIndex: 18, width: 150 } },
            performedby:                    { columnConfig: { columnIndex: 19 } },
            followup_required:              { columnConfig: { columnIndex: 20 } }
        }
    }
});

EHR.model.DataModelManager.registerMetadata('Breeding.Editors', {});

EHR.model.DataModelManager.registerMetadata('Breeding.Config', {
    byQuery: {
        'study.pregnancies': {
            breedingencounterid: {
                xtype: 'wnprc-breedingencounteridfield',
                editorConfig: {
                    plugins: ['wnprc-pregnancyduedatecalculation'],
                }
            },
            date_due: {
                xtype: 'wnprc-calculatedpregnancyduedatefield',
                editorConfig: {
                    plugins: ['wnprc-pregnancyduedatecalculation'],
                }
            },
            date_conception: {
                xtype: 'wnprc-calculatedpregnancyduedatefield',
                editorConfig: {
                    plugins: ['wnprc-pregnancyduedatecalculation'],
                }
            },
            date_conception_early: {
                hidden: false,
                editorConfig: {
                    listeners: {
                        //hide field on render because if it's never rendered
                        //to the dom it won't be able to be changed while hidden
                        render: function(field){
                            field.hide();
                            field.setVisible(false);
                        }
                    }
                },
                columnConfig: {
                    hidden: true
                }
            },
            date_conception_late: {
                hidden: false,
                editorConfig: {
                    listeners: {
                        //hide field on render because if it's never rendered
                        //to the dom it won't be able to be changed while hidden
                        render: function(field){
                            field.hide();
                        }
                    }
                },
                columnConfig: {
                    hidden: true
                }
            },
            date_due_early: {
                hidden: false,
                editorConfig: {
                    listeners: {
                        //hide field on render because if it's never rendered
                        //to the dom it won't be able to be changed while hidden
                        render: function(field){
                            field.hide();
                        }
                    }
                },
                columnConfig: {
                    hidden: true
                }
            },
            date_due_late: {
                hidden: false,
                editorConfig: {
                    listeners: {
                        //hide field on render because if it's never rendered
                        //to the dom it won't be able to be changed while hidden
                        render: function(field){
                            field.hide();
                        }
                    }
                },
                columnConfig: {
                    hidden: true
                }
            }
        },
        'study.pregnancy_outcomes': {
            pregnancyid: {
                xtype: 'wnprc-pregnancyidfield'
            },

{'fraction_non_alphanumeric': 0.09384281929838645, 'fraction_numerical': 0.013807497792405875, 'mean_word_length': 1.0909701242027525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4738005', 'n_tokens_mistral': 3207, 'n_tokens_neox': 2936, 'n_words': 611}