<commit_before>// React imports
import React, {Component} from 'react';
import PropTypes from 'prop-types';
// Material UI component imports
import Paper from 'material-ui/Paper';
import {List, ListItem} from 'material-ui/List';
import Subheader from 'material-ui/Subheader';
import Checkbox from 'material-ui/Checkbox';
import Divider from 'material-ui/Divider';
import Toggle from 'material-ui/Toggle';
import Avatar from 'material-ui/Avatar';
// Flexbox
import { Grid, Row, Col } from 'react-flexbox-grid';

// Styling
import './DataSummary.css';

class DataSummary extends Component {

    patient = {
        photo: "./DebraHernandez672.jpg",
        name: "<NAME>",
        dateOfBirth: "05 APR 1966",
        administrativeSex: "Female",
        city: "Boston",
        state: "MA"
    };

     missingInfoString = '';

    constructor(props) {
        super(props);

        this.handleHER2StatusChange = this.handleHER2StatusChange.bind(this)
        this.handleERStatusChange   = this.handleERStatusChange.bind(this)
        this.handlePRStatusChange   = this.handlePRStatusChange.bind(this)
    }

    handleHER2StatusChange (newStatus) {
      this.props.onHER2StatusChange(newStatus);
    }

    handleERStatusChange (newStatus) {
      this.props.onERStatusChange(newStatus);
    }

    handlePRStatusChange (newStatus) {
      this.props.onPRStatusChange(newStatus);
    }
    
    handleItemSelected(e, itemString, subItemString) {
        if (subItemString) {
            this.props.onSummaryItemSelected(itemString, subItemString);
        } else {
            this.props.onSummaryItemSelected(itemString, "");
        }
    }

