<template>
    <v-card class="pa-2">
        <v-layout row>
            <v-flex xs3>
                <v-layout row wrap pr-2>
                    <v-flex xs7 pr-2>
                        
                        <v-text-field
                            label="Nomor Lab"
                            v-model="selected_patient.T_OrderHeaderLabNumber"
                            readonly
                        ></v-text-field>
                    </v-flex>

                    <v-flex xs5>
                        <v-text-field
                            label="Tanggal"
                            v-model="order_date"
                            readonly
                        ></v-text-field>
                    </v-flex>

                    <v-flex xs12>
                        <v-text-field
                            label="Nama"
                            v-model="selected_patient.M_PatientName"
                            readonly
                        ></v-text-field>
                    </v-flex>
                </v-layout>
                
            </v-flex>

            <v-flex xs3>
                <v-layout row wrap pl-2>
                    <v-flex xs5 pr-2>
                        <v-text-field
                            label="DOB"
                            v-model="dob_date"
                            readonly
                        ></v-text-field>
                    </v-flex>

                    <v-flex xs7 pl-2>
                        <v-text-field
                            label="Umur"
                            v-model="age"
                            readonly
                        ></v-text-field>
                    </v-flex>

                    <v-flex xs12>
                        <v-text-field
                            label="Jenis Kelamin"
                            v-model="selected_patient.M_SexName"
                            readonly
                        ></v-text-field>
                    </v-flex>
                </v-layout>

            </v-flex>

            <v-flex xs3>
                <v-layout row wrap pl-2>
                    <v-flex xs12>
                        <v-text-field
                            label="Dokter"
                            v-model="selected_patient.doctor_pj_name"
                            readonly
                        ></v-text-field>
                    </v-flex>

                    <v-flex xs12>
                        <v-text-field
                            label="Company"
                            v-model="selected_patient.M_CompanyName"
                            readonly
                        ></v-text-field>
                    </v-flex>
                </v-layout>

            </v-flex>

            <v-flex xs3>
                <v-layout row wrap pl-2>
                    <v-flex xs12>
                        <v-text-field
                            label="No HP"
                            v-model="selected_patient.M_PatientHP"
                            readonly
                            
                        ></v-text-field>
                    </v-flex>

                    <v-flex xs12>
                        <v-text-field
                            label="Catatan Pasien"
                            outline
                            readonly
                            hide-details
                        ></v-text-field>
                    </v-flex>
                </v-layout>

            </v-flex>
        </v-layout>

        <v-layout row wrap>
            <v-flex xs4 pr-2>
                <v-text-field
                    label="Catatan FO"
                    outline
                    readonly
                    hide-details
                    v-model="selected_patient.T_OrderHeaderFoNote"
                ></v-text-field>
            </v-flex>

            <v-flex xs4 pr-2>
                <v-text-field
                    label="Catatan Sampling"
                    outline
                    readonly
                    hide-details
                    v-model="selected_patient.T_OrderHeaderSamplingNote"
                ></v-text-field>
            </v-flex>

            <v-flex xs4>
                <v-text-field
                    label="Catatan Sample Handling"
                    outline
                    readonly
                    hide-details
                    v-model="selected_patient.T_OrderHeaderResultNote"
                ></v-text-field>
            </v-flex>
        </v-layout>
    </v-card>
</template>
    
<script>
module.exports = {
    computed : {
        selected_patient () {
            return this.$store.state.re_patient.selected_patient
        },

        order_date() {
            let d = this.selected_patient.T_OrderHeaderDate
            let e = ''
            try {
                e = d.substr(0,10).split('-').reverse().join('-')
            } catch(e) { /*console.log(e.message)*/ }
            
            return e
        },

        dob_date() {
            let d = this.selected_patient.M_PatientDOB
            let e = ''
            try {
                e = d.substr(0,10).split('-').reverse().join('-')
            } catch(e) { /*console.log(e.message)*/ }
            
            return e
        },

        age() {
            let d = this.selected_patient.T_OrderHeaderM_PatientAge
            let e = ''
            try {
                e = d.replace(/tahun/, 'th').replace(/bulan/, 'bl').replace(/hari/, 'hr')
            } catch(e) { /*console.log(e.message)*/ }
            
            return e
        }
    },

    methods : {
        
    }
}
</script>