<template>
    <v-layout row wrap>
        <v-flex xs12>
            <v-card class="pa-2" v-show="!detail">
                <v-layout style="min-height:610px;" row wrap>
                    <v-flex xs12>
                        <object  style="overflow-y:scroll;" width="100%" :height="xheight" :data="xurl"></object>
                    </v-flex>
                </v-layout>
            </v-card>
        </v-flex>
    </v-layout>
    
</template>

<style scoped>
    .btn-detail {
        min-width: 0px !important;
        height: auto;
        padding: 0px;
        top: 5px;
        right: 5px;
    }

    
  .scroll-container {
    scroll-padding: 50px 0 0 50px;
  }

  ::-webkit-scrollbar {
    width: 7px;
  }

  /* this targets the default scrollbar (compulsory) */

  ::-webkit-scrollbar-track {
    background-color: #73baf3;
  }

  /* the new scrollbar will have a flat appearance with the set background color */

  ::-webkit-scrollbar-thumb {
    background-color: #2196f3;
  }

  /* this will style the thumb, ignoring the track */

  ::-webkit-scrollbar-button {
    background-color: #0079da;
  }

  /* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */

  ::-webkit-scrollbar-corner {
    background-color: black;
  }
</style>

<script>
module.exports = 
{
    data() {
        return {
            detail: false,
            xheight:'100%'
        }
    },
    computed : {
        xurl: {
            get() {
                return this.$store.state.re_patient.url_print
            },
            set(val) {
                this.$store.commit("re_patient/update_url_print",val)
            }
        },
        selected_patient () {
            let x = this.$store.state.re_patient.selected_patient
            if (x)
                return x
            return {}
        },
        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
        },

        langs() {
            let x = this.selected_patient
            if (!x) return ''

            let si_01 = x.T_OrderHeaderLangIsSI == 'Y' ? ' (SI)' : ''
            let si_02 = x.T_OrderHeaderAddOnSecondLangIsSI == 'Y' ? ' (SI)' : ''

            if (!x.SecondM_LangID) return x.M_LangName + si_01

            return x.M_LangName + si_01 + ', ' + x.SecondM_LangName + si_02
        }
    },
    methods : {
        
    }
}
</script>