/******************************************************************************
 * 文件名称: Structs.cs
 * 文件说明: 结构体的封装
 * 当前版本: V1.0
 * 创建日期: 2022-04-12
 *
 * 2020-04-12: 增加 businessDLLInvoke 方法




******************************************************************************/
using AnHuiMI.Variables;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PTMedicalInsurance.Variables
{
    //配置信息
    public struct IrisConfigue{
        public string ip;
        public string url;
        public string authorization;
    }

    //接口固定信息
    public struct InterfaceInfo
    {
        public int interfaceDr;
        public int interfaceDr_TY;
        public int mainInterfaceDr;
        public string interfaceID;
        public string interfaceName;
        public int hisHospitalDr;
        public int hospitalDr;
        public string hospitalName;
        public string hospitalNO;
        public string hospitalLevel;
        public string centerURL;
        public string centerURL2;
        public string uploadURL;
        public string downURL;
        public string cardURL;
        public string ecURL;
        public string areaCode;
        public string dllName;
        public string version;
        public string signatureType;
        public string recivedSystem;
        // 三方对接
        public string appId;
        public string privateKey;
        public string secretKey;
        public string publicKey;
        // AccessKey
        public string AK;
        public string SK;
        public string Secret;
        public string dev_no;
        public string dev_safe_info;
        public string cainfo;
        public string BusinessID;
        public string CreditID;
        public string operatoType;
        public string fileName;
        public BranchBusinessInfo MobilePay;  //移动支付密钥信息
        public BranchBusinessInfo PresCir;//处方流转密钥信息 
        public CloudImage cloudImage;//云影像上传
        public OneCodePayInfo oneCodePay; //一码付
    }

    public struct OneCodePayInfo
    {
        public string url;
        public string businessSystemNO;  //业务系统编号
        public string businessSystemKey;  //业务系统密钥

    }

    //分支业务
    public struct BranchBusinessInfo 
    {
        public string url;
        public string appid;  //APPID 或 密钥id
        public string apiSecretKey;  //业务系统密钥
        public string secretKey; //密钥id  密钥KEY
        public string privateKey; //私钥  渠道私钥
        public string channelPublicKey;// 渠道公钥
        public string publicKey; //平台公钥
    }

    public struct CloudImage
    {
        public string collectServerUrl; //数据采集系统服务地址
        public string medPreServerUrl;  //MedPreServerUrl
        public string apiKey;  // apikey
    }

    public struct SelfServiceMachineParam
    {
        public bool isNeedRedirect; //是否需要重定向
        public string cardType;
    }
    //用户信息
    public struct User
    {
        public string ID;
        public string name;
        public string type;
        public string officeID;
        public string officeName;
        public string deptID;
        public string deptName;
    }

    //患者信息
    public struct Patients
    {
        public string businessType;//患者就诊业务类型
        public int adm_Dr;
        public string mdtrtID;
        public string name;
        public string gend;
        public string naty;
        public string age;
        public string brdy;
        public string psn_no;
        public string insuType;
        public string medType;
        public string IDNO;//身份证号码
        public string IDType;
        public string certNO;
        public string certType;
        public string mdtrtcertNO;
        public string mdtrtcertType;
        public string admDiagCode; //Admission Diagnosis
        public string admDiagName;
        public string discDiagCode; //Discharge Diagnosis
        public string discDiagName;
        public string insuplc_admdvs;
        public string mdtrtarea_admvs; //就医地区划
        public string ecToken; //电子凭证令牌
        public Card card;
        public string settlID;
        public string billID;
        public string recordID;
        public string psn_insu_date;
        public string cvlserv_flag;
        public string balc;
        public string emp_name;
        public string psn_type;
        public string psn_insu_stas;
        public string paus_insu_date;
        public string begntime;
        public int OtherProv;
        // 传递给医保的就诊号
        public string insuAdmNo;

        public string disCode;
        public string disName;

        public string operCode; //手术编码
        public string operName; //手术名称

        public string DiseasecCode;  //病种编码
        public string DiseasecName;  //病种名称
        public string DiseasecType;

        public string SettID_HISJSB;
        public string SettID_YBJSB;

        public string RYorCY;   //1入院 2出院
        public string hisDischargeTime; //出院时间
        public int admType;

        public string ExpContent; //扩展字段
        public object ExpContentObj;
        public int unifPayStdType; //包干类型

        public string token;
        public string payAuthNo;
        public string uldLatlnt;
        public string payOrdId;
        public string payToken;
        public string AdmInDepCode;
        public string admAttendDoctorNO;

        public Boolean bChangePIN; //更改社保卡密码
        public Boolean bPresCirul;

        public bool isWorkInjury;//是否工伤患者
        public string injurySite;//伤害部位

        public string oneCodePaySignupStatus; //一码付签约状态
        public bool isOneCodePayEnabled;//启用一码付
        public bool isNoCardSettle; //无卡结算

        public PreAndInProcessAnalysises preAndInPro;
    }

    public struct PreAndInProcessAnalysises
    {
        //1.门诊挂号 2.门诊收费登记 3.住院登记 4.住院收费登记 5.住院执行医嘱 6.门诊结算 7.门诊预结算 8.住院结算 9.住院预结算 10.购药划卡
        /// <summary>
        /// 通过下列场景的值来判断是否调用3101或3102，当前的情况是很多地方已经取消了3102，因为3101和3102入参基本一致。可根据各地实际情况，来决定是调用3101和3102.
        /// 当下列场景的值为0时，表示不调用。不为空且大于0则表示调用。入参里的场景传对应的值。
        /// </summary>
        public string OPRegTrigScen;  //门诊挂号场景 挂号时调用3101
        public string OPChargeRegistrationTrigScen;//门诊收费登记  门诊登记后调用3101
        public string IPRegTrigScen;  //住院登记  住院登记后调用3101
        public string IPChargeRegistrationTrigScen;//住院收费登记  费用上传后调用3101
        public string IPOrderTrigScen;  //住院医嘱  住院医嘱保存时调用3102
        public string OPSetTrigScen;  //门诊结算 门诊结算前调用3102
        public string OPPreSetTrigScen;  //门诊预结算  门诊预结算前
        public string IPSetTrigScen;  //住院结算  住院结算前调用
        public string IPPreSetTrigScen;  //住院预结算  住院预结算调用

        public string OPOrderTrigScen;  //门诊医嘱场景

        public string MedInsType;
        public string MedInsLevel;
        public string OPMedType;
        public string IPMedType;
    }
    public struct Card
    {
        public string type;
        public string SN;
        public string password;
        public string level;
        public string NO;
        public string Cardtoken;
        public string SearchAdmKey;
        public string SearchAdmCode;
        public string SearchAdmName;
        public string ecBizType;
        public string outBizNo;//电子凭证生成的流水号
    }

    //费用信息
    public struct Fees
    {
        public int adm_Dr;
        public string mdtrtID;
        public string feeDetlSn;
        public string orderNO;
        public string hisCode;
        public string hisName;
        public string insuCode;
        public string insuName;
        public string sumamt;
        public string count;
        public string price;
        public string billDeptCode;
        public string billDeptName;
        public string billDrCode;
        public string billDrName;
        public string acceptDeptCode;
        public string acceptDeptName;
        public string orderDrCode;
        public string orderDrName;
        public string limitUseFlag;
        DateTime occurTime;
        public string insuplc_admdvs;
        
    }

    //结算信息
    public struct Settlements
    {

        public int adm_Dr;
        public string mdtrtID;
        public string settlID;
        public string billID;
        public string recordID;
        public string clearingType;
        public string clearingWay;
        public string clearingOrgan;
        DateTime occurTime;
        public DateTime settlTime;//结算时间
        public int hospitalizationsTimes;
        public int hospitalizationsDays;
        public string hisAdmTime;
        public string hisDischargeTime;
        public string ordStas;
        public decimal sumamt;
        public decimal ownPayAmount; //超限价自费费用
        public decimal overLimitAmountmt; //超限价自费费用
        public decimal preSelfPayAmount;//先行自付金额
        public decimal inPolicyRangeAmount;//符合政策范围金额
        public decimal actualPayDeductible;//实际支付起付线
        public decimal healthInsurancePay;//基本医疗保险统筹基金支出
        public decimal healthInsuranceRatio;//基本医疗保险统筹基金支付比例
        public decimal civilserviceAllowancePay;//公务员医疗补助资金支出
        public decimal enterpriseSupplementPay;//企业补充医疗保险基金支出
        public decimal seriousIllnessPay;//居民大病保险资金支出
        public decimal largeExpensesSupplementPay;//职工大额医疗费用补助基金支出
        public decimal medicalAssistPay;//医疗救助基金支出
        public decimal hospitalPartAmount;//医院负担金额
        public decimal otherPay;//其他支出
        public decimal fundPaySumamt;//基金支付总额
        public decimal personPaySumamt;//个人负担总金额
        public decimal accountPaySumamt;//个人账户支出
        public string acctPay;

        public string dspoWay; //1继续执行 2修改医嘱
        public string dspoWayRea;

        public string wltpayAmt;

        public decimal personCashPay;//个人现金支出
        public decimal balance; //余额
        public decimal accountMutualAidAmount;//个人账户共济支付金额
        public decimal deposit;//住院押金
        public int confirmFlag; //确认标志
        public string onlineYBFalg; //线上线下标志  Y  N
        public string payOrdId; //订单编号

        public string minpacunt_drug_trac_cnt; //本次结算应上传最小包装追溯码数量
        public string mcs_trac_cnt; //本次结算应上传耗材追溯码数量

        public decimal ybAmt;//返给HIS的医保总的金额，符合his基本公式  
        public decimal psnAcctAmt;//返给HIS的个人支付的账户的总的的金额，符合his基本公式    
        public decimal psnCashAmt;//返给HIS的个人支付的总的金额，符合his基本公式
        public decimal hospAmt;//返给HIS的医院承担金额，符合his基本公式  
    }

    //当前环境实时信息
    public struct currentEnvironment
    {
        public  string path;
        public string mac;
        public string ip;

        public string signno;
        public string msgid;
        public string URL;
        public JArray jaSession;

        /// <summary>
        /// 调试模式
        /// </summary>
        public bool enabledDebug;

        public CurEvtExtend ext;

    }
}
