import { B as D } from "./BasicForm-dL_oCSPM.js";
import { r as W, __tla as __tla_0 } from "./columns-CcSTU2Qa.js";
import { B as I } from "./Table-0PViRYCf.js";
import { d as P, V as U, bk as L, r as d, h as O, o as y, j as l, l as t, w as u, aH as w, ds as z, cO as A, fm as M, cq as X, aI as j, p as G, A as V, B as q, c as H, ca as K, gW as $, gX as Z, F as J, ac as Q, bR as Y, R as ee, cZ as ne, __tla as __tla_1 } from "./index-9PRMimni.js";
import { s as te, __tla as __tla_2 } from "./schemas-h8fDbkdf.js";
import { c as ae } from "./componentSetting-DVhNDBTO.js";
import { u as oe } from "./useForm-CKmgcynv.js";
let de;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })()
]).then(async ()=>{
    let re;
    re = {
        name: "PrimaryPhysicianReport"
    };
    de = P({
        ...re,
        props: {
            readonly: {
                type: Boolean,
                default: !1
            }
        },
        setup (g, { expose: h }) {
            const f = g, { t: k } = U(), C = L(), _ = ne(), r = d([]), { schemasUpload: v } = te(), [b] = oe({
                schemas: v,
                labelWidth: "auto",
                layout: "horizontal",
                collapsed: !0,
                gridProps: {
                    cols: 4,
                    xGap: 15
                },
                showActionButtonGroup: !1
            }), { primaryPhysicianReportColumns: N } = W(f), i = d([
                {
                    nameContent: "管理信息",
                    nameContentEn: "Administrative information",
                    isWeight: !0
                },
                {
                    nameContent: "病人",
                    nameContentEn: "Patient",
                    isWeight: !0
                },
                {
                    nameContent: "姓",
                    nameContentEn: "Surname",
                    title: "名",
                    titleEn: "First name",
                    isInput: !0,
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "性别",
                    nameContentEn: "Sex",
                    title: "出生日期",
                    titleEn: "Date of birth (dd-mm-yyyy)",
                    isInput: !0,
                    remark1: "1",
                    remark2: null
                },
                {
                    nameContent: "国籍",
                    nameContentEn: "Nationality",
                    title: "职业",
                    titleEn: "Occupation",
                    isInput: !0,
                    isDate: !0,
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "海员注册号",
                    nameContentEn: "Seafarer registration number",
                    remark1: ""
                },
                {
                    nameContent: "保险理赔管理员/船舶代理人",
                    nameContentEn: "Insurance claims administrator/Ship’s agent",
                    isWeight: !0
                },
                {
                    nameContent: "姓名",
                    nameContentEn: "Name",
                    title: "理赔参考号",
                    titleEn: "Claims reference No.",
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "电话",
                    nameContentEn: "Telephone No.",
                    isInput: !0,
                    title: "传真",
                    titleEn: "Fax No.",
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "电子邮件",
                    nameContentEn: "E-mail address",
                    remark1: null
                },
                {
                    nameContent: "雇主",
                    nameContentEn: "Employer",
                    title: "电话",
                    titleEn: "Telephone No.",
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "名称",
                    nameContentEn: "Name",
                    title: "电子邮件",
                    titleEn: "E-mail address",
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "传真",
                    nameContentEn: "Fax No.",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "医疗信息",
                    nameContentEn: "Medical information",
                    isWeight: !0
                },
                {
                    nameContent: "关键日期",
                    nameContentEn: "Key dates",
                    isWeight: !0
                },
                {
                    nameContent: "受伤或发病日期",
                    nameContentEn: "Date of injury or of onset of illness (dd-mm-yyyy)",
                    remark1: null
                },
                {
                    nameContent: "前医疗咨询日期",
                    nameContentEn: "Dates of previous medical consultations (dd-mm-yyyy)",
                    remark1: null
                },
                {
                    nameContent: "当前医疗咨询日期：",
                    nameContentEn: "Date of current consultation (dd-mm-yyyy)",
                    remark1: null
                },
                {
                    nameContent: "历史",
                    nameContentEn: "History",
                    isWeight: !0
                },
                {
                    nameContent: "症状或情况（在受伤的情况下）",
                    nameContentEn: "symptoms or (in the case of injury) circumstances",
                    remark1: ""
                },
                {
                    nameContent: "与当前疾病的有关个人历史",
                    nameContentEn: "Personal history pertinent to current illness",
                    remark1: ""
                },
                {
                    nameContent: "临床检查",
                    nameContentEn: "Clinical examination",
                    isWeight: !0
                },
                {
                    nameContent: "诊断测试的结果（X 射线，CT或 MRI 扫描，实验室测试等）",
                    nameContentEn: "Findings of diagnostic tests (X-ray, CT or MRI scans, lab. tests, etc.) ",
                    remark1: ""
                },
                {
                    nameContent: "诊断",
                    nameContentEn: "Diagnoses",
                    isWeight: !0,
                    remark1: ""
                },
                {
                    nameContent: "与远程医疗服务联系的摘要",
                    nameContentEn: "Summary notes of contact with telemedical service",
                    remark1: ""
                },
                {
                    nameContent: "治疗处方",
                    nameContentEn: "Treatment prescribed ",
                    remark1: null
                },
                {
                    nameContent: "停止治疗的原因",
                    nameContentEn: "Reasons for stopping treatment",
                    remark1: ""
                },
                {
                    nameContent: "建议后续行动（检查，测试，治疗等）,适合工作和在船上活动的限制",
                    nameContentEn: "urgent follow-up action (examinations, tests, treatment, etc.),Fitness to work and restrictions on shipboard activities ",
                    isInput: !0,
                    remark1: ""
                },
                {
                    nameContent: "医师的职业身份",
                    nameContentEn: "Physician’s professional identity",
                    isWeight: !0
                },
                {
                    nameContent: "名称",
                    nameContentEn: "Name",
                    title: "签发日期",
                    titleEn: "Date issued",
                    remark1: "",
                    remark2: null
                },
                {
                    nameContent: "电话",
                    nameContentEn: "Telephone No.",
                    title: "电子邮件",
                    titleEn: "E-mail address",
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "签发人",
                    nameContentEn: "Issued by",
                    title: "专业",
                    titleEn: "Specialty",
                    remark1: "",
                    remark2: ""
                },
                {
                    nameContent: "传真",
                    nameContentEn: "Fax No.",
                    title: "办公地址",
                    titleEn: "Office address",
                    remark1: "",
                    remark2: ""
                }
            ]), m = d();
            function S() {
                return m.value?.getDataSource();
            }
            function T(e) {
                i.value[3].remark2 = Date.parse(e?.birthday) || null, i.value[4].remark2 = C.getLocale === "en" ? e?.rankNameEn || "" : e?.rankName || "", i.value[4].remark1 = C.getLocale === "en" ? e?.nationalNameEn || "" : e?.nationalName || "", i.value[5].remark1 = e?.empNo || "", E();
            }
            function E() {
                m.value?.setBordered(!0), m.value?.setStriped(!1);
            }
            function x(e, n) {
                i.value = e;
                const a = [];
                n && n.length > 0 && (n.forEach((o)=>{
                    o.fileType === "4" && a.push({
                        id: o.fileName || "",
                        url: o.fileUrl || "",
                        name: o.fileName?.split("/").pop() || "",
                        thumbnailUrl: o.fileName || "",
                        fileType: o.fileType,
                        status: "finished"
                    });
                }), r.value = a), Q(()=>{
                    m.value?.reload(), E();
                });
            }
            function R({ file: e, event: n }) {
                try {
                    const a = Y("(" + n.target.response + ")"), { infoField: o } = ae.upload.apiSetting, { code: c } = a, p = a.msg || a.message || "上传失败", s = a[o];
                    c === ee.SUCCESS ? e.thumbnailUrl = s.name : _.error(p);
                } catch  {}
            }
            function F() {
                const e = [];
                return r.value && r.value.length > 0 && r.value.forEach((n)=>{
                    e.push({
                        fileName: n.thumbnailUrl || "",
                        fileType: "4"
                    });
                }), e;
            }
            return h({
                handleOpen: T,
                voList: S,
                listInfo: x,
                getFileList: F
            }), (e, n)=>{
                const a = q, o = j, c = w, p = D;
                return y(), O(J, null, [
                    l(t(I), {
                        class: "isTitleTable",
                        ref_key: "primaryPhysicianReportTableRef",
                        ref: m,
                        columns: t(N),
                        dataSource: t(i),
                        "row-key": (s)=>s.id,
                        autoScrollX: !0,
                        immediate: !1,
                        pagination: !1,
                        "show-table-setting": !1,
                        "can-resize": !1
                    }, null, 8, [
                        "columns",
                        "dataSource",
                        "row-key"
                    ]),
                    l(p, {
                        onRegister: t(b)
                    }, {
                        attachment: u(({})=>[
                                l(c, {
                                    action: `${t(X)().urlPrefix}/files`,
                                    accept: ".doc,.docx,.pdf,.xls,.xlsx",
                                    headers: {
                                        timestamp: new Date().getTime(),
                                        authorization: `${t(A).get(t(M))}`
                                    },
                                    max: 15,
                                    "file-list": t(r),
                                    "onUpdate:fileList": n[0] || (n[0] = (s)=>z(r) ? r.value = s : null),
                                    onFinish: n[1] || (n[1] = ({ file: s, event: B })=>R({
                                            file: s,
                                            event: B
                                        })),
                                    class: "uploadStyle",
                                    "file-list-style": {
                                        margin: 0,
                                        flex: 1
                                    },
                                    disabled: f.readonly
                                }, {
                                    default: u(()=>[
                                            l(o, {
                                                trigger: "hover"
                                            }, {
                                                trigger: u(()=>[
                                                        l(a, {
                                                            strong: "",
                                                            secondary: "",
                                                            class: "size-7"
                                                        }, {
                                                            icon: u(()=>[
                                                                    (y(), H(K(t($)(t(Z).upload))))
                                                                ]),
                                                            _: 1
                                                        })
                                                    ]),
                                                default: u(()=>[
                                                        G(" " + V(t(k)("hsqe.rs.uploadText")), 1)
                                                    ]),
                                                _: 1
                                            })
                                        ]),
                                    _: 1
                                }, 8, [
                                    "action",
                                    "headers",
                                    "file-list",
                                    "disabled"
                                ])
                            ]),
                        _: 1
                    }, 8, [
                        "onRegister"
                    ])
                ], 64);
            };
        }
    });
});
export { de as _, __tla };
