<template>
    <first-page-of-medical-record v-if="isShow"
                                  :dics="dics"
                                  :sheet-data="sheetData"/>
</template>

<script setup name="EmrFirstPageOfMedicalRecord">
import FirstPageOfMedicalRecord from "@/components/pat-info-list/FirstPageOfMedicalRecord.vue";
import {getAllDictionary, getSheetInfo} from "@/api/case-front-sheet";
import {operations} from "@/data";
import {autopsies, haveOrNot, yesOrNo} from "@/views/hospitalization/case-front-sheet/common";

const dics = ref([])
const sheetData = ref({})

const isShow = ref(false)

const props = defineProps({
    patInfo: Object
})


onMounted(async () => {

    let res = await getAllDictionary()
    res.getOperations = operations;
    res.getYesOrNo = yesOrNo;
    res.getHaveOrNot = haveOrNot;
    res.getAutopsies = autopsies;
    dics.value = res

    sheetData.value = await getSheetInfo({
        bah: props.patInfo.inpatientNo,
        times: props.patInfo.admissTimes,
        inOutFlag: props.patInfo.$inOutFlag
    })

    isShow.value = true

})

</script>

<style scoped lang="scss">

</style>