    render() {

        // Current Staging

        const StageString = 'Prognostic Stage: ' + this.props.stage;
        const StageSubElementsString = 'T: ' + this.props.tumorSize + ', ' + 'N: ' + this.props.nodeSize + ', ' + 'M: ' + this.props.metastasis;
        const showMissingString = this.props.hasStagingData;

        if (showMissingString) {
            this.missingInfoString = '';
        } else {
            this.missingInfoString = '*Missing Information';
        }

        // Pathology Results
        const HGAString = 'HGA: HG2';
        const HER2StatusString = `HER2 Status: ${this.props.HER2Status}`;
        const ERStatusString = `ER Status: ${this.props.ERStatus}`;
        const PRStatusString = `PR Status: ${this.props.PRStatus}`;
        const HGACheckboxChecked = (this.props.HGAStatus !== "");
        const HER2CheckboxChecked = (this.props.HER2Status !== "");
        const ERCheckboxChecked = (this.props.ERStatus !== "");
        const PRCheckboxChecked = (this.props.PRStatus !== "");

        // Event Dates
        const DiagnosisDateString = 'Diagnosis: 05/16/2012';
        const DiagnosisString = 'Breast Cancer - Stage IIA';
        const DiagnosisCheckboxChecked = (this.props.DiagnosisStatus !== "");
        const SurgeryDateString = 'Surgery: 06/20/2012';
        const SurgeryString = 'Lumpectomy/sentinel/lymph node biopsy';
        const SurgeryCheckboxChecked = (this.props.SurgeryStatus !== "");
        const RadiationDateString = 'Radiation: 07/12/2012 - 08/16/2012';
        const RadiationCheckboxChecked = (this.props.RadiationStatus !== "");
        const TamoxifenDateString = 'Tamoxifen: 09/01/2012 - 07/01/2014';
        const TamoxifenCheckboxChecked = (this.props.TamoxifenStatus !== "");
        const RecurrenceDateString = 'Recurrence: 08/02/2015';
        const RecurrenceCheckboxChecked = (this.props.RecurrenceStatus !== "");

        return (
            <div id="data-summary">
                <Paper zDepth={1}>
                    <div id="summary-heading">
                        <Row center="xs">
                            <Col xs={6}>
                                <Avatar
                                    src={this.patient.photo}
                                    size={70}
                                />
                                <h1>{this.patient.name}</h1>
                            </Col>
                        </Row>
                        <Row>
                            <Col xs={4}>
                                <p className="summary-heading-detail-name">DOB</p>
                                <p className="summary-heading-detail-value">{this.patient.dateOfBirth} ({calculateAge(this.patient.dateOfBirth)})</p>
                            </Col>
                            <Col xs={4}>
                                <p className="summary-heading-detail-name">Administrative Sex:</p>
                                <p className="summary-heading-detail-value">{this.patient.administrativeSex}</p>
                            </Col>
                            <Col xs={4}>
                                <p className="summary-heading-detail-name">Location</p>
                                <p className="summary-heading-detail-value">{this.patient.city}, {this.patient.state}</p>
                            </Col>
                        </Row>
                    </div>
                    <Row center="xs">
                        <Col xs={11}>
                            <Divider />
                        </Col>
                    </Row>

                    <div id="summary-condition-details">
                        <Row>
                            <Col xs={6}>
                                <h3>Current Staging</h3>
                                <ul className="summary-section" id="summary-staging">
                                    <div className="summary-details">
                                        <li>
                                            <span onClick={(e) => this.handleItemSelected(e, StageString, StageSubElementsString)}>{StageString}</span>
                                        </li>
                                        <li className="sub-list">
                                            <span onClick={(e) => this.handleItemSelected(e, StageString, StageSubElementsString)}>{StageSubElementsString}</span>
                                        </li>
                                    </div>
                                    <span id="staging-missing-warning">{this.missingInfoString}</span>
                                </ul>
                            </Col>
                            <Col xs={6}>
                                <h3>Pathology Results</h3>
                                <ul className="summary-section" id="summary-pathology">
                                    <li>
                                        <span onClick={(e) => this.handleItemSelected(e, HGAString)}>{HGAString}</span>
                                    </li><commit_msg>Added section for disease tray header. Need to do some styling and add buttons<commit_after>// React imports
import React, {Component} from 'react';
import PropTypes from 'prop-types';
// Material UI component imports
import Paper from 'material-ui/Paper';
import {List, ListItem} from 'material-ui/List';
import Subheader from 'material-ui/Subheader';
import Checkbox from 'material-ui/Checkbox';
import Divider from 'material-ui/Divider';
import Toggle from 'material-ui/Toggle';
import Avatar from 'material-ui/Avatar';
// Flexbox
import { Grid, Row, Col } from 'react-flexbox-grid';

// Styling
import './DataSummary.css';

class DataSummary extends Component {

    patient = {
        photo: "./DebraHernandez672.jpg",
        name: "<NAME>",
        dateOfBirth: "05 APR 1966",
        administrativeSex: "Female",
        city: "Boston",
        state: "MA"
    };

     missingInfoString = '';

    constructor(props) {
        super(props);

        this.handleHER2StatusChange = this.handleHER2StatusChange.bind(this)
        this.handleERStatusChange   = this.handleERStatusChange.bind(this)
        this.handlePRStatusChange   = this.handlePRStatusChange.bind(this)
    }

    handleHER2StatusChange (newStatus) {
      this.props.onHER2StatusChange(newStatus);
    }

    handleERStatusChange (newStatus) {
      this.props.onERStatusChange(newStatus);
    }

    handlePRStatusChange (newStatus) {
      this.props.onPRStatusChange(newStatus);
    }
    
    handleItemSelected(e, itemString, subItemString) {
        if (subItemString) {
            this.props.onSummaryItemSelected(itemString, subItemString);
        } else {
            this.props.onSummaryItemSelected(itemString, "");
        }
    }

    render() {

        // Current Staging

        const StageString = 'Prognostic Stage: ' + this.props.stage;
        const StageSubElementsString = 'T: ' + this.props.tumorSize + ', ' + 'N: ' + this.props.nodeSize + ', ' + 'M: ' + this.props.metastasis;
        const showMissingString = this.props.hasStagingData;

        if (showMissingString) {
            this.missingInfoString = '';
        } else {
            this.missingInfoString = '*Missing Information';
        }

        // Pathology Results
        const HGAString = 'HGA: HG2';
        const HER2StatusString = `HER2 Status: ${this.props.HER2Status}`;
        const ERStatusString = `ER Status: ${this.props.ERStatus}`;
        const PRStatusString = `PR Status: ${this.props.PRStatus}`;
        const HGACheckboxChecked = (this.props.HGAStatus !== "");
        const HER2CheckboxChecked = (this.props.HER2Status !== "");
        const ERCheckboxChecked = (this.props.ERStatus !== "");
        const PRCheckboxChecked = (this.props.PRStatus !== "");

        // Event Dates
        const DiagnosisDateString = 'Diagnosis: 05/16/2012';
        const DiagnosisString = 'Breast Cancer - Stage IIA';
        const DiagnosisCheckboxChecked = (this.props.DiagnosisStatus !== "");
        const SurgeryDateString = 'Surgery: 06/20/2012';
        const SurgeryString = 'Lumpectomy/sentinel/lymph node biopsy';
        const SurgeryCheckboxChecked = (this.props.SurgeryStatus !== "");
        const RadiationDateString = 'Radiation: 07/12/2012 - 08/16/2012';
        const RadiationCheckboxChecked = (this.props.RadiationStatus !== "");
        const TamoxifenDateString = 'Tamoxifen: 09/01/2012 - 07/01/2014';
        const TamoxifenCheckboxChecked = (this.props.TamoxifenStatus !== "");
        const RecurrenceDateString = 'Recurrence: 08/02/2015';
        const RecurrenceCheckboxChecked = (this.props.RecurrenceStatus !== "");

        return (
            <div id="data-summary">
                <Paper zDepth={1}>
                    <div id="summary-heading">
                        <Row center="xs">
                            <Col xs={6}>
                                <Avatar
                                    src={this.patient.photo}
                                    size={70}
                                />
                                <h1>{this.patient.name}</h1>
                            </Col>
                        </Row>
                        <Row>
                            <Col xs={4}>
                                <p className="summary-heading-detail-name">DOB</p>
                                <p className="summary-heading-detail-value">{this.patient.dateOfBirth} ({calculateAge(this.patient.dateOfBirth)})</p>
                            </Col>
                            <Col xs={4}>
                                <p className="summary-heading-detail-name">Administrative Sex:</p>
                                <p className="summary-heading-detail-value">{this.patient.administrativeSex}</p>
                            </Col>
                            <Col xs={4}>
                                <p className="summary-heading-detail-name">Location</p>
                                <p className="summary-heading-detail-value">{this.patient.city}, {this.patient.state}</p>
                            </Col>
                        </Row>
                    </div>
                    <Row center="xs">
                        <Col xs={11}>
                            <Divider />
                        </Col>
                    </Row>
                    <div id="summary-disease-heading">
                        <Row >
                            <Col xs={12}>
                                <p>Current Diagnosis</p>
                                <p>Lobular carcinoma of the breast</p>
                            </Col>

                        </Row>
                    </div>
                    <Row center="xs">
                        <Col xs={11}>
                            <Divider />
                        </Col>
                    </Row>

                    <div id="summary-condition-details">
                        <Row>
                            <Col xs={6}>
                                <h3>Current Staging</h3>
                                <ul className="summary-section" id="summary-staging">
                                    <div className="summary-details">
                                        <li>
                                            <span onClick={(e) => this.handleItemSelected(e, StageString, StageSubElementsString)}>{StageString}</span>
                                        </li>
                                        <li className="sub-list">
                                            <span onClick={(e) => this.handleItemSelected(e, StageString, StageSubElementsString)}>{StageSubElementsString}</span>
                                        </li>
                                    </div>
                                    <span id="staging-missing-warning">{this.missingInfoString}</span>
                                </ul>
                            </Col>
                            <Col xs={6}>
                                <h3>Pathology Results</h3>
                                <ul className="summary-section" id="summary-pathology">
                                    <li>
                                        <span onClick={(e) => this.handleItemSelected(e, HGAString)}>{HGAString}</span>
                                    </li>
{'fraction_non_alphanumeric': 0.11710422777022676, 'fraction_numerical': 0.013448744545389513, 'mean_word_length': 1.410344827586207, 'pattern_counts': {'":': 0, '<': 148, '<?xml version=': 0, '>': 154, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 52, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2599109', 'n_tokens_mistral': 3730, 'n_tokens_neox': 3430, 'n_words': 646}